WeChall_Training: Crypto - Caesar I (Crypto, Training)

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('')
相關文章
相關標籤/搜索