Skip to content

Instantly share code, notes, and snippets.

Created October 28, 2018 15:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save key-moon/5dc5291f5ff3ff7d759d0085d0342233 to your computer and use it in GitHub Desktop.
#!/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 = 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:
My agent identifying code is: {1}.
Down with the Soviets,
""".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