-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblowfish.py
More file actions
executable file
·38 lines (24 loc) · 780 Bytes
/
Copy pathblowfish.py
File metadata and controls
executable file
·38 lines (24 loc) · 780 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
38
#!/usr/bin/python3
import argparse
import Cryptodome.Cipher.Blowfish as Blowfish
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(16)
nonce = Random.get_random_bytes(16)
def run_Blowfish(num):
for i in list(range(num)):
cipher = Blowfish.new(key, Blowfish.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_Blowfish(num)
return
if __name__ == "__main__":
main()