[pycrypto] AES, MODE_CTR
dave.pawson at gmail.com
Thu Dec 5 23:24:42 PST 2013
On 5 December 2013 19:41, Legrandin <helderijs at gmail.com> wrote:
>>Thanks Richard. Now working
>> def test_AES5(self):
>> pt=b' '*10
>> iv = Random.new().read(AES.block_size)
>> cipher = AES.new(b' '*16, AES.MODE_CTR, IV=iv, counter=ctr)
>> ct = cipher.encrypt(pt)
>> decipher = AES.new(b' '*16, AES.MODE_CTR, IV=iv, counter=ctrr)
>> ptr = decipher.decrypt(ct)
>> iv added as suggested.
> Actually, the IV parameter is ignored in Counter mode.
> If you want to add a nonce to the counter block you must pass it to
> the Counter class:
> nonce = Random.new().read(8)
> ctr = Counter.new(64, nonce)
> cipher = AES.new(b' '*16, AES.MODE_CTR, counter=ctr)
> The counter block is then made up by 64 bits of nonce and 64 bits of counter.
Another undocumented feature?
> PS: I think I get 1 out of 3 messages out of this mailing list.
Your email system or the server?
It seems that the repo owner and the mailing list are both
XSLT XSL-FO FAQ.
More information about the pycrypto