Created
August 21, 2017 01:56
-
-
Save shubhamvashisht/09f258a7b44e3f90ddba8b2adddeff9f to your computer and use it in GitHub Desktop.
How to decode Google foo.bar 2017 encrypted key.
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
#Encrypting Google foo.bar 2017 encrypted message | |
#Algo-> Decode the message string to base64 bytes. | |
# and do XOR of decoded bytes with your Google username. | |
import base64 | |
#The encrypted key | |
message='' | |
#Your Google username | |
key='vashisht.s21295' | |
decrypted_message=[] | |
#decode the key to base64 bytes | |
dec_bytes=base64.b64decode(message) | |
#XOR with Username | |
for a,b in enumerate(dec_bytes): | |
decrypted_message.append(chr(b ^ ord(key[a%len(key)]))) | |
#The encypted message | |
print("".join(decrypted_message)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{'success' : 'great', 'colleague' : 'esteemed', 'efforts' : 'incredible', 'achievement' : 'unlocked', 'rabbits' : 'safe', 'foo' : 'win!'}