|
吾爱游客
发表于 2019-12-22 20:43
1、申 请 I D : flybird219
2、个人邮箱:flybird219@163.com
3. 原创技术文章:关于一些IC卡数据分析总结。
00002028 41011401 00000000 002028 0C 82.32金额
**** **** **** **
00001B14 41011301 00000000 001B14 CB 69.32金额
000019A8 41011301 00000000 0019A8 CB 65.68金额
00001818 41011301 00000000 001818 1F 61.68 金额
00001110 41011601 00000000 001110 E0 43.68=1110
00001044 41011301 00000000 001044 23 41.64=09D0
000009D0 41011401 00000000 0009D0 BB 25.12
0000036C 41011301 00000000 00036C DF 8.76
求这个怎么计算效验码 金额 直接转16就是前面一段的数据 最后一段数据是效验码吧
效验码是:crc-8/MAXIM值即为效验码
----------------------------------------------------------------------------------------
19270000e6d8ffff192700000cf30cf3 100.9
10270000EFD8ffff102700000cf30cf3 100
46000000B9FFFFFF460000000cf30cf3 0.7
3C000000C3FFFFFFC30000000cf30cf3 0.6
F3020000CFDEFFFFF30200000cf30cf3 7.55
金额代码XOR校验码=FFFF
01 12 52 00 07 35 73 F1 FF FF FF FF FF FF FF FF-----------------18.63
01 12 52 00 07 4C 0A F1 FF FF FF FF FF FF FF FF-----------------18.68
01 12 52 00 07 4E 08 F1 FF FF FF FF FF FF FF FF------------------18.70
01 12 52 00 07 4F 09 F1 FF FF FF FF FF FF FF FF------------------18.71
固定码XOR金额码=校验码(01oxr12oxr52oxr07oxr35=73)
------------------------------------------------------------------------------------------
## 第一张卡
-----------------------------
金额 | 扇区数据
:--- |:---
56.77 | 3C 48 2D 16 05 B7 00 00 00 02 02 00 00 FD 00 B7
56.65 | 35 37 21 16 00 C8 00 00 00 02 02 00 00 FD 00 C8
56.15 | F8 04 EF 15 00 FB 00 00 00 02 02 00 00 FD 00 FB
56.00 | F7 F5 E0 15 00 0A 00 00 00 02 02 00 00 FD 00 0A
55.00 | 6B 91 7C 15 00 6E 00 00 00 02 02 00 00 FD 00 6E
## 另一张卡
-----------------------------
金额 | 扇区数据
:--- | :---
12.20 | C1 C8 C4 04 00 37 00 00 00 01 01 00 00 FE 00 38
10.00 | EA EB E8 03 00 14 00 00 00 01 01 00 00 FE 00 15
00.00 | 01 00 00 00 00 FF 00 00 00 01 01 00 00 FE 00 00
## 算法分析
-----------------------------
- 第三位和第四位是金额
`2D 16 -> 162D -> 5677 -> 56.77`
- 第二位是第三位, 第四位, 第五位的和
`48 = 2D + 16 + 05`
- 第六位与第十六位是第二位取反
`B7 = NOT 48`
- 第一位是异或第二位到第十五位的值
`3C = 48 XOR 2D XOR 16 XOR 05 XOR B7 XOR 00 XOR 00 XOR 00 XOR 02 XOR 02 XOR 00 XOR 00 XOR FD XOR 00`
------------------------------------------------------------------------------------------------------
08 00 00 00 f7 ff ff ff 08 00 00 00 11 ee 11 ee
0d 00 00 00 f2 ff ff ff 0d 00 00 00 11 ee 11 ee
8元
03 00 00 00 fc ff ff ff 03 00 00 00 11 ee 11 ee
08 00 00 00 f7 ff ff ff 08 00 00 00 11 ee 11 ee
9、08为金额,08按反位取F7,08+05(每次消费额度)=13转16进制(0d),0D取反位为F2
————————————————---------------------------------------------------------------------
01 C6 00 00 00 00 00 00 00 00 00 00 00 8E E3 F5 4,54
01 C4 00 00 00 00 00 00 00 00 00 00 00 8F E0 F8 4.52
00 00 00 00 00 00 00 00 00 00 00 00 01 DF 74 64 0000
FF FF 00 00 00 00 00 00 00 00 00 00 00 8F 25 B3
前15异或和为AA 15、16位异或和为8D,
----------------------------------------------------------------------------------------------------
10 27 00 00 10 27 00 00 00 00 BE 14 00 00 00 40 100
00 00 00 00 10 27 00 00 00 00 BE 14 00 00 00 09
28 23 00 00 28 23 00 00 00 00 7E 15 00 00 00 29 90
00 00 00 00 28 23 00 00 00 00 7E 15 00 00 00 DE
第一行校验码是 第一行的累加和40、29 第二行校验码:第二行累加和
----------------------------------------------------------------------------------
06 6A 00 00 00 00 00 00 00 00 00 00 03 66 A3 35 16.42
06 69 00 00 00 00 00 00 00 00 00 00 03 67 A1 37 16.41
06 68 00 00 00 00 00 00 00 00 00 00 03 68 AF 29 16.40
06 67 00 00 00 00 00 00 00 00 00 00 03 69 A1 37 16.39
06 66 00 00 00 00 00 00 00 00 00 00 03 6A A3 35 16.38
06 60 00 00 00 00 00 00 00 00 00 00 03 70 BF 19
前15异或和为AA 15、16位异或和为8D,
----------------------------------------------------------------------------
D2 05 00 00 2D FA FF FF D2 05 00 00 01 FE 01 FE 14.90
CD 05 00 00 32 FA FF FF CD 05 00 00 01 FE 01 FE 14.85
B4 05 00 00 4B FA FF FF B4 05 00 00 01 FE 01 FE 14.60位
按位前两位按位取反即为效验码
--------------------------------------------------------------------------
00 02 85 00 00 00 00 00 00 00 02 00 00 00 C0 81 64.5
00 02 3F 00 00 00 00 00 00 00 03 00 00 00 C0 3C 57.5
00 02 1C 00 00 00 00 00 00 00 04 00 00 00 C0 1A 54.0
00 01 B3 00 00 00 00 00 00 00 05 00 00 00 C0 B1 43.5
02 + 85 - 08 + 02 = 81
02 + 3F - 08 + 03 =3C
02 + 1C - 08 + 04 =1A
01 + B3 - 08 + 05 = B1
--------------------------------------------------------------------------------------
80 0A 00 00 7F F5 FF FF 80 0A 00 00 0C F3 0C F3 26.88
83 0A 00 00 7C F5 FF FF 83 0A 00 00 0C F3 0C F3 26.91
例如金额为26.88—2688–0000101010000000—1111010101111111–F5 7F–7F F5
计算方法如下:
校验位7F F5-翻转为F5 7F转换二进制为1111010101111111 二进制取余为0000101010000000 转换为十进制为:
Hex(0000101010000000)=2688
可以得出金额校验位的加密方式为将金额转换为二进制后取余,取余后的二进制转换为16进制,
将16进制翻转后得到的结果就是金额校验位的信息
例如金额为26.88—2688–0000101010000000—1111010101111111–F5 7F–7F F5
计算出金额校验位应填7F F5
反取0改1,1改0
------------------------------------------------------------------------------------------------
DA 21 00 00 00 00 0F 08 13 09 31 00 02 00 01 61 86.66
D2 21 00 00 00 00 0F 08 13 09 31 00 02 00 01 59 86.58
DA=218、21=33、218+33=251、0161=353、251-353=102、
D2=210、21=33、210+33=242、243+102=345 345转16进制0159
------------------------------------------------------------------------------------ |
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|