Skip to content

Commit b5075bc

Browse files
authored
Update crypto.py
1 parent fec2b2f commit b5075bc

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

crypto.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
print(red+"""
1717
1818
\t
19-
\t |
20-
\t |
21-
\t -----+------ -----------
22-
\t |
23-
\t |
19+
\t +
20+
\t +
21+
\t + + + + + + + + + +
22+
\t +
23+
\t +
2424
\t ) (
2525
\t \ \ / /
2626
\t \ |\ / |/
@@ -88,7 +88,7 @@ def decrypt(key, filename):
8888

8989

9090
def check(key, filename):
91-
chunksize = 64 * 1024
91+
chunksize = 64# * 1024
9292
secret = "0000hack1lab0000"
9393

9494
with open(filename, 'rb') as infile:
@@ -97,9 +97,8 @@ def check(key, filename):
9797

9898
chunk = infile.read(chunksize)
9999
test = decryptor.decrypt(chunk)
100-
if secret not in test:
101-
print(red+bold+"[!] Wrong Password!"+end)
102-
exit(1)
100+
if test[16:32] != secret:
101+
exit(red+bold+"[!] Wrong Password!"+end)
103102

104103

105104

@@ -114,12 +113,14 @@ def main():
114113
parser.add_argument("-d", "--dcrypt", help="File Decryption", type=str)
115114
parser.add_argument("-p", "--password", help="Password To Encrypt/Decrypt a File", type=str)
116115
parser.add_argument("-x", "--delete", help="Delete The Original File", action='store_true')
116+
parser.add_argument("-i", "--ignore", help="Ignore The Check For The Password.", action='store_true')
117117
args = parser.parse_args()
118118

119119
enc = str(args.crypt)
120120
dec = str(args.dcrypt)
121121
password = str(args.password)
122122
dd = str(args.delete)
123+
ig = str(args.ignore)
123124

124125
if enc == "None" and dec == "None":
125126
parser.print_help()
@@ -139,7 +140,8 @@ def main():
139140

140141
elif dec != "None":
141142
print(blue+"[+] Decrypt: "+end+"[ "+dec+" ]")
142-
check(getkey(password), dec)
143+
if ig != 'True':
144+
check(getkey(password), dec)
143145
decrypt(getkey(password), dec)
144146
name = dec.split(".hacklab")[0]
145147
print(blue+"[+] Output: "+end+"[ "+name+" ]")

0 commit comments

Comments
 (0)