Python Forum
Problem with using Crypto library
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with using Crypto library
Hello my execute error are
“Traceback (most recent call last): File "", line 151, in <module> File "", line 113, in menu File "", line 64, in start_encryption File "", line 20, in encrypt File "site-packages/Crypto/Cipher/", line 244, in encrypt ValueError: Input strings must be a multiple of 16 in length”
It happen when i exec command (only with several files)
encrypted = AES_obj.encrypt(file_content)
I know that it file_content length problem, but how solve this problem if i dont want to mess with file structure (now i'll encrypt it and next time i need to decrypt it to orginal state)

Some more code
def start_encryption(files):
    AES_and_base64_path = []
    for found_file in files:
        key = generate_keys.generate_key(128, True)
        AES_obj = symmetric.AESCipher(key)

        found_file = base64.b64decode(found_file)
            with open(found_file, 'rb') as f:
                file_content =

#       print(file_content)
        encrypted = AES_obj.encrypt(file_content)
#       print(encrypted)

Best regards
hello, any one can delete this topic? I dont see option to delete by myself :)
We don't delete threads.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem installing library thunderspeed 2 555 Mar-22-2020, 11:04 PM
Last Post: thunderspeed
  Python crypto byte plaintext to hexint Mangaz90 2 691 Feb-21-2020, 07:42 PM
Last Post: Mangaz90
  Problem importing resource library ChrisM 8 826 Oct-23-2019, 01:40 PM
Last Post: ChrisM
  Create file archive that contains crypto hash ED209 1 518 May-29-2019, 03:05 AM
Last Post: heiner55
  crypto import issue saisankalpj 2 3,806 Dec-20-2018, 06:08 AM
Last Post: saisankalpj
  AES encryption - does not match between arduino and python 3 crypto guillaume55 0 1,932 Sep-23-2018, 11:14 AM
Last Post: guillaume55
  Problem Using Python Library abir99 8 2,329 Nov-21-2017, 03:12 PM
Last Post: sparkz_alot
  PyInstaller, how to create library folder instead of file ? harun2525 2 2,434 May-06-2017, 11:29 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020