[WeChall] Training: Crypto - Caesar I (Crypto, Training)

来源:互联网 发布:windows开机音效 编辑:程序博客网 时间:2024/06/10 15:40
Question:
Crypto - Caesar I
As on most challenge sites, there are some beginner cryptos, and often you get started with the good old caesar cipher.
I welcome you to the WeChall style of these training challenges :)

Enjoy!
IWT FJXRZ QGDLC UDM YJBEH DKTG IWT APON SDV DU RPTHPG PCS NDJG JCXFJT HDAJIXDC XH CTGHPCDRCVDG

Solution:

It's a simply example of  caesar cipher, When encrypting, a person looks up each letter of the message in the "plain" line and writes down the corresponding letter in the "cipher" line. Deciphering is done in reverse, with a right shift of 3. I decode this By python:

#!/usr/bin/env python f = file('key.txt','r+')s = f.read()l = []for i in s:    l.append(i)leng = len(l)print 'l:'%lfor i in range(leng):l[i] = ord(l[i])new = []for i in l:    new.append(chr(i+3))cryptos = ""for i in new:    cryptos += iprint cryptos.lower() 

key.txt is the string to Decode.and result s :

thewquickwbrownwfoxwjumpswoverwthewlazywdogwofwcaesarwandwyourwuniquewsolutionwiswnersanocngor

ignore the char 'w', we can see the words:

the  quick brown fox jumps over the lazy dog of caesar and your unique solution is nersanocngor

submit the string "nersanocngor", SUCCESS!

0 0