반응형
18번이랑 비슷한 늒김..
이번에는 바이너리로되어있는거같아서 바이너리를 아스키코드로 변환했다.
https://www.rapidtables.org/ko/convert/number/binary-to-ascii.html
요 사이트이용했음
역시나 암호화된것처럼 보이는 문자열이 보임.
18번이랑 동일한가 해서 base64돌려보니 안나온다.
다시보니 뭔가 쉬프트 암호일거같음. 띄어쓰기도 있고 중간중간 ZJ가 반복되는데 동일한 문자열에 대해 치환한거인거같음.
NVCTFDV KF JLEZERKRJ REU KFURP ZJ R XFFU URP REU RLKYBVP ZJ GCRZUTKWZJMVIPYRIU
툴 찾기 귀찮아서 전에 내가 짜둔 코드 이용해서 해봤다.
코드 돌려보니 말이 되는 문장은 이거 하나다. 저게 키인갑다.
혹시 사용할 사람이 있으려나 해서..
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <ctype.h>
void decryptCaesarCipher(char cipherText[], int shift) {
int length = strlen(cipherText);
for (int i = 0; i < length; i++) {
char currentChar = cipherText[i];
if (isalpha(currentChar)) {
char baseChar = (islower(currentChar)) ? 'a' : 'A';
char decryptedChar = (currentChar - baseChar - shift + 26) % 26 + baseChar;
cipherText[i] = decryptedChar;
}
}
}
int main() {
char cipherText[100];
char originalCipherText[100];
int shift;
printf("암호문: ");
fgets(cipherText, sizeof(cipherText), stdin);
cipherText[strcspn(cipherText, "\n")] = '\0';
strcpy(originalCipherText, cipherText);
for (shift = 0; shift < 26; shift++) {
strcpy(cipherText, originalCipherText);
decryptCaesarCipher(cipherText, shift);
printf("%d 평문: %s\n", shift, cipherText);
}
return 0;
}
해독하려고 짠 코드입니다.. C언어가 빠르고 편해서,...
아무튼 풀었음
반응형
'학회_공부해요 > 워게임' 카테고리의 다른 글
[SuNiNaTas(써니나타스)] Write up - 10번 (1) | 2024.09.24 |
---|---|
[SuNiNaTas(써니나타스)] Write up - 15번 (1) | 2024.09.24 |
[SuNiNaTas(써니나타스)] Write up - 18번 (0) | 2024.08.27 |
[Dreamhack(드림핵)] Write up - session (0) | 2024.08.06 |
[SuNiNaTas(써니나타스)] Write up - 14번 (0) | 2024.08.06 |