Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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)
@psp65

This comment has been minimized.

Copy link

@psp65 psp65 commented Aug 6, 2018

Line #16:
result.append(chr(c ^ ord(KEY[i % len(KEY)])))

(ord(c)) is creating error.

@maguttag

This comment has been minimized.

Copy link

@maguttag maguttag commented Aug 24, 2018

#You probably have python 3

import base64

MESSAGE = '''
FkAGARcCAh4UUlROQUAKFRAVAEZLTUAWGxgNAgwAABFTQV1NQBAHAAQCAAIRU1hBQAgBExsGFRRK R09UUwgJDhUQEB0DCwhAWVRTAAQFDhACEQwCAxNSVE5BQBgJGRsXCgIJQFlUUxMGDwUcAAdGR1dH UgcVBwJKS1VTEg4ISkdPVFMWDgNGUgk=
'''

KEY = 'yourusername'

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

print(''.join(result))

@Warriorroxus

This comment has been minimized.

Copy link

@Warriorroxus Warriorroxus commented May 10, 2020

#You probably have python 3

import base64

MESSAGE = '''
FkAGARcCAh4UUlROQUAKFRAVAEZLTUAWGxgNAgwAABFTQV1NQBAHAAQCAAIRU1hBQAgBExsGFRRK R09UUwgJDhUQEB0DCwhAWVRTAAQFDhACEQwCAxNSVE5BQBgJGRsXCgIJQFlUUxMGDwUcAAdGR1dH UgcVBwJKS1VTEg4ISkdPVFMWDgNGUgk=
'''

KEY = 'yourusername'

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

print(''.join(result))

bro but only user name (key) also giving error

@RahulKamma0369

This comment has been minimized.

Copy link

@RahulKamma0369 RahulKamma0369 commented May 15, 2020

import base64
from itertools import cycle

message = input("Enter the encrypted message: ")

key = bytes(input("Enter your Google username: "), "utf8")

print(bytes(a ^ b for a, b in zip(base64.b64decode(message), cycle(key))))

@hb10001

This comment has been minimized.

Copy link

@hb10001 hb10001 commented May 16, 2020

bro can you tell me what's the use of that decoded message ?

@RahulKamma0369

This comment has been minimized.

Copy link

@RahulKamma0369 RahulKamma0369 commented May 17, 2020

bro can you tell me what's the use of that decoded message ?

it's just a congratulation message and there is no use of it other than that

@HitanshuGedam

This comment has been minimized.

Copy link

@HitanshuGedam HitanshuGedam commented Jun 1, 2020

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

This comment has been minimized.

Copy link

@azmatsiddique 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

This comment has been minimized.

Copy link

@jaltmayerpizzorno jaltmayerpizzorno commented Jul 30, 2020

It's just a final challenge...

@shash-1511

This comment has been minimized.

Copy link

@shash-1511 shash-1511 commented Aug 23, 2020

I also got this-

{'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
You can’t perform that action at this time.