领航杯2022-Crypto-1

题目很简单:

tata mb xwhvxw mlnX sTRtI4JNqEfuaa7LnT5MyJVA046GnTRt54Twg9UAd4JtyXLNUF6E :xkxa lb ztey xaH

随便搜索了一下,找到2019年的类似题目:

 Crypto CTF 2019 - Decode Me!

https://ctftime.org/writeup/16108

利用相同的脚本,直接把内容换一下,即可得到flag:


cipher = "tata mb xwhvxw mlnX sTRtI4JNqEfuaa7LnT5MyJVA046GnTRt54Twg9UAd4JtyXLNUF6E :xkxa lb ztey xaH"
cipher = cipher[::-1]
print(cipher)
decoded_cipher = ""

for i in range(len(cipher)):
    if cipher[i].isupper():
        val = ord(cipher[i]) + 12
        if val > ord('Z'):
            val = (val - ord('Z')) + ord('A') - 1
        decoded_cipher += chr(val)
    elif cipher[i].islower():
        val = ord(cipher[i]) + 7
        if val > ord('z'):
            val = (val - ord('z')) + ord('a') - 1
        decoded_cipher += chr(val)
    elif cipher[i].isdigit():
        val = ord('0') + ((int(cipher[i])+25) % 10)
        decoded_cipher += chr(val)
    else:
        decoded_cipher += cipher[i]
        
print(decoded_cipher)


import base64

print(base64.b64decode(decoded_cipher[len("The flag is here: "):len(decoded_cipher)-len(" Just decode it haha")]).decode())

flag:

CTFer_i_d0n't_th1nK_y0u_cAn_hand1e_Th1s

你可能感兴趣的:(Crypto,WP,2022,领航杯,Crypto)