
Originally Posted by
rael88
Huawei algo for all
unlock code (imei 123456789012347):
MD5 ("1234567890123475e8dd316726b0335") = 8f 43 ae 1a 33 19 c6 49 cc 57 40 8b 6a 39 2d 6b
8f xor 33 xor cc xor 6a =1a
43 xor 19 xor 57 xor 39 =34
ae xor c6 xor 40 xor 2d =05
1a xor 49 xor 8b xor 6b =b3
1a3405b3 and 1ffffff or 2000000 = 23405B3 -----------in delphi
hex2dec (23405B3) = 36963763 -> unlock code
same steps for flash code , only one different
MD5 ("12345678901234797B7BC6BE525AB44")= ..............
See here:
Exclusive or - Wikipedia, the free encyclopedia
XOR sets bits in the resulting byte that are set in ONE of the input bytes, but not both.
For example:
Code:
XOR(8F h, 33 h)
8F h = 10001111 b
33 h = 00110011 b
=[XOR]===========
BC h = 10111100 b
The XOR operation has the nice property that it can be used for encryption,
because the operation can be reversed by XOR'ing with the key.
See here:
Code:
8F h = 10001111 b
33 h = 00110011 b
=[XOR]===========
BC h = 10111100 b <- Result of XOR(8F h, 33 h)
BC h = 10111100 b
33 h = 00110011 b
=[XOR]===========
8F h = 10001111 b <- Original value
But only if the key length is same as the message length it's secure.
If two values XOR'ed result in zero, they are the same.
Also on some CPUs XOR R, R (R = same register) is used to clear
a register, since its faster than loading a zero into it.