Pycrypto

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Fri Jun 16 12:43:57 EDT 2006


In <1150470895.257327.302460 at h76g2000cwa.googlegroups.com>, luca72 wrote:

> Hello again i have solve doing this:
> 
> from Crypto.Cipher import AES
> stri=(chr(int('9b',16))+chr(int('d3',16))+chr(int('2d',16))+chr(int('24',16))+chr(int('af',16))+chr(int('c9',16))+chr(int('e9',16))+chr(int('d7',16))+chr(int('46',16))+chr(int('69',16))+chr(int('71',16))+chr(int('32',16))+chr(int('45',16))+chr(int('5f',16))+chr(int('27',16))+chr(int('0b',16)))
> luca = str(stri)
> crypt = AES.new(luca, AES.MODE_ECB)
> testo=(chr(int('ea',16))+chr(int('52',16))+chr(int('3a',16))+chr(int('66',16))+chr(int('4d',16))+chr(int('ab',16))+chr(int('aa',16))+chr(int('44',16))+chr(int('76',16))+chr(int('d3',16))+chr(int('12',16))+chr(int('26',16))+chr(int('a1',16))+chr(int('e3',16))+chr(int('ba',16))+chr(int('b0',16)))
> testo = str(testo)
> c = crypt.encrypt(testo)
> 
> I don't know if this is the best way , but anyway it work

In [26]:import binascii

In [27]:binascii.unhexlify('ea523a664dabaa4476d31226a1e3bab0')
Out[27]:'\xeaR:fM\xab\xaaDv\xd3\x12&\xa1\xe3\xba\xb0'

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list