CpawCTF
[Cpaw ctf] Q20.[Crypto]Block Cipher
skyepodium
2022. 8. 21. 12:15
1. 개요
block cipher 문제
블록 암호는 평문을 블록 단위로 암호화하는 대칭 알고리즘입니다.
2 분석
cipher = "ruoYced_ehpigniriks_i_llrg_stae"
flag = ""
for key in range(1, len(cipher), 1):
s_list = []
for i in range(0, len(cipher), key):
s_list.append(cipher[i:i+key][::-1])
res = "".join(s_list)
print('res', res)
key가 4일때 flag를 찾을 수 있습니다.