Yes, I agree 100%, this is something I&#39;m not taking lightly, that&#39;s why I&#39;m trying to get it right the first time :).<div><br></div><div>Ill checkout your link, thank you very much for your input.</div><div><br>
</div><div>J<br><br><div class="gmail_quote">On Fri, Nov 11, 2011 at 5:54 AM, Imran Azad <span dir="ltr">&lt;<a href="mailto:Imran.Azad@bthft.nhs.uk">Imran.Azad@bthft.nhs.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">





<div lang="EN-GB" link="blue" vlink="purple">
<b><font size="2" face="Verdana">Please note my new email address <a href="mailto:Imran.Azad@bthft.nhs.uk" target="_blank">Imran.Azad@bthft.nhs.uk</a></font></b><br>
<br>
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">John,</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">I don’t mean to steal your thunder, I noticed you asked a question about the suitability of public key cryptography for file encryption and the use of padding.
 Unless one is an expert in cryptography I don’t think it’s a good idea to encrypt sensitive data using your own scheme as cryptography is very easy to get wrong with catastrophic consequences, even ‘experts’ make mistakes. Rather it would be safer to use an
 established scheme, you also need to think about the integrity of what you are encrypting – although you may have taken this into account. I am not an expert in cryptography and I appreciate and admire the work that has gone into PyCrypto. I am speaking from
 past experiences and I thought I would share these with you.</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">You may find this link useful:
<a href="http://security.stackexchange.com/questions/8571/rsa-4096-with-aes-256-encryption-process-using-pycrypto" target="_blank">
http://security.stackexchange.com/questions/8571/rsa-4096-with-aes-256-encryption-process-using-pycrypto</a></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D">Kind Regards</span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"> </span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt">From:</span></b><span lang="EN-US" style="font-size:10.0pt"> <a href="mailto:pycrypto-bounces@lists.dlitz.net" target="_blank">pycrypto-bounces@lists.dlitz.net</a> [mailto:<a href="mailto:pycrypto-bounces@lists.dlitz.net" target="_blank">pycrypto-bounces@lists.dlitz.net</a>]
<b>On Behalf Of </b>John Matthew<br>
<b>Sent:</b> 10 November 2011 18:32</span></p><div class="im"><br>
<b>To:</b> PyCrypto discussion list<br>
<b>Subject:</b> Re: [pycrypto] Public Key encryption of files</div><p></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="margin-bottom:12.0pt">All good stuff, thanks Dave</p>
<div><div class="im">
<p class="MsoNormal">On Thu, Nov 10, 2011 at 10:26 AM, Dave Pawson &lt;<a href="mailto:dave.pawson@gmail.com" target="_blank">dave.pawson@gmail.com</a>&gt; wrote:</p>
</div><div><div></div><div class="h5"><div>
<p class="MsoNormal" style="margin-bottom:12.0pt">On 10 November 2011 18:18, Dean Macinskas &lt;<a href="mailto:dmacinskas@geobridge.net" target="_blank">dmacinskas@geobridge.net</a>&gt; wrote:<br>
&gt; All blocks need to be 16 bytes.  So for example, if the file is 2,000,005<br>
&gt; bytes, you&#39;d encrypt 125,000 16-byte blocks; you then have 5 bytes left<br>
&gt; over, to which you&#39;d add 11 padding bytes, which can be any binary value and<br>
&gt; then encrypt that last block.<br>
<br>
</p>
</div>
<p class="MsoNormal">def _lazysecret(secret, blocksize=32, padding=&#39;}&#39;):<br>
   &quot;&quot;&quot;pads secret if not legal AES block size (16, 24, 32)&quot;&quot;&quot;<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>
<span style="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></span></p>
<div>
<div>
<p class="MsoNormal">_______________________________________________<br>
pycrypto mailing list<br>
<a href="mailto:pycrypto@lists.dlitz.net" target="_blank">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></p>
</div>
</div>
</div></div></div>
<p class="MsoNormal"> </p>
</div>
</div>
<font size="2" face="Verdana">
<p>Imran Azad<br>
Web Content Manager<br>
Bradford Teaching Hospitals NHS Foundation Trust<br>
<br>
Tel: 01274 38 3556<br>
Mob: 07535660951<br>
Internet: <a href="http://www.bradfordhospitals.nhs.uk" target="_blank">http://www.bradfordhospitals.nhs.uk</a><br>
</p>
</font><font size="1" face="Verdana" color="gray">
<p><b>Your Hospital needs YOU!</b> We need you to register as a Public, Patient or Staff member and help shape the future of your healthcare. Call 0800 280 2581 to register by phone or you can email
<a href="mailto:bradfordhospitals@capitaregistrars.com" target="_blank">bradfordhospitals@capitaregistrars.com</a> and ask to be registered as a new member. For more information about our hospitals and Foundation Trust Membership please visit
<a href="http://www.bradfordhospitals.nhs.uk" target="_blank">www.bradfordhospitals.nhs.uk</a> <br>
This message is confidential. It may also contain privileged information. The contents of this e-mail and any attachments are intended for the named addressee only. Unless you are the named addressee or authorised to receive the e-mail of the named addressee
 you may not disclose, use or copy the contents of the e-mail. If you are not the person for whom the message was intended, please notify the sender immediately at Bradford Teaching Hospitals NHS Foundation Trust and delete the material from your computer.
 You must not use the message for any other purpose, nor disclose its contents to any person other than the intended recipient. Bradford Teaching Hospitals NHS Foundation Trust does not accept responsibility for this message and any views or opinions contained
 in this e-mail are solely those of the author unless expressly stated otherwise.
</p>
</font>
</div>

<br>_______________________________________________<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>
<br></blockquote></div><br></div>