cryptAES/main.py
2021-09-27 15:57:02 +02:00

19 lines
402 B
Python

from Crypto.Random import get_random_bytes
import os
from Backup import Backup
if not os.path.exists("key"):
key = get_random_bytes(32) # 32 bytes * 8 = 256 bits (1 byte = 8 bits)
open("key", 'wb').write(key)
print("Saved")
else:
key = open("key", 'rb').read()
print("Recovered")
print(key)
bck = Backup(key)
bck.save_location = "C:\\temp"
rootdir = "test"
bck.recurse(rootdir)