This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 -u | |
from Crypto.Cipher import AES | |
agent_code = """flag""" | |
def pad(message): | |
if len(message) % 16 != 0: | |
message = message + '0'*(16 - len(message)%16 ) | |
return message | |
def encrypt(key, plain): | |
cipher = AES.new( key.decode('hex'), AES.MODE_ECB ) | |
return cipher.encrypt(plain).encode('hex') | |
welcome = "Welcome, Agent 006!" | |
print welcome | |
sitrep = raw_input("Please enter your situation report: ") | |
message = """Agent, | |
Greetings. My situation report is as follows: | |
{0} | |
My agent identifying code is: {1}. | |
Down with the Soviets, | |
006 | |
""".format( sitrep, agent_code ) | |
message = pad(message) | |
print encrypt( """key""", message ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment