Last active
December 20, 2015 14:39
-
-
Save ddellspe/6147953 to your computer and use it in GitHub Desktop.
Python code for anomaly decoding Fixed to align with proper rules (and expanded)
This file contains hidden or 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
| import os | |
| import sys | |
| import datetime | |
| import md5 | |
| def otpdecrypt(string, key): | |
| if len(string) != len(key): | |
| print "invalid" | |
| return "invalid" | |
| message = "" | |
| for i in range(len(string)): | |
| message+=(value_letters[(letter_values[string[i]] - letter_values[key[i]])%26]) | |
| # print message | |
| return message | |
| def numberToWord(number): | |
| low_numbers = ["ZERO","ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE","TEN","ELEVEN","TWELVE","THIRTEEN","FOURTEEN","FIFTEEN","SIXTEEN","SEVENTEEN","EIGHTEEN","NINETEEN","TWENTY"] | |
| tens = ["TWENTY", "THIRTY","FORTY","FIFTY","SIXTY","SEVENTY","EIGHTY","NINETY"] | |
| ones = ["ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE"] | |
| if number <= 20: | |
| return low_numbers[number] | |
| else: | |
| string = "" | |
| string += tens[(number/10)-2] | |
| if not number % 10 == 0: | |
| string += " "+ones[(number % 10) - 1] | |
| return string | |
| letter_values = {} | |
| value_letters = {} | |
| for letter in range(65,91): | |
| # print chr(letter) | |
| letter_values[chr(letter)] = letter - 65 | |
| value_letters[letter-65] = chr(letter) | |
| # print letter_values, value_letters | |
| actualmd5 = "e31492102271d3d2dfb46e12bb3643f0" | |
| timestring = "SLQAYZCAOPRIOHRWYZHRDHLRBLQRGIVTGOEIBVSSIYCTPDOTB" | |
| hour = numberToWord(2) | |
| start = hour + "XO CLOCK " | |
| string = start | |
| for min in range(6): | |
| string1 = start + numberToWord(min) + " MINUTE" | |
| if not min == 1: | |
| string1 += "S AND " | |
| else: | |
| string1 += " AND " | |
| for seconds in range(60): | |
| string2 = string1 + numberToWord(seconds) + " SECOND" | |
| if not seconds == 1: | |
| string2 += "S" | |
| # print len(string2), string2 | |
| if len(string2) == len(timestring): | |
| message = otpdecrypt(timestring,string2.replace(" ","X")) | |
| messagemd5 = md5.new(message).hexdigest() | |
| if messagemd5 == actualmd5: | |
| print "-----------------------------------------------------------------------------" | |
| print messagemd5, string2.replace("X"," ") | |
| # print md5.new(string2.replace(" ","X")).hexdigest(), string2.replace(" ","X") | |
| elif len(string2) < len(timestring): | |
| string2 = string2.replace(" "," ",len(timestring) - len(string2) - 1) | |
| while len(string2) < len(timestring): | |
| string2 = "X" + string2 | |
| message = otpdecrypt(timestring,string2.replace(" ","X")) | |
| messagemd5 = md5.new(message).hexdigest() | |
| if messagemd5 == actualmd5: | |
| print "-----------------------------------------------------------------------------" | |
| print messagemd5, string2.replace("X"," ") | |
| # print md5.new(string2.replace(" ","X")).hexdigest(), string2.replace(" ","X") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment