Update otp.py

This commit is contained in:
Chad Sawyer
2020-01-10 01:31:39 +00:00
parent 62ba0e72a4
commit daccdeefeb
+4 -4
View File
@@ -1,5 +1,5 @@
# OTP Decoder by Chainsaw # OTP Decoder by Chainsaw
# Decodes encryted message using a key file (text format) # Decodes encrypted message using a key file (text format)
# Ver 1.2 2020-0109 # Ver 1.2 2020-0109
import re import re
@@ -24,7 +24,7 @@ key = ""
# The Code for Letters to numbers. Conversion Table #1 EN # The Code for Letters to numbers. Conversion Table #1 EN
CT = { '0':"CODE", '1': 'A', '2': 'E', '3': 'I', '4': 'N', '5': 'O', '6': 'T', '70': 'B', '71': 'C', '72': 'D', '73': 'F', '74': 'G', '75': 'H', '76': 'J', '77': 'K', '78': 'L', '79': 'M', '80': 'P', '81': 'Q', '82': 'R', '83': 'S', '84': 'U', '85': 'V', '86': 'W', '87': 'X', '88': 'Y', '89': 'Z', '90': '#', '91': '.', '92': ':', '93': "'", '94': '( )', '95': '+', '96': '-', '97': '=', '98': '?', '99': ' ' } CT = { '0':"CODE", '1': 'A', '2': 'E', '3': 'I', '4': 'N', '5': 'O', '6': 'T', '70': 'B', '71': 'C', '72': 'D', '73': 'F', '74': 'G', '75': 'H', '76': 'J', '77': 'K', '78': 'L', '79': 'M', '80': 'P', '81': 'Q', '82': 'R', '83': 'S', '84': 'U', '85': 'V', '86': 'W', '87': 'X', '88': 'Y', '89': 'Z', '90': '#', '91': '.', '92': ':', '93': "'", '94': '( )', '95': '+', '96': '-', '97': '=', '98': '?', '99': ' ' }
# read encyptred text from prompt # read encrypted text from prompt
# #
# Test message with Larch key # Test message with Larch key
# "46364 98742 62198 41677 85307 05675 25815 63727 90885 52687 73582 02586 98592 " # "46364 98742 62198 41677 85307 05675 25815 63727 90885 52687 73582 02586 98592 "
@@ -63,9 +63,9 @@ key = fullkey[key_start:]
#print key #print key
# add encrpted text and key to create decrypted digits # add encrypted text and key to create decrypted digits
count = len(etxt) count = len(etxt)
print "Encypted text is ", count , " characters long." print "Encrypted text is ", count , " characters long."
for i in range(0, count ): for i in range(0, count ):
#print i, " ", etxt[i], " + ", key[i], " = ", #print i, " ", etxt[i], " + ", key[i], " = ",