반응형 cryptography2 Basic password cracking (MD5, SHA1, ..) 기본적인 password cracking과 같은 문제를 CTF에서는 종종 접할 수 있다. 과거에도 비슷한 코드를 작성했었지만 메모리 초과로 인해서 포기하곤 했는데 우연히 검색을 하다가 알게된 부분이 있어서 공유해보고자 한다. 기본적으로 - MD5 : 32-bit hex digits - SHA1 : 40-bit hex digits - SHA256 : 256-bit hex digits 우선, 일부 문자열은 제공되어 있고 숫자만 padding하여 해쉬 값을 계산하는 것은 아래와 같다. 예제에서 주어진 것 처럼 실제 0000부터 9999까지 숫자만 붙여서 주어진 hash 값을 비교하는 것이므로 해당 예제는 상당히 간단하다. import hashlib prefix = "CTF-TEST-" match = "bf9e.. 2020. 7. 2. UTCTF 19' Write-up / [basics] crypto This time I took part in UTCTF. This is my approach. When I open the file, it has a binary string so I made a small code to figure out what messages in it a = "01010101 01101000 ...... " (Copy from the file)a = a.split(" ")d = "" for i in range(len(a)): d += chr(int("0b" + a[i], 2)) After that, I found below message, especially the encoding part. Uh-oh, looks like we have another block of text, .. 2019. 3. 10. 이전 1 다음 반응형