2021 SISS 21기 활동/여름방학 CTF[연합]
[picoCTF] 13 - Cryptography
hyerang0125
2021. 7. 29. 21:45
앞서 해결했던 Mod 26과 같은 ROT13 문제이다.
ciphertext = "cvpbPGS{abg_gbb_onq_bs_n_ceboyrz}"
c = list(ciphertext)
for i in range(len(c)):
if c[i] >= 'A' and c[i] <= 'Z':
c[i] = chr((ord(c[i]) - ord('A') + 13) % 26 + ord('A'))
elif c[i] >= 'a' and c[i] <= 'z':
c[i] = chr((ord(c[i]) - ord('a') + 13) % 26 + ord('a'))
plain = ''.join(c)
print(plain)
간단하게 성공할 수 있었다.