1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| msg = [0xCD, 0xEB, 0x5E, 0x76, 0x0F, 0x22, 0xAF, 0x31, 0x82, 0x92, 0x3C, 0xEF, 0xB8, 0xC1, 0x76, 0x06, 0x18, 0x2F, 0xB5, 0x7D, 0x7F, 0x0A, 0xEA, 0x85, 0x92, 0x00, 0x89, 0xA3, 0x2C, 0xE2, 0xE7, 0x32] index_ = [0x0A, 0x07, 0x06, 0x0E, 0x02, 0x0B, 0x03, 0x0D, 0x01, 0x09, 0x00, 0x05, 0x04, 0x0F, 0x08, 0x0C, 0x1B, 0x18, 0x17, 0x1F, 0x14, 0x1E, 0x12, 0x13, 0x15, 0x1D, 0x16, 0x1C, 0x11, 0x10, 0x19, 0x1A] des = [0x5F, 0x91, 0x99, 0xE8, 0x4E, 0xD0, 0xB0, 0x92, 0xB1, 0x3C, 0x4F, 0xF4, 0x17, 0x76, 0xDA, 0x12, 0x2A, 0x35, 0x01, 0x15, 0xF9, 0x97, 0x5E, 0x19, 0x9D, 0xC2, 0x15, 0x99, 0x70, 0x7D, 0x9F, 0xCC] des2 = [] for i in range(32): des2.append(des[index_[i]])
for i in des2: print(hex(i)[2:].upper(), end='')
des3 = [] for i in range(32): des3.append(des[index_.index(i)])
print()
for i in des3: print(hex(i)[2:].upper(), end='')
print()
for i in range(32): des3[i] ^= msg[i]
for i in des3: print(hex(i)[2:].upper(), end='')
''' 4F92B0DA99F4E876913C5FD04E12B117999D19CCF99F115977D5E70352AC215 4FB14EB017F49991DA3C5FD01292E8767D705E19F99D151359FCC2A99C29715 825A10C618D636A058AE633FAA539E70655FEB648697FF84A79F4589B5207027 '''
|