我尝试使用simplecrypt
simplecrypt 加密和解密视频,并且完美地工作,但问题是在程序解密后视频Myvideo.mp4.enc
至example-decrypt.mp4
example-decrypt.mp4
无法使用"已损坏的文件"
我的代码:
from simplecrypt import encrypt, decrypt
def encrypt_file(file_name, key):
with open(file_name, 'rb') as fo:
plaintext = fo.read()
enc = encrypt(key, plaintext)
with open(file_name + ".enc", 'wb') as fo:
fo.write(enc)
def decrypt_file(file_name, dec_file, key):
with open(file_name, 'rb') as fo:
ciphertext = fo.read()
dec = decrypt(key, ciphertext)
with open(dec_file, 'wb') as fo:
fo.write(dec)
encrypt_file('Myvideo.mp4', 'xfxw3wxq233')
decrypt_file('Myvideo.mp4.enc', 'example-decrypt.mp4', 'xfxw3wxq233')
我如何解决这个问题。