[pycrypto] Public Key encryption of files
John Matthew
john at compunique.com
Thu Nov 10 12:32:01 CST 2011
All good stuff, thanks Dave
On Thu, Nov 10, 2011 at 10:26 AM, Dave Pawson <dave.pawson at gmail.com> wrote:
> On 10 November 2011 18:18, Dean Macinskas <dmacinskas at geobridge.net>
> wrote:
> > All blocks need to be 16 bytes. So for example, if the file is 2,000,005
> > bytes, you'd encrypt 125,000 16-byte blocks; you then have 5 bytes left
> > over, to which you'd add 11 padding bytes, which can be any binary value
> and
> > then encrypt that last block.
>
>
> def _lazysecret(secret, blocksize=32, padding='}'):
> """pads secret if not legal AES block size (16, 24, 32)"""
> if not len(secret) in (16, 24, 32):
> return secret + (blocksize - len(secret)) * padding
> return secret
>
> Python makes it quite easy.
> The reason I started to use it!
> Thanks to
> src http://www.turnkeylinux.org/blog/python-symmetric-encryption
>
> great piece of software.
>
> regards
>
>
>
> --
> Dave Pawson
> XSLT XSL-FO FAQ.
> Docbook FAQ.
> http://www.dpawson.co.uk
> _______________________________________________
> pycrypto mailing list
> pycrypto at lists.dlitz.net
> http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.dlitz.net/pipermail/pycrypto/attachments/20111110/56d31537/attachment.htm
More information about the pycrypto
mailing list