Update Picocrypt.py

This commit is contained in:
Evan Su 2021-04-06 18:17:23 -04:00 committed by GitHub
parent 03069056e4
commit 1374d1b1dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 5 deletions

View File

@ -81,7 +81,8 @@ strings = [
"Unknown error occured. Please try again.", "Unknown error occured. Please try again.",
"Drag and drop file(s) and folder(s) into this window.", "Drag and drop file(s) and folder(s) into this window.",
"File metadata (read-only):", "File metadata (read-only):",
"Error. The input file couldn't be decoded as UTF-8." "Error. The input file couldn't be decoded as UTF-8.",
"Error. The input file is corrupted so badly that Picocrypt can't decrypt it."
] ]
# Create root window # Create root window
@ -871,10 +872,15 @@ def work():
# If decrypting, read values from file # If decrypting, read values from file
else: else:
tmp = fin.read(129) tmp = fin.read(129)
if bytes(rs128.decode(tmp)[0])==b"+": try:
reedsolo = True if bytes(rs128.decode(tmp)[0])==b"+":
else: reedsolo = True
reedsolo = False else:
reedsolo = False
except:
setDecryptionUI()
statusString.set(strings[21])
return
metadataLength = fin.read(138) metadataLength = fin.read(138)
metadataLength = bytes(rs128.decode(metadataLength)[0]) metadataLength = bytes(rs128.decode(metadataLength)[0])