[ pycrypto-Bugs-1054714 ] wishlist: variable length CTR mode

"SourceForge.net" <[email protected]> Tue, 26 Oct 2004 10:24:24 -0700
Newsgroups gmane.comp.python.cryptography.cvs
Message-ID <[email protected]>
Bugs item #1054714, was opened at 2004-10-26 10:13
Message generated for change (Comment added) made by nobody
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=120937&aid=1054714&group_id=20937

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Zooko O'Whielacronx (zooko)
Assigned to: Nobody/Anonymous (nobody)
Summary: wishlist: variable length CTR mode

Initial Comment:
I'm using AES in CTR mode.  It objects if I give it a
plaintext whose length isn't an integer multiple of 16.
 So I'll have to check for that, pad, encrypt, then
truncate.

It would be nice if pycrypto would do this itself.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2004-10-26 10:24

Message:
Logged In: NO 

I'm almost certian this will never happen.  There are too
many variations on how to pad the block.  Also, truncating
the block will make it undecipherable.  If you want an easy
way to pad your string:

bs = 16
pad = '\x00'
s = 'something that is not of length 16'

s += (bs - (len(s) % bs)) * pad

Alternatively, you can use a stream cipher like RC4, which
doesn't have a block size.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=120937&aid=1054714&group_id=20937


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click