문제 제목에서 냄새가 난다.
대체 암호에 관련된 문제로 추측된다.
문제에서 시작 문자열을 줬으므로, leuk he zo`n으로 맞춰주자.
1 2 3 4 5 6 7 8 9 | encoded = "ogrk hg tl`n srbszizrzig aiphgu " encoded += "mg ycahzylluf vllu fg ahcoogneg " encoded += "pceinc is ngzdluag" # ogrk hg tl`n -> leuk he zo`n encoded = encoded.replace('o', 'L').replace('g', 'E').replace('u', 'R').replace('e', 'G').replace('t', 'Z').replace('l', 'O') print encoded | cs |
r과 z를 치환해주자.
1 2 3 4 5 6 7 8 9 10 11 12 | encoded = "ogrk hg tl`n srbszizrzig aiphgu " encoded += "mg ycahzylluf vllu fg ahcoogneg " encoded += "pceinc is ngzdluag" # ogrk hg tl`n -> leuk he zo`n encoded = encoded.replace('o', 'L').replace('g', 'E').replace('u', 'R').replace('e', 'G').replace('t', 'Z').replace('l', 'O') # srbsz -> subst encoded = encoded.replace('r', 'U').replace('z', 'T') print encoded | cs |
제대로 배치되어 있는 문자를 대문자로 치환하자.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | encoded = "ogrk hg tl`n srbszizrzig aiphgu " encoded += "mg ycahzylluf vllu fg ahcoogneg " encoded += "pceinc is ngzdluag" # ogrk hg tl`n -> leuk he zo`n encoded = encoded.replace('o', 'L').replace('g', 'E').replace('u', 'R').replace('e', 'G').replace('t', 'Z').replace('l', 'O') # srbsz -> subst encoded = encoded.replace('r', 'U').replace('z', 'T') # to uppercase encoded = encoded.replace('k', 'K').replace('h', 'H').replace('n', 'N').replace('s', 'S').replace('i', 'I').replace('b', 'B') print encoded | cs |
aIpHER, CHcLLENGE를 각각 아는 단어로 바꿔주자.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | encoded = "ogrk hg tl`n srbszizrzig aiphgu " encoded += "mg ycahzylluf vllu fg ahcoogneg " encoded += "pceinc is ngzdluag" # ogrk hg tl`n -> leuk he zo`n encoded = encoded.replace('o', 'L').replace('g', 'E').replace('u', 'R').replace('e', 'G').replace('t', 'Z').replace('l', 'O') # srbsz -> subst encoded = encoded.replace('r', 'U').replace('z', 'T') # to uppercase encoded = encoded.replace('k', 'K').replace('h', 'H').replace('n', 'N').replace('s', 'S').replace('i', 'I').replace('b', 'B') # aIpHER -> CIPHER, CHcLLENGE -> CHALLENGE encoded = encoded.replace('a', 'C').replace('c', 'A').replace('p', 'P') print encoded | cs |
여태까지의 규칙을 보면, 알파벳이 서로 바뀌는 모습을 볼 수 있다.
예컨대, o가 l로, l이 o로 바뀌는 것이다.
마지막으로 d와 f를 서로 바꿔주면, 마지막 단어가 패스워드가 된다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | encoded = "ogrk hg tl`n srbszizrzig aiphgu " encoded += "mg ycahzylluf vllu fg ahcoogneg " encoded += "pceinc is ngzdluag" # ogrk hg tl`n -> leuk he zo`n encoded = encoded.replace('o', 'L').replace('g', 'E').replace('u', 'R').replace('e', 'G').replace('t', 'Z').replace('l', 'O') # srbsz -> subst encoded = encoded.replace('r', 'U').replace('z', 'T') # to uppercase encoded = encoded.replace('k', 'K').replace('h', 'H').replace('n', 'N').replace('s', 'S').replace('i', 'I').replace('b', 'B') # aIpHER -> CIPHER, CHcLLENGE -> CHALLENGE encoded = encoded.replace('a', 'C').replace('c', 'A').replace('p', 'P') # d -> F, f -> D encoded = encoded.replace('d', 'F').replace('f', 'D') print encoded | cs |
'[Wargame Write-up] > Net-Force' 카테고리의 다른 글
[Net-Force] [internet] 1. Flash Login (0) | 2017.03.07 |
---|---|
[Net-Force] [Cryptography] 3. Sea Code (0) | 2017.01.11 |
[Net-Force] [Steganography] 1. Training - Can you see me? (0) | 2016.12.24 |
[Net-Force] [Cryptography] 1. Training - Crypto basics. (0) | 2016.12.24 |
[Net-Force] [Java Applet] 2. Decompile me... (0) | 2016.12.24 |