암호학 잘 하고 싶어서 뭘 많이 시도해봤지만 너무 중구난방으로 공부해서 문제 풀이 실력은 계속 제자리 걸음 하던 중
정말 기초 문제부터 차근차근 풀어보면 실력이 조금은 성장하지 않을까 싶어서 풀게되는 OverTheWire - Krypton
문제도 7개밖에 없고, 뒤에 문제들은 아직 확인 안해서 어려운진 모르겠지만 첫 문제는 정말 기초부터 시작해서 부담이 크게 없다
빨리 다 풀고싶다!!! 실력이 된다면 . . . 그리고 미루지 않는다면 . . .
Level Info
Welcome to Krypton! The first level is easy. The following string encodes the password using Base64:
S1JZUFRPTklTR1JFQVQ=
Use this password to log in to krypton.labs.overthewire.org with username krypton1 using SSH on port 2231. You can find the files for other levels in /krypton/
문제에 접속하는 기본적인 문제라서 아주 쉽다
S1JZUFRPTklTR1JFQVQ=
문제에 나온 위 문자열을 Base64로 Decode해주면 KRYPTONISGREAT
가 나온다.
$ echo S1JZUFRPTklTR1JFQVQ= | base64 -d
사이트를 이용해도 좋고 command line에서 위와 같이 명령어를 쳐도
password가 나온다.
krypton1를 id로 하고 password를 입력하는 칸에 KRYPTONISGREAT
를 입력
접속 성공
정답 : KRYPTONISGREAT
Encoding is not realy cryptography, but it is used a lot in all kinds of standards around cryptographic functions. Especially Base64 encoding.
Base64 encoding is a technique used to transform all kinds of bytes to a specific range of bytes. This specific range is the ASCII readable bytes. This way you can transfer binary data such as secret or private keys more easily. You could even print these out or write them down. Encoding is also reversible. So if you have the encoded version, you can create the original version.
On wikipedia you can find more details. Basically it goes through all the bytes and transforms each set of 6 bits into a readable byte (8 bits). The result is that the size of the encoded bytes is increased with about 33%.
Basic authentication is sometimes used by web applications. This uses base64 encoding. Therefore, it is important to at least use Transport Layer Security (TLS or more commonly known as https) to protect others from reading the username password that is sent to the server.
$echo -n "myuser:mypassword" | base64
bXl1c2VyOm15cGFzc3dvcmQ=
The HTTP header will look like:
Authorization: Basic bXl1c2VyOm15cGFzc3dvcmQ=