-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.py
More file actions
72 lines (50 loc) · 1.72 KB
/
Copy pathdemo.py
File metadata and controls
72 lines (50 loc) · 1.72 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright 2016 Eduardo Frazão ( https://github.com/fr4z40 )
#
# Licensed under the MIT License;
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/licenses/MIT
#
from AES_File_Encryption import AES_File_Encryption
from Twofish_File_Encryption import Twofish_File_Encryption
try:
import readline
except:
pass
opt = ((input('''
[1]AES-256\t[2]Twofish\t[3]Twofish+AES256 -[ ]\b\b''')).strip())
try:
from getpass import getpass
key = (getpass("Password:")).strip('\n').strip('\r')
except:
key = (input("Password:")).strip('\n').strip('\r')
file_in = (input('Input Path/Name (type or drag):')).strip()
file_in = file_in.strip('"').strip("'")
file_out = (input('[optional, hit enter to skip] Output Path/Name (type or drag):')).strip()
file_out = file_out.strip('"').strip("'")
if len(file_out) < 2:
file_out = None
action = {'1':'encrypt', '2':'decrypt'}[(input('[1]-Encrypt\t[2]-Decrypt -[ ]\b\b')).strip()]
if opt == '1':
AES_File_Encryption(action, key, file_in, file_out)
elif opt == '2':
Twofish_File_Encryption(action, key, file_in, file_out)
elif opt == '3':
if action == 'encrypt':
log = Twofish_File_Encryption(action, key, file_in, file_out).DATA
file_in = log['output']
if not file_out:
file_out = file_in
AES_File_Encryption(action, key, file_in, file_out,)
else:
log = AES_File_Encryption(action, key, file_in, file_out,).DATA
file_in = log['output']
if not file_out:
file_out = file_in
Twofish_File_Encryption(action, key, file_in, file_out)
else:
quit()