-
-
Save jacquerie/cfb8a56636e2b9e12f51 to your computer and use it in GitHub Desktop.
#!/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) |
#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))
#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
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))))
bro can you tell me what's the use of that decoded message ?
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
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??
####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!'}
It's just a final challenge...
I also got this-
{'success' : 'great', 'colleague' : 'esteemed', 'efforts' : 'incredible', 'achievement' : 'unlocked', 'rabbits' : 'safe', 'foo' : 'win!'}
I also got same. in 2016
To visualize decode steps, go to following CyberChef recipe:
https://gchq.github.io/CyberChef/#recipe=From_Base64('A-Za-z0-9%2B/%3D',true)XOR(%7B'option':'Latin1','string':'jacopo.notarstefano'%7D,'Standard',false)&input=RVVZUUdoTU1TeDBjVTBGSVUxTUNGQVFQRzAxTlEwZ1RBRUlDQ2hVR0J4WlRSVnhCU1FvWkZRWUtIUXBLU1VOVVJoY1ZFZ29VRlIxSVNsdERTQmtCVFJ3S0VBZ1FIeEZDU2tGSkRna0pDZ29HQ2tNTEFRQkdVa2xVUWhNUEFnQUpDZ1lMVjBNT1NSMFZBeEFhQUJaQlFWUlBUUklDQ1JWSUFrNUlFZzRkVkZSZlJrWVpCZ1JBUkJJPQ
where can i find the key?
Line #16:
result.append(chr(c ^ ord(KEY[i % len(KEY)])))
(ord(c)) is creating error.