Hello my execute error are
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
Best regards
~Reks
Error:“Traceback (most recent call last):
File "main.py", line 151, in <module>
File "main.py", line 113, in menu
File "main.py", line 64, in start_encryption
File "symmetric.py", line 20, in encrypt
File "site-packages/Crypto/Cipher/blockalgo.py", 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)1 |
encrypted = AES_obj.encrypt(file_content) |
Some more code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
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) print (found_file) try : with open (found_file, 'rb' ) as f: file_content = f.read() except : continue # print(file_content) encrypted = AES_obj.encrypt(file_content) # print(encrypted) utils.shred(found_file) |
~Reks