All good stuff, thanks Dave<br><br><div class="gmail_quote">On Thu, Nov 10, 2011 at 10:26 AM, Dave Pawson <span dir="ltr"><<a href="mailto:dave.pawson@gmail.com">dave.pawson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 10 November 2011 18:18, Dean Macinskas <<a href="mailto:dmacinskas@geobridge.net">dmacinskas@geobridge.net</a>> wrote:<br>
> All blocks need to be 16 bytes. So for example, if the file is 2,000,005<br>
> bytes, you'd encrypt 125,000 16-byte blocks; you then have 5 bytes left<br>
> over, to which you'd add 11 padding bytes, which can be any binary value and<br>
> then encrypt that last block.<br>
<br>
<br>
</div>def _lazysecret(secret, blocksize=32, padding='}'):<br>
"""pads secret if not legal AES block size (16, 24, 32)"""<br>
if not len(secret) in (16, 24, 32):<br>
return secret + (blocksize - len(secret)) * padding<br>
return secret<br>
<br>
Python makes it quite easy.<br>
The reason I started to use it!<br>
Thanks to<br>
src <a href="http://www.turnkeylinux.org/blog/python-symmetric-encryption" target="_blank">http://www.turnkeylinux.org/blog/python-symmetric-encryption</a><br>
<br>
great piece of software.<br>
<br>
regards<br>
<font color="#888888"><br>
<br>
<br>
--<br>
Dave Pawson<br>
XSLT XSL-FO FAQ.<br>
Docbook FAQ.<br>
<a href="http://www.dpawson.co.uk" target="_blank">http://www.dpawson.co.uk</a><br>
</font><div><div></div><div class="h5">_______________________________________________<br>
pycrypto mailing list<br>
<a href="mailto:pycrypto@lists.dlitz.net">pycrypto@lists.dlitz.net</a><br>
<a href="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto" target="_blank">http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto</a><br>
</div></div></blockquote></div><br>