This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=========================================================== | |
OPTION01 —MORSE | |
=========================================================== | |
NL?N?R??VV?RLP?VL??ZS??ST????A??M?T?I?SWA?K?????KKBLK?BKH??K | |
=========================================================== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#try morse | |
print("\n===========================================================") | |
print("OPTION01 —MORSE") | |
print("===========================================================\n") | |
for section in message: | |
#take 3 letters at a time and convert to morse | |
# then join 3 morse letters together to create braille letter | |
brailleletter = (morse[section[0]]+morse[section[1]]+morse[section[2]]) | |
#lookup braille letter | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=========================================================== | |
OPTION01 —MORSE | |
=========================================================== | |
NLTraceback (most recent call last): | |
File "cracker.py", line 77, in <module> | |
print((list(braille.keys())[list(braille.values()).index(brailleletter)]),end="") | |
ValueError: '111001' is not in list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#store coded message as 3-letter sets in a list | |
message = ( | |
'INA', 'AAA', 'IAN', 'INA', 'AAN', 'AIA', 'IAI', 'AIN', | |
'AAI', 'AAI', 'AII', 'AIA', 'AAA', 'IAA', 'INN', 'AAI', | |
'AAA', 'NNI', 'AIN', 'ANI', 'NAA', 'NNN', 'NMA', 'NAA', | |
'NIA', 'NMN', 'NNA', 'NNA', 'NNN', 'AMM', 'NNN', 'NAN', | |
'IMA', 'AIN', 'NIA', 'AMN', 'NAM', 'IAN', 'NAA', 'NIN', | |
'AMM', 'MIA', 'AMA', 'MMI', 'MAA', 'MMA', 'MMA', 'MAA', | |
'AMA', 'AMA', 'AAM', 'AAA', 'AMA', 'MAA', 'AAM', 'AMA', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print((list(braille.keys())[list(braille.values()).index(brailleletter)]),end="") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brailleletter = (morse[section[0]]+morse[section[1]]+morse[section[2]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for section in message: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#the first three letters of the coded message: | |
INA | |
#translate into Morse as: | |
11, 01, 10 | |
#Which, if we stack them, top to bottom in a 'domino': | |
11 | |
01 | |
10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#braille alphabet | |
braille = { | |
'A':'100000', | |
'B':'101000', | |
'C':'110000', | |
'D':'110100', | |
'E':'100100', | |
'F':'111000', | |
'G':'111100', | |
'H':'101100', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#morse code | |
morse = { | |
'A':'10', | |
'I':'11', | |
'M':'00', | |
'N':'01', | |
} |