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

本文介绍了一种简单的Caesar密码加密原理及其实现方法,并通过Python脚本演示了如何解密此类密码。读者将了解字母替换的基本过程以及如何逆向操作来揭示隐藏的消息。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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:'%l
for 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 += i

print 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!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值