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 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 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))

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.