-
1팀 박지혜 Write-Ups (suninatas_26)2021/Write-Ups 2021. 11. 9. 02:19
써니나타스 26번 문제
http://suninatas.com/challenge/web26/web26.asp
<풀이과정>
문제를 보면
This challenge is to recover the plaintext from the following ciphertext using frequency analysis:
이 문제는 빈도 분석을 사용하여 다음 암호문으로부터 일반 텍스트를 복구하는 것입니다.라는 힌트를 제공하고 있다.
빈도분석이란?
암호학에서의 빈도분석(頻度分析, frequency analysis 또는 counting letters)이란 평문과 암호문에 사용되는 문자 또는 문자열의 출현빈도를 단서로 이용하는 암호해독법을 말한다. 평문 언어의 통계적 특징을 전제로 하여, 암호문만을 사용해서 해독을 진행하기 때문에, 암호문 단독공격으로 분류된다.
해독작업은 출현빈도 따위의 통계량을 단서로 한 문자씩 평문의 문자를 추정하여, 모순이 생기면 다시 돌아가 다음 문자를 시험하는 것을 반복한다. 문자 추정은 출현빈도에 특징이 있는 문자부터 할당하고, 그러면 출현빈도가 높은 문자와 낮은 문자 모두 이용할 수 있다. 문법 상 전후의 단어를 통해 의미를 고려하여 문자의 경우의 수를 좁혀나가는 경우도 있다.
(출처 : 위키백과 - https://ko.wikipedia.org/wiki/%EB%B9%88%EB%8F%84%EB%B6%84%EC%84%9D_(%EC%95%94%ED%98%B8)
szqkagczvcvyabpsyincgozdainvscbnivpnzvbpnyfkqhzmmpcqhzygzgfcxznvvzgdfnvbpnjyifxmpcqhzygbpnoyaimygbzgngbvmpcqhzygcbpinnbzqndicgxhiztozgcfmpcqhzygbpnjyifxeagzyimpcqhzygbpneagzyidicgxhiztozgcfmpcqhzygcgxcoyaibzqnvyabpsyincggcbzygcfmpcqhzygszqzvbpnozivbvyabpsyincgozdainvscbnibyjzgcqnxcfcbcgzvaeagzyiyivngzyidicgxhiztnungbzvampcqhzygvpzhcgxbpnyfkqhzmdcqnvvpnzvbpnozivbonqcfnvscbnibyjzgbpnyfkqhzmdcqnvbpnjyifxmpcqhzygvpzhvbpnoyaimygbzgngbvmpcqhzygvpzhvcgxbpndicgxhiztozgcfvpnzvygnyobpnqyvbpzdpfkinmydgzlnxcbpfnbnvcgxqnxzcozdainvzgvyabpsyinccvyochizfbpzvkncivpnzvicgsnxvnmygxzgbpnjyifxrkbpnzgbnigcbzygcfvscbzgdagzygvpnzvbpnmaiingbinmyixpyfxnioyifcxznvzgbpnvpyibhiydicqbpnoinnvscbzgdcgxbpnmyqrzgnxbybcfagxnibpnzvaeaxdzgdvkvbnqvpnzvcfvybpnozivbonqcfnvscbnibyvaihcvvbpnbjypaxincxhyzgbqcisagxnibpnzvaeaxdzgdvkvbnqvpnpcvgnunirnnghfcmnxyoobpnhyxzaqzgpningbzinmcinni 본문에서 알파벳이 쓰인 빈도를 보면 각각
a - 27 / b - 66 / c - 67 / d - 20 / e - 5 / f - 26 / g - 70 / h - 26 / i - 61 / j - 7 / k - 9 / l - 1 / m - 22 / n - 94 / o - 23 / p - 60 / q -30 / r - 3 / s - 13 / t - 4 / u - 2 / v - 62 / w - 0 / x - 31 / y - 59 / z - 78
개임을 알 수 있다. 그 중에서 특히 사용빈도가 높은 알파벳은 b, c, g, i, n, p , v, y, z 임을 알 수 있는데, 순위별로 나타내면 알파벳 N이 가장 많이 나타난 것을 확인할 수 있다.
(출처 : 위키백과 - https://ko.wikipedia.org/wiki/%EB%B9%88%EB%8F%84%EB%B6%84%EC%84%9D_(%EC%95%94%ED%98%B8)
다음과 같이 그래프를 살펴보면, 일반적으로 알파벳 E가 가장 많이 사용됨을 알 수 있고, 이를 통해 가설을 하나 세울 수 있다.
가설 1. 암호문에서 가장 많이 사용된 알파벳 N이 실제로는 알파벳 E를 나타낸 것이다.
이 가설을 이용해 암호문 복호화 사이트에서 복호화를 진행한다. 복호화 사이트는 다음과 같다.
복호화 사이트에서 다음과 같이 N=E 라는 힌트를 제공한 뒤 복호화 사이트에서 복호화를 진행한다. Solve 버튼을 누르면 여러 복호문이 나오는데, 가장 맥락에 맞는 복호문을 찾으면 다음과 같은 결과를 찾을 수 있다.
kim yuna is a south korean figure skater she is the olympic champion in ladies singles the world champion the four continents champion a three time grand prix final champion the world junior champion the junior grand prix final champion and a four time south korean national champion kim is the first south korean figure skater to win a medal at an isu junior or senior grand prix event is u championship and the olympic games she is the first female skater to win the olympic games the world championships the four continents championships and the grand prix finals he is one of the most highly recognized athletes and media figures in south korea as of april this year she is ranked second in the world by the international skating union she is the current record holder for ladies in the short program the free skating and the combined total under the isu judging systems he is also the first female skater to surpass the two hu dread point mark under the isu judging systems he has never been placed off the podium in her entire career
정확하게 복호화되지는 않았지만, 복호문을 통해 해당 본문이 김연아 선수에 대해 이야기하고 있음을 추론할 수 있다.
kimyuna를 입력하면 정답임을 알 수 있다.
'2021 > Write-Ups' 카테고리의 다른 글
1팀 이유진 Write-Ups (Suninatas_18) (0) 2021.11.09 3팀_김소희_Write-Ups (HackCTF-Welcome_Forensics/Question?) (0) 2021.11.09 2팀_송설연_Write-Ups (Suninatas_19) (0) 2021.11.09 4팀_최민영 Write-ups (suninatas_3) (0) 2021.11.08 4팀_최민영 Write-ups (suninatas_15) (0) 2021.11.08