Skip to content

Instantly share code, notes, and snippets.

@shubhamvashisht
Created August 21, 2017 01:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shubhamvashisht/09f258a7b44e3f90ddba8b2adddeff9f to your computer and use it in GitHub Desktop.
Save shubhamvashisht/09f258a7b44e3f90ddba8b2adddeff9f to your computer and use it in GitHub Desktop.
How to decode Google foo.bar 2017 encrypted key.
#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))
@istiyakamin
Copy link

{'success' : 'great', 'colleague' : 'esteemed', 'efforts' : 'incredible', 'achievement' : 'unlocked', 'rabbits' : 'safe', 'foo' : 'win!'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment