File size: 567 Bytes
20c3228 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
'''
This script is used to decrypt the encrypted data files.
'''
from cryptography.fernet import Fernet
# Open the key
with open('filekey.key', 'rb') as filekey:
key = filekey.read()
fernet = Fernet(key)
splits = ['train', 'dev', 'test']
for split in splits:
# Open the encrypted file
with open(f'encrypted_{split}.json', 'rb') as file:
encrypted = file.read()
# Decrypting the file
decrypted = fernet.decrypt(encrypted)
# Write the decrypted file
with open(f'decrypted_{split}.json', 'wb') as f:
f.write(decrypted)
|