手动生成AC密码 [英] generate AC cryptogram manually

查看:147
本文介绍了手动生成AC密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试手动生成交流电,我有一个生成交流电的工具,但我想自己生成它以了解相同的算法.

I am trying to generate AC manually, I have a tool to generate AC but I want to generate it by my own to understand the algorithm for the same.

我的计算适用于Discover卡,但对于万事达卡却失败了.据我了解,用于生成交流电的数据取决于Tag 8C-CDOL1,我们通过Gen AC命令+ AIP + ATC将其提供给卡.

My calculation is fine for Discover card but it is failing for MasterCard. As per my understanding, data used to generate AC is depend on Tag 8C - CDOL1 which we provide to card with Gen AC command + AIP + ATC.

AIP和ATC-由ICC内部访问.

AIP and ATC - accessed internally by ICC.

用于生成交流的数据为:-

Data used to generate AC is:-

data part of Gen AC command + value of tag 82 + value of tag 9f36 + 80 + optional 00 to make it multiple of 8.

这是我的逻辑,可能是我使用了错误的数据来计算A.C,这就是为什么从测试工具获得不同结果的原因.

this is my logic ,it might be I am using wrong data to calculate A.C that's why getting different result from my test tool.

终端提供的数据
授权金额-000000000201
其他金额-000000000000
终端国家代码-0826-英国
终端验证结果-00 00 00 00 00
交易货币代码-0826-英镑
交易日期-15 04 28
交易类型-00-商品和服务
不可预测的数字-30 90 1B 6A
终端类型-23-出席,仅离线.由商家运营
数据验证码-00 00
ICC动态编号-1E AB C1 26 F8 54 99 76
CVM结果-00 00 00

Terminal Supplied Data
Amount, Authorised - 000000000201
Amount, Other - 000000000000
Terminal Country Code - 0826 - United Kingdom
Terminal Verification Results - 00 00 00 00 00
Transaction Currency Code - 0826 - Pound Sterling
Transaction Date - 15 04 28
Transaction Type - 00 - Goods and Services
Unpredictable Number - 30 90 1B 6A
Terminal Type - 23 - Attended, offline only. Operated by Merchant
Data Authentication Code - 00 00
ICC Dynamic Number - 1E AB C1 26 F8 54 99 76
CVM Results - 00 00 00

使用CDOL1的Gen AC 80 AE 40 00 2B 0000000002010000000000000826000000000008261504280030901B6A2300001EABC126F8549976000000 该命令返回9F26. 我用于校准的数据是:-

Gen AC Using CDOL1 80 AE 40 00 2B 0000000002010000000000000826000000000008261504280030901B6A2300001EABC126F8549976000000 this command is returning 9F26. data i used for calcatation is:-

0000000002010000000000000826000000000008261504280030901B6A2300001EABC126F8549976000000 3800000180 [数据是8的倍数]

0000000002010000000000000826000000000008261504280030901B6A2300001EABC126F85499760000003800000180 [ data is multiple of 8]

3800是AIP 0001是ATC,而80是填充[填充方法2 EMV]这是我的逻辑,请问有人能告诉我应该在哪里集中更多精力来生成与生成的工具相同的AC.

Where 3800 is AIP 0001 is ATC and 80 for Padding [ Padding method 2 EMV] This is my logic, Is any body tell me where I should focus more to generate same AC as my tool generated.

推荐答案

万事达卡应用密码( AC )的生成比其他卡方案更为复杂.

MasterCard Application Cryptogram (AC) generation is more complicated than other card schemes.

  1. 卡可以使用不同的ICC会话密钥派生( SKD )方法:

  • 万事达卡专有SKD,其中涉及应用程序交易计数器( ATC )和不可预测的号码( UN );
  • EMV2000 方法,其中仅涉及 ATC -请参见 EMV 4.0,第二册
  • EMV公共会话密钥( CSK )方法,其中仅涉及 ATC -请参见 EMV 4.2,第二册
  • MasterCard Proprietary SKD, where involved Application Transaction Counter (ATC) and Unpredictable Number (UN);
  • EMV2000 Method, where involved only ATC - see EMV 4.0, Book 2;
  • EMV Common Session Key (CSK) Method, where involved only ATC - see EMV 4.2, Book 2;

数据对象( DO )可以具有不同的附加值或修改值集:

Data Objects (DO) can be with different sets of additional or modified values:

  • 卡验证结果(CVR)可以是6个字节或4个字节.
  • 可以包括发卡行应用数据( IAD )中的脱机计数器.
  • 可以包含最后的在线ATC值.
  • Card Verification Results (CVR) can be 6 or 4 bytes.
  • The offline counters from Issuer Application Data (IAD) can be included.
  • Last online ATC value can be included.

可以通过密码版本号( CVN )和应用程序控制位来检测所使用的方法和数据变体. CVN是IAD标签0x9F10的子字段.

The used method and data variant can be detected by Cryptogram Version Number (CVN) and Application Control bits. CVN is sub-field of IAD tag 0x9F10 .

详细信息是专有的,可供万事达卡会员使用.

The detailed information are proprietary and available for the MasterCard members.

要深入了解它,请查看" M/芯片卡应用程序加密算法"和M/Chip Card应用程序参考.

For deep learning about it take a look into "M/Chip Card Application Cryptographic Algorithms" and M/Chip Card Application references.

这篇关于手动生成AC密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆