-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdes.py
More file actions
executable file
·37 lines (23 loc) · 738 Bytes
/
Copy pathdes.py
File metadata and controls
executable file
·37 lines (23 loc) · 738 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
30
31
32
33
34
35
36
37
#!/usr/bin/python3
import argparse
import Cryptodome.Cipher.DES as DES
import Cryptodome.Random as Random
#data = b'This is the first message that I have encrypted using PyCryptodome!!'
data = Random.get_random_bytes(16777216)
key = Random.get_random_bytes(8)
nonce = Random.get_random_bytes(16)
def run_DES(num):
for i in list(range(num)):
cipher = DES.new(key, DES.MODE_EAX, nonce)
ciphertext = cipher.encrypt(data)
return
def main():
num = 1
parser = argparse.ArgumentParser()
parser.add_argument("--num", "-n", help="set number of reps for encryption")
args = parser.parse_args()
if args.num:
num = int(args.num)
run_DES(num)
if __name__ == "__main__":
main()