码迷,mamicode.com
首页 > 其他好文 > 详细

WeChall_Training: Crypto - Caesar I (Crypto, Training)

时间:2016-09-04 17:14:00      阅读:301      评论:0      收藏:0      [点我收藏+]

标签:

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!
VJG SWKEM DTQYP HQZ LWORU QXGT VJG NCBA FQI QH ECGUCT CPF AQWT WPKSWG UQNWVKQP KU TRNRHNKFUHKG
 
解题:
凯撒密码,枚举25次位移。
找到正确的句子。
 
a = VJG SWKEM DTQYP HQZ LWORU QXGT VJG NCBA FQI QH ECGUCT CPF AQWT WPKSWG UQNWVKQP KU TRNRHNKFUHKG
for i in range(1,26):
    ans = []
    for each in a:
        if each ==  :
            ans.append( )
        else:
            temp = ord(each)+i
            if temp > ord(Z):
                temp -= 26
            temp = chr(temp)
            ans.append(temp)
    for each in ans:
        print(each,end = ‘‘)
    print(‘‘)

 

 
 

WeChall_Training: Crypto - Caesar I (Crypto, Training)

标签:

原文地址:http://www.cnblogs.com/zhurb/p/5839521.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!