- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEncDec.py
More file actions
Latest commit
29 lines (17 loc) · 560 Bytes
/
Copy pathEncDec.py
File metadata and controls
29 lines (17 loc) · 560 Bytes
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
27
28
29
fromCrypto.CipherimportAES
fromCrypto.Randomimportget_random_bytes
data='here is some data'
key=get_random_bytes(32)
data=bytes(data, 'utf8')
#instantiate cipher object
cipher=AES.new(key, AES.MODE_EAX)
cipher.update(data)
encryptData=cipher.encrypt(data)
print('This is the encrypted data')
print(encryptData)
#this should initialize update?
#next = cipher.update(encryptData)
#cipher.update(encryptData)
#decryptData = cipher.decrypt(encryptData)
print('This is the decrypted data')
#print(decryptData)