[pycrypto] Public Key encryption of files
Imran.Azad at bthft.nhs.uk
Fri Nov 11 07:54:34 CST 2011
Please note my new email address Imran.Azad at bthft.nhs.uk
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.
You may find this link useful: http://security.stackexchange.com/questions/8571/rsa-4096-with-aes-256-encryption-process-using-pycrypto
From: pycrypto-bounces at lists.dlitz.net [mailto:pycrypto-bounces at lists.dlitz.net] On Behalf Of John Matthew
Sent: 10 November 2011 18:32
To: PyCrypto discussion list
Subject: Re: [pycrypto] Public Key encryption of files
All good stuff, thanks Dave
On Thu, Nov 10, 2011 at 10:26 AM, Dave Pawson <dave.pawson at gmail.com<mailto:dave.pawson at gmail.com>> wrote:
On 10 November 2011 18:18, Dean Macinskas <dmacinskas at geobridge.net<mailto: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
Python makes it quite easy.
The reason I started to use it!
great piece of software.
XSLT XSL-FO FAQ.
pycrypto mailing list
pycrypto at lists.dlitz.net<mailto:pycrypto at lists.dlitz.net>
Web Content Manager
Bradford Teaching Hospitals NHS Foundation Trust
Tel: 01274 38 3556
Your Hospital needs YOU! 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 bradfordhospitals at capitaregistrars.com<mailto:bradfordhospitals at capitaregistrars.com> and ask to be registered as a new member. For more information about our hospitals and Foundation Trust Membership please visit www.bradfordhospitals.nhs.uk<http://www.bradfordhospitals.nhs.uk>
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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pycrypto