Need some help confirming transactions using sha256

Christian Heimes christian at python.org
Fri Feb 1 09:34:35 EST 2013


Am 31.01.2013 18:55, schrieb Peter Pearson:
>>>> txid = 'r7A7clvs9waizF+6QEiI0tgAq1ar48JItK3kg9kaeAFXz2vsMsHmOd9r9fhkmtxTz3CQnGAPMaDeKLvgb1A2VA'
>>>> secret = '10812806653842663997bf5971637f86f26c71a4716276d7fa8f323a83588d91:1'
>>>> hashlib.sha256(txid+":"+secret).hexdigest()
> 'dfa8769be81a543002865c88a5b52fa07f3b67fc7cd9b519c3f6a6452bcd48e4'
>>>> 0x48e4
> 18660
>>>>
> 
> .. . . which is the number you wanted, right?

Kryptox, you have chosen the correct algorithm to calculate a MAC. Very
good!

But the designers of the game are using an improper algorithm.
Apparently they don't know much about cryptography, especially length
extension attacks ...

Christian




More information about the Python-list mailing list