0

I want to do an encryption and a decryption scripts with Pycripto using public/private keys. I know asymmetric encryption is super expensive in use of resources, but I intend to encrypt and decrypt a text file with some passwords (let's say 200-300 characters in total). I've done some research but I could only find how to encrypt and decrypt little short strings.

In case that's not possible/convenient, would you recommend using mixed encryption? I mean using asymmetric to "securely transfer the pass phrase " and the decrypting the rest with symmetric.

I intend to have the encrypted file in the cloud, so I can download it everywhere I am. To decrypt, I'll have a USB flash drive I take everywhere I go. In the USB I should have my private key, and the decryption script. I plan to decrypt "inside the USB" so the decrypted file is never stored in any computer.

Is that possible?

Thanks!

Ckubrak
  • 7
  • 2
  • What is the rational for using asymmetric encryption, do you need separate encryption and decryption keys? If not use AES. Next, RSA can not encrypt a message longer than the key so 300-bytes would require a 2400-bit key not including padding. – zaph May 16 '16 at 22:33
  • @zaph I'll start reading about AES and see if it fits my needs. Just out of curiosity, what do you mean by "padding" – Ckubrak May 16 '16 at 22:56
  • 1
    1. AES is just as secure as RSA. 2. WRT RSA padding see: [Why is padding used for RSA encryption](http://crypto.stackexchange.com/a/3609/4747). 3. WRT AES encryption padding: it is a block cipher so the input must be a multiple of the block size for common modes such as CBC. 4. If you do not have a compelling reason to use asymmetric encryption don't. Compelling reasons as PKI and/or needing separate encryption and decryption keys. – zaph May 16 '16 at 23:11

0 Answers0