Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # we assume P1 = P3 and P2 = P4
- # in F1 function: a ^ d = 0 infer 0 ^ 0x48EF856C = 0 infer F1 = 0 ^ d = d
- # in F2 like F1 function, should we had F2 = d ^ 0xE5824A68
- # call general value of P1, P3 is X and general value of P2, P4 is Y,
- # from R = R1 ^ R2 == 0x4890882A, to success R must be equal 0x4890882A should R1 ^ R2 = 0x4890882A
- # same F1 ^ F2 = 0x4890882A same X ^ Y ^ 0xE5824A68 = 0x4890882A
- # infer X ^ Y = 0x4890882A ^ 0xE5824A68 same X ^ Y = 0xAD12C242.
- # result X = 0xAD12C242 ^ Y
- import random
- def F1(a, d):
- return ((a ^ d) & 0x48EF856C) ^ d
- def F2(a, d):
- return (((a ^ d) & 0x0B76bF76) ^ d) ^ 0xE5824A68
- # P1 = Serial(0x09,8)
- # P2 = Serial(0x31,8)
- # P3 = Serial(0x39,8)
- # P4 = Serial(0x19,8)
- P2 = P4 = random.randrange(0,0xFFFFFFFF)
- P1 = P3 = 0xAD12C242 ^ P2
- R1 = F1(P1,P3)
- print "R1 = 0x%08X" % (R1)
- R2 = F2(P4,P2)
- print "R2 = 0x%08X" % (R2)
- R = R1 ^ R2
- print "R = 0x%08X" % (R)
- if (R == 0x4890882A):
- print "Done!!"
- else:
- print "Oops!!"
- # .eg: 000000001234567800000000BF26943A0000000000000000BF26943A12345678
Advertisement
Add Comment
Please, Sign In to add comment