본문 바로가기
CpawCTF

[Cpaw ctf] Q20.[Crypto]Block Cipher

by skyepodium 2022. 8. 21.

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를 찾을 수 있습니다.

'CpawCTF' 카테고리의 다른 글

[Cpaw ctf] Q15.[Web] Redirect  (0) 2022.08.21
[Cpaw ctf] Q16.[Network+Forensic]HTTP Traffic  (0) 2022.08.17