Skip to content

Instantly share code, notes, and snippets.

@jacquerie
Last active October 28, 2023 16:09
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jacquerie/cfb8a56636e2b9e12f51 to your computer and use it in GitHub Desktop.
Save jacquerie/cfb8a56636e2b9e12f51 to your computer and use it in GitHub Desktop.
How to decode the message at the end of Google Foobar
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
MESSAGE = '''
EUYQGhMMSx0cU0FIU1MCFAQPG01NQ0gTAEICChUGBxZTRVxBSQoZFQYKHQpKSUNURhcVEgoUFR1I
SltDSBkBTRwKEAgQHxFCSkFJDgkJCgoGCkMLAQBGUklUQhMPAgAJCgYLV0MOSR0VAxAaABZBQVRP
TRICCRVIAk5IEg4dVFRfRkYZBgRARBI=
'''
KEY = 'jacopo.notarstefano'
result = []
for i, c in enumerate(base64.b64decode(MESSAGE)):
result.append(chr(ord(c) ^ ord(KEY[i % len(KEY)])))
print ''.join(result)
@HitanshuGedam
Copy link

I got a dictionary after decoding the encrypted text.
It is this -> b"{'success' : 'great', 'colleague' : 'esteemed', 'efforts' : 'incredible', 'achievement' : 'unlocked', 'rabbits' : 'safe', 'foo' : 'win!'}"
what does this mean??

@azmatsiddique
Copy link

azmatsiddique commented Jul 9, 2020

####python2 code

import base64

MESSAGE = '''
EUYQGhMMSx0cU0FIU1MCFAQPG01NQ0gTAEICChUGBxZTRVxBSQoZFQYKHQpKSUNURhcVEgoUFR1I
SltDSBkBTRwKEAgQHxFCSkFJDgkJCgoGCkMLAQBGUklUQhMPAgAJCgYLV0MOSR0VAxAaABZBQVRP
TRICCRVIAk5IEg4dVFRfRkYZBgRARBI=
'''

KEY = 'jacopo.notarstefano'

result = []
for i, c in enumerate(base64.b64decode(MESSAGE)):
result.append(chr(ord(c) ^ ord(KEY[i % len(KEY)])))

print ''.join(result)

i also got same dictionary:
{'success' : 'great', 'colleague' : 'esteemed', 'efforts' : 'incredible', 'achievement' : 'unlocked', 'rabbits' : 'safe', 'foo' : 'win!'}

@jaltmayerpizzorno
Copy link

It's just a final challenge...

@shash-1511
Copy link

I also got this-

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

@AwokeKnowing
Copy link

I also got same. in 2016

@SakshamWebTeasor
Copy link

where can i find the key?

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