본문 바로가기

security/crypto

(15)
[Dreamhack] darimchal_001 풀이 보호되어 있는 글입니다.
[Dreamhack] likeb64 풀이 보호되어 있는 글입니다.
[Dreamhack] ICM2022 풀이 보호되어 있는 글입니다.
[CryptoHack] Modular Arithmetic (1) from math import * print(gcd(12,8)) print(gcd(66528,52920)) https://web.archive.org/web/20230511143526/http://www-math.ucdenver.edu/~wcherowi/courses/m5410/exeucalg.html Extended Euclidean Algorithm The Extended Euclidean Algorithm As we know from grade school, when we divide one integer by another (nonzero) integer we get an integer quotient (the "answer") plus a remainder (generally a rational..
[CryptoHack] Introduction to CryptoHack (2) c = 'label' e = '' for i in c: i = ord(i) e += chr(i^13) print(e) c = 'label' print("".join(chr(ord(i)^13) for i in c)) from pwn import * c = 'label' print(xor(c, 13)) 앞의 설명과 같이 pwntool 모듈에서 xor()을 사용해 해결할 수도 있습니다. pwntool 모듈을 사용한 경우 결과가 바이트 문자열로 옴을 확인할 수 있습니다. (밑에 결과는 pwntool 모듈을 사용하지 않은 결과 입니다.) from pwn import * k1 = bytes.fromhex("a6c8b6733c9b22de7bc0253266a3867df55acde8635e19c73313") k23 = ..
[CryptoHack] Introduction to CryptoHack (1) #!/usr/bin/env python3 import sys # import this if sys.version_info.major == 2: print("You are running Python 2, which is no longer supported. Please update to Python 3.") ords = [81, 64, 75, 66, 70, 93, 73, 72, 1, 92, 109, 2, 84, 109, 66, 75, 70, 90, 2, 92, 79] print("Here is your flag:") print("".join(chr(o ^ 0x32) for o in ords)) c = [99, 114, 121, 112, 116, 111, 123, 65, 83, 67, 73, 73, 95, ..
[Dreamhack] Textbook-DSA 풀이 보호되어 있는 글입니다.
[Dreamhack] Textbook-RSA 풀이 보호되어 있는 글입니다.
[Dreamhack] SingleByteXor 풀이 보호되어 있는 글입니다.
[Dreamhack] Basic_Crypto1 풀이 보호되어 있는 글입니다.