import hashlib
def birthday_hash(msg):
return hashlib.sha256(msg).digest()[12:17]
msg1 = bytes.fromhex(input("Input message 1 in hex: "))
msg2 = bytes.fromhex(input("Input message 2 in hex: "))
if msg1 == msg2:
print("Those two messages are the same! >:(")
elif birthday_hash(msg1) != birthday_hash(msg2):
print("Those two messages don't have the same birthday! T.T")
else:
print("Finally! They have the same birthday ^o^")
print(open("flag.txt").read())
birthday_hash(mg1) = birthday_hash(msg2) 5바이트 해시 값이 같아야 같은 생일이라구
flag.txt 파일을 얻을 수 있는 코드로 보인다
하지만...hash를 어떻게 찾아요 ㅠㅠ
분명 무슨 패턴이 있는거다..생일 역설..!
sha256(msg).digest()[12:17]이게 중요한데
설명을 보러가자
ㄷㄷ 생각보다 높네요 확률이? ㅋㅋㅋㅋ보통 같은 생일 찾는게 어려울 것 같은데 그래서 '역설'인듯
오이게 뭐죠?
살려줘..나 분수밖에 몰라...분수가 맞긴한데...저렇게 생긴 분수는 처음봄; 선생님 진도가 너무 빨라요..