Skip to content

Instantly share code, notes, and snippets.

@shinshin86
Created August 6, 2016 11:55
Show Gist options
  • Save shinshin86/83543f825cb4bae676b04c185f934c3b to your computer and use it in GitHub Desktop.
Save shinshin86/83543f825cb4bae676b04c185f934c3b to your computer and use it in GitHub Desktop.
It was create to solve to SECCON2015 online CTF - Excercise (After)
# -*- coding: utf-8 -*-
import sys
def create_dict(c,p):
dic ={}
for i in range(len(c)):
dic[c[i]] = p[i]
return dic
def q_replace(q, dic2):
answer = ""
for i in range(len(q)):
answer += dic2[q[i]]
return answer
if __name__ == '__main__':
argvs = sys.argv
argc = len(argvs)
# If the number of arguments is not correct...
if (argc != 4):
print("Argument is not corrext...")
print(" ** HOW TO USE ** ")
print(" python caesar_cipher.py [Cipher] [Plain] [Quiz] ")
print(" **************** ")
quit()
dic2 = create_dict(argvs[1],argvs[2])
print(" ** Answer ** ")
print(q_replace(argvs[3], dic2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment