Search code examples
pythonencryptionpycrypto

Python encrypt/decrypt txt with a given password


I have a custom account manager. At the moment I store the whole information in a single txt document. I'm trying to figure out how to encrypt all the whole txt with a password introduced by user.

I've seen PyCrypto but I have so many problems because there must be everything 16-bytes multiple.

Can someone tell me how to do that?

Thanks.


Solution

  • I used this as solution:

    from simplecrypt import encrypt, decrypt
    ciphertext = encrypt('password', plaintext)
    plaintext = decrypt('password', ciphertext)