Created
December 11, 2015 14:48
-
-
Save budanthara/cfbddf9ed107915cc5f7 to your computer and use it in GitHub Desktop.
Wisely Bit
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
import string | |
cipher = "233 129 9 5 130 194 195 39 75 229" | |
def decode(): | |
flag = "" | |
strs = string.letters + "0123456789" + "{}_~*&^%$#@!()-" | |
to_list = ' '.join(strs).split(' ') | |
user_str = [] | |
for char in strs: | |
user_str.append( (((ord(char) << 5) | (ord(char) >> 3)) ^ 111) & 255 ) | |
#print user_str | |
str_user = ''.join(str(user_str).replace(" ","").replace("[","").replace("]","")).split(',') | |
to_dict = dict(zip(str_user, to_list)) | |
#print to_dict.keys() | |
#print cipher.split() | |
#print strs | |
for dec in cipher.split(): | |
flag += to_dict[dec] | |
print "Flag: ",''.join(flag) | |
if __name__ == '__main__': | |
decode() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment