0

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.

Lechucico
  • 1,914
  • 7
  • 27
  • 60
  • Did you check http://stackoverflow.com/questions/2490334/simple-way-to-encode-a-string-according-to-a-password – Murtuza Z Mar 02 '17 at 13:33
  • I just have a big problem. I don't know how to convert the whole file in a 16-byte multiple string. – Lechucico Mar 02 '17 at 13:54
  • Look into bcrypt at http://bcrypt.sourceforge.net/ it is a command line program that you can execute via os.system() and it will ask the user to type in the password both when encrypting and decrypting. – Marichyasana Mar 02 '17 at 14:00
  • @Marichyasana I'll take a look at this. There is any remove script in case it doesn't suit my necessities? – Lechucico Mar 02 '17 at 15:16
  • Crypto is not an area for amateurs. Amateurs will make mistakes, and will lay themselves open to being sued when their security is broken. Get a professional to do the job. Yes, this means employing an expert. – rossum Mar 02 '17 at 16:31
  • @rossum I've finally found a solution with simplecrypt – Lechucico Mar 02 '17 at 17:10
  • @Lechucico It is a stand alone program, nothing to install/de-install. – Marichyasana Mar 03 '17 at 09:27

1 Answers1

0

I used this as solution:

from simplecrypt import encrypt, decrypt
ciphertext = encrypt('password', plaintext)
plaintext = decrypt('password', ciphertext)
Lechucico
  • 1,914
  • 7
  • 27
  • 60