힌트가 무엇인지 보면 

 

The password for the next level is stored in the file data.txt, where all lowercase (a-z) and uppercase (A-Z) letters have been rotated by 13 positions

 

이말은 data.txt안의 있는 파일의 내용을 13자리 대소문자를 포함하여 뒤로 보낸다면 패스워드가 나온다는 말이다. 

그리고 힌트의 자세한 내용을 보면 아래와 같은 관련된 내용이 나온다.

 

https://en.wikipedia.org/wiki/ROT13

 

ROT13 - Wikipedia

From Wikipedia, the free encyclopedia Simple encryption method ROT13 ("rotate by 13 places", sometimes hyphenated ROT-13) is a simple letter substitution cipher that replaces a letter with the 13th letter after it in the latin alphabet. ROT13 is a special

en.wikipedia.org

 

ROT13 이란?

ROT13 라틴 알파벳 에서 문자를 그 뒤의 13번째 문자로 바꾸는 간단한 문자 암호 라고한다. 

어떻게보면 3자리 뒤의 문자로 치환되는 카이사르 암호와 비슷해보인다. 

그럼 문자열을 13자리 뒤로 보내기만 하면될 것이다.

 

이 부분 같은 경우 tr 명령어를 통해서 치환을 해주면 될 것 같다. 

cat data.txt | tr 'A-Za-z' 'N-ZA-Mn-za-m'

 

A는 ROT13을 사용하면 N이되기 때문에 대소문자를 포함하여 A~Z와 a~z를 치환을 해야 하기에 N부터Z까지 먼저 범위를

설정해주고, Z가 13자리 뒤로가면 M이 될 것이라서  A부터 M까지 범위를 설정했다.  

 

tr 명령어를 이용하여 문자를 치환하는 것이 문제의 관건 이었던 것 같다.

+ Recent posts