简体   繁体   English

手动生成交流密码

[英]generate AC cryptogram manually

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. 我正在尝试手动生成交流,我有一个生成交流的工具,但是我想自己生成它以了解相同的算法。

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. 据我了解,用于生成AC的数据取决于标签8C-CDOL1,我们通过Gen AC命令+ AIP + ATC将其提供给卡。

AIP and ATC - accessed internally by ICC. AIP和ATC-由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.

this is my logic ,it might be I am using wrong data to calculate AC that's why getting different result from my test tool. 这是我的逻辑,可能是我使用了错误的数据来计算AC,这就是为什么从测试工具获得不同结果的原因。

Terminal Supplied Data 终端提供的数据
Amount, Authorised - 000000000201 授权金额-000000000201
Amount, Other - 000000000000 其他金额-000000000000
Terminal Country Code - 0826 - United Kingdom 码头区号-0826-英国
Terminal Verification Results - 00 00 00 00 00 终端验证结果-00 00 00 00 00
Transaction Currency Code - 0826 - Pound Sterling 交易货币代码-0826-英镑
Transaction Date - 15 04 28 交易日期-15 04 28
Transaction Type - 00 - Goods and Services 交易类型-00-商品和服务
Unpredictable Number - 30 90 1B 6A 不可预测的数字-30 90 1B 6A
Terminal Type - 23 - Attended, offline only. 终端类型-23-出席,仅离线。 Operated by Merchant 由商家经营
Data Authentication Code - 00 00 数据验证码-00 00
ICC Dynamic Number - 1E AB C1 26 F8 54 99 76 ICC动态编号-1E AB C1 26 F8 54 99 76
CVM Results - 00 00 00 CVM结果-00 00 00

Gen AC Using CDOL1 80 AE 40 00 2B 0000000002010000000000000826000000000008261504280030901B6A2300001EABC126F8549976000000 this command is returning 9F26. Gen AC使用CDOL1 80 AE 40 00 2B 0000000002010000000000000000000826000000000008261504280030901B6A2300001EABC126F8549976000000此命令返回9F26。 data i used for calcatation is:- 我用于校准的数据是:-

0000000002010000000000000826000000000008261504280030901B6A2300001EABC126F8549976000000 3800000180 [ data is multiple of 8] 00000000020100000000000008268260000000000008261504280030901B6A2300001EABC126F8549976000000 3800000180 [数据为8的倍数]

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. 其中3800是AIP,0001是ATC,80是填充[填充方法2 EMV]这是我的逻辑,是谁能告诉我在哪里我应该更多地关注与我生成的工具相同的AC。

MasterCard Application Cryptogram ( AC ) generation is more complicated than other card schemes. 万事达卡应用密码( AC )的生成比其他卡方案更为复杂。

  1. Card can use different ICC Session Key Derivation ( SKD ) methods: 卡可以使用不同的ICC会话密钥派生( SKD )方法:

    • MasterCard Proprietary SKD, where involved Application Transaction Counter ( ATC ) and Unpredictable Number ( UN ); 万事达卡专有SKD,其中涉及申请交易计数器( ATC )和不可预测的号码( UN );
    • EMV2000 Method, where involved only ATC - see EMV 4.0, Book 2 ; EMV2000方法,仅涉及ATC-参见EMV 4.0, 规格 书2
    • EMV Common Session Key ( CSK ) Method, where involved only ATC - see EMV 4.2, Book 2 ; EMV公用会话密钥( CSK )方法,其中仅涉及ATC-请参阅EMV 4.2,第2册
  2. Data Objects ( DO ) can be with different sets of additional or modified values: 数据对象( DO )可以具有不同的附加值或修改值集:

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

The used method and data variant can be detected by Cryptogram Version Number ( CVN ) and Application Control bits. 可以通过密码版本号( CVN )和应用程序控制位来检测所使用的方法和数据变体。 CVN is sub-field of IAD tag 0x9F10 . CVN是IAD标签0x9F10子字段。

The detailed information are proprietary and available for the MasterCard members. 详细信息是专有信息,可供万事达卡会员使用。

For deep learning about it take a look into " M/Chip Card Application Cryptographic Algorithms " and M/Chip Card Application references. 要深入了解它,请查看“ M /芯片卡应用程序加密算法 ”和M / Chip Card应用程序参考。

CRYPTOGRAM CALCULATOR Generate and verify EMV ARQC, ARPC and TC cryptograms, calculated using the vital parameters of the card, UDKs, ATC etc. 密码计算器生成并验证EMV ARQC,ARPC和TC密码,这些密码是使用卡,UDK,ATC等重要参数计算得出的。

This application derives session keys from the card master key, following the algorithm described in EMV 4.1, Book 2, Part III, Annex A1.3. 此应用程序遵循EMV 4.1,第二册,第3部分,附件A1.3中描述的算法,从卡主密钥中获取会话密钥。 Optionally it can generate application cryptograms (ARQC, TC, AAC, AAR), when given the input the the Generate Application Cryptogram command, and the internal configuration of the card. 可选地,当输入了生成应用程序密码命令和卡的内部配置时,它可以生成应用程序密码(ARQC,TC,AAC,AAR)。

http://extranet.cryptomathic.com/cryptogram/index http://extranet.cryptomathic.com/cryptogram/index

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM