SDA validation with BP-CCALC & BP-CEDIT

This is how one of our clients used the EFTlab’s BP-CryptoCalc and BP-CardEdit tools to verify SDA calculation on data straight from Thales P3, without a personalized plastic. Great.

Retrieve CA PK

EFTlab was recently contacted by one of its clients in a matter to assist with personalized card data validation for SDA. All started with using BP-CardEdit for extraction of ICC data as provided in output file from Thales P3 device. Tags taken were [90] – Issuer Public Key Certificate, [92] – Issuer Public Key Remainder, [9F32] – Issuer Public Key Exponent as demonstrated on picture below:

Extracted values were used in BP-CryptoCalc as an input into the Static Data Authentication screen. CA PK values were taken from VISA based on card’s RID. As it can be seen on a screen BP-CryptoCalc did a data recovery procedure followed by all validation steps resulting with Issuer’s Public Key Module Recovery:

BP-CryptoCalc log output

Log File:
[2014-01-10 12:04:35 PM] BP-Tools – Cryptographic Calculator is ready
********************
[2014-01-10 12:04:40 PM] Issuer Public Key Recovery
********************
CA PK Modulus: A0DCF4BDE19C3546B4B6F0414D174DDE294AABBB828C5A834D73AAE27C99B0B053A90278007239B6459FF0BBCD7B4B9C6C50AC02CE
91368DA1BD21AAEADBC65347337D89B68F5C99A09D05BE02DD1F8C5BA20E2F13FB2A27C41D3F85CAD5CF6668E75851EC66EDBF98851FD4E42C44C1
D59F5984703B27D5B9F21B8FA0D93279FBBF69E090642909C9EA27F898959541AA6757F5F624104F6E1D3A9532F2A6E51515AEAD1B43B3D7835088A2FA
FA7BE7

Issuer’s Public Key Certificate: 0168A2D2D7DE9308D88506723EFF2E12F34B011CC4A5B429AB7397388055A174B0ECF579624C68397B4AC02C73C2DE4875
46210B4ECAFAB9BC58BE6C0D53893E71A4DAECFF86771EC82A28B94D08BC7FA9B5BFD04FC68BE2982E87DAC2E6E83E8C3155F9793DDA1BCFA0921D
661CBCCC6A009421ECBA4EF34EA7A20472BC4E47D1F9524B45F5251F3F52A825A958E63893D222A9F9301DA9F5E1A6461BAA977E99AA143FE4ADCFA8
73ACBEC79C6714B6
——————–
Recovered Data:                         6A02516609FF12220238040101B001D4CFB8496A3A8AA744D1FC806D131C03FC80056699806EC029ADAB957BCF0941E3CA
C1F5A420AEC731E4F67A70A5C8392B696FE26AAFA4A701822013E7ADD5DBCC0B9D7CA948B5ACDE39E03CD724E0C800104507CB9CC6AEBFC2198472
7EE595CED2000E66265AF94B989E1E2F98238CD58E88088A4DEBB733219DA284AF2A702CA2BE8532C69C7A99D73AA9CD82D748EE53C974726831AA5
CFC7F5A66930C50BC

Data Header:                                   6A
Data Format:                                    02
Issuer Identifier:                               516609FF
Certificate Expiration Date:           1222
Certificate Serial Number:             023804
Hash Algorithm Indicator:              01
Issuer Public Key Algorithm Indicator: 01
Issuer Public Key Length:              B0
Issuer Public Key Exponent Length:     01
Issuer Public Key:                     D4CFB8496A3A8AA744D1FC806D131C03FC80056699806EC029ADAB957BCF0941E3CAC1F5A420AEC731E4F67A70A5C8392
B696FE26AAFA4A701822013E7ADD5DBCC0B9D7CA948B5ACDE39E03CD724E0C800104507CB9CC6AEBFC21984727EE595CED2000E66265AF94B989E
1E2F98238CD58E88088A4DEBB733219DA284AF2A702CA2BE8532C69C7A99D73AA9
Hash Result:                           CD82D748EE53C974726831AA5CFC7F5A66930C50
Data Trailer:                            BC
Decoded Data Length:         176
——————–

Recovered Data validation:
——————–
Step 1: CA PK Modulus and Issuer’s Public Key Certificate having the same size: Passed
Step 2: Recovered Data Trailer check:         Passed
Step 3: Recovered Data Header check (0x6A):   Passed
Step 4: Certificate Format check (0x02):      Passed
Step 5: Hash Input Data:                      02516609FF12220238040101B001D4CFB8496A3A8AA744D1FC806D131C03FC80056699806EC029ADAB957BCF0941
E3CAC1F5A420AEC731E4F67A70A5C8392B696FE26AAFA4A701822013E7ADD5DBCC0B9D7CA948B5ACDE39E03CD724E0C800104507CB9CC6AEBFC
21984727EE595CED2000E66265AF94B989E1E2F98238CD58E88088A4DEBB733219DA284AF2A702CA2BE8532C69C7A99D73AA9903FE524A39E25312
CD68CD2E60BBE936A55FB047BFEF082A19CB9E1D6F3D0FBE0B8B4AD03
Step 6: Hashing Result:                                 CD82D748EE53C974726831AA5CFC7F5A66930C50
Step 7: Hash Result Comparison:               Passed
Step 8: Issuer Identifier check:                     Skipped (DIY)
Step 9: Certificate Expiry Date check:        Passed
Step 10: RID revocation check:                   Skipped (optional DIY)
Step 11: PK Algorithm Indicator check:      Passed

Step 12: Issuer Public Key Modulus:           D4CFB8496A3A8AA744D1FC806D131C03FC80056699806EC029ADAB957BCF0941E3CAC1F5A420AEC731E4F6
7A70A5C8392B696FE26AAFA4A701822013E7ADD5DBCC0B9D7CA948B5ACDE39E03CD724E0C800104507CB9CC6AEBFC21984727EE595CED2000E66
265AF94B989E1E2F98238CD58E88088A4DEBB733219DA284AF2A702CA2BE8532C69C7A99D73AA9903FE524A39E25312CD68CD2E60BBE936A55FB04
BFEF082A19CB9E1D6F3D0FBE0B8B4AD
——————–
Issuer’s Public Key Module Recovery succeeded.

 

Verify SSDA

In the next step there was a need to form static data. This block was constructed manually in MS Excel as per 10.3 of EMV Book 3 again from data retrieved from BP-CardEdit.

Last step was to extract tag [93] – Signed Static Application Data from P3 file and fill in these together with constructed Static Data into Verify SSAD tab in BP-CryptoCalc. BP-CryptoCalc did another data recovery procedure with another set of validation steps and compared resulting hashes – ending with Success!

 

BP-CryptoCalc log output

Log File:
[2014-01-10 12:06:32 PM] BP-Tools – Cryptographic Calculator is ready
********************
[2014-01-10 12:07:55 PM] SSAD Verification
********************
Issuer PK Modulus: D4CFB8496A3A8AA744D1FC806D131C03FC80056699806EC029ADAB957BCF0941E3CAC1F5A420AEC731E4F67A70A5C8392B696FE26
AAFA4A701822013E7ADD5DBCC0B9D7CA948B5ACDE39E03CD724E0C800104507CB9CC6AEBFC21984727EE595CED2000E66265AF94B989E1E2F98238
CD58E88088A4DEBB733219DA284AF2A702CA2BE8532C69C7A99D73AA9903FE524A39E25312CD68CD2E60BBE936A55FB047BFEF082A19CB9E1D6F3D0
FBE0B8B4AD

Signed Static Application Data: 608CC2CC556C90C3DB4902B34C4C97FC2DE30ED663D663A6557466C00A10E07A85A27413A9FAFEA1960F6C5430E400227
189278D9C41E87EF3E4078A82391866501B002F1929F52A36D8AD9C308783AF9582152A11C5D9CFBFFAE9FF88C3725D90E7C5379BFCD273BF67F14974D
491B31EC0C8DD8E1676E52BB810AE1F8B00B19D3505078F446B72D9290DC3EE28BADF2C4A03E6948303B6AEE358615EA56DEE6FFCFE5834BBC1FDDE
A9FBEA9B762390
——————–

Recovered Data: 6A0301DAC1BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB23D11C3DE0DB6
BDBA0211C73A7B16D30FAE370BCBC
Data Header: 6A
Signed Data Format: 03
Hash Algorithm Indicator: 01
Data Authentication Code: DAC1
Pad Pattern: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
Hash Result: 23D11C3DE0DB6BDBA0211C73A7B16D30FAE370BC
Data Trailer: BC

Recovered Data validation:
——————–
Step 1: Issuer PK Modulus and Signed Static Application Data having the same length: Passed
Step 2: Recovered Data Trailer check: Passed
Step 3: Recovered Data Header check (0x6A): Passed
Step 4: Certificate Format check (0x03): Passed
Step 5: Build Hash Input Data: 0301DAC1BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB5F2503
1311015F24031611309F0702FF005A0851660910000001075F3401008E100000000000000000420142031E031F039F0D05F8406420009F0E0500108800009F
0F0500F86064F85F280203565800
Step 6: Hashing Result: 23D11C3DE0DB6BDBA0211C73A7B16D30FAE370BC
Step 7: Hash Result Comparison: Passed
——————–

SDA Validation Succeed.

Summary

This example clearly demonstrates how the card product data can be easily validated without a need of physical card production. EFTlab’s products were developed for cases like this, saving precious resources where needed.