cryptopals 3

[cryptopals] Crypto Challenge Set 1 (Day 3)

Break repeating-key XORimport base64import osfrom itertools import combinations# 6.txt 파일을 읽는 함수 (파일 없으면 경로 입력받기)def load_file(filename="6.txt"): # 현재 디렉토리에 6.txt가 존재하는지 체크 if os.path.exists(filename): with open(filename, "r") as f: return f.read() # 존재하지 않는 경우 → 사용자에게 직접 경로 입력 요청 print(f"[!] '{filename}' 파일을 찾을 수 없습니다.") print("[*] 파일 전체 경로를 입력하세요. (예: C:\\Users..

Study/개념 정리 2025.11.21

[cryptopals] Crypto Challenge Set 1 (Day 2)

Implement repeating-key XOR주어진 문장을 "ICE" 키로 반복키 XOR을 사용해 암호화해야하는 문제라는 것 같다.주어진 문장Burning 'em, if you ain't quick and nimbleI go crazy when I hear a cymbal처음엔 ICE 라는 암호화 방식이 존재하는 줄 알았다. 하지만 문제를 계속해서 읽어보니 "ICE"라고 주어진 key값을 계속해서 반복하여 주어진 문자열을 xor 연산을 진행해서 푸는 문제이다.plaintext = """Burning 'em, if you ain't quick and nimbleI go crazy when I hear a cymbal"""key = b"ICE"cipher_hex = [] # 반복하면서 저장할 빈 리스트 ..

Study/개념 정리 2025.11.18

[cryptopals] Crypto Challenge Set 1 (Day 1)

The Cryptopals Crypto Challenges The Cryptopals Crypto ChallengesWelcome to the challenges We can't introduce these any better than Maciej Ceglowski did, so read that blog post first. We've built a collection of exercises that demonstrate attacks on real-world crypto. This is a different way to learn about crypto than tcryptopals.com암호학에 대해서 공부해볼 수 있는 사이트를 찾았다.base64, ROT13 등 여러가지 방식으로 존재하는 암호학에..

Study/개념 정리 2025.11.17