-
+
- MQ +
- 26 August 2021 +
- Crypto + +
+ Points: 150
+ Description: Consider the format: "< message > + < random number >". For example: "hello+453" has its SHA256 hash as:
+
+ 24ea0ded1e01de0861bfaaace9bbfb48922f96f4e023ca637ee5cb1b29e9db7f
+
+ Where hello is message, plus (+) is the delimiter & 453 is a random number.
+
+ Find the smallest positive integer such that the SHA256 hash of the message "catch-me-if-you-can" represented in the given format has eight zeros as its first 8 characters.
+
+ Note:
+ 1. The hash presented for "hello+453" has "24e" as the first 3 characters.
+ 2. There are no quotes in the format, they are just to highlight the strings.
+
+ Example:
+
+ With the random number 453, the hash of the given message: "catch-me-if-you-can" (i.e. catch-me-if-you-can+453) in the specified format is:
+
+ a84f4f32f3ba9b2f1e402e248f9d27239875a752114405b94e6e570a29c1073e
+
Links and Hints
+:)
+Recon
+From the question, we can understand that we need to find the smallest positive integer such that the SHA256 hash of the message "catch-me-if-you-can" represented in the given format has eight zeros as its first 8 characters.
+
Finding the Flag
+So we wrote a python script while add number form 0 to infinity and check if the hash has 8 zeros as its first 8 characters.
+
+ import hashlib
+
+ string = 'catch-me-if-you-can+'
+ number = 0
+
+ while True:
+ number = number + 1
+ hash = hashlib.sha256(f'{string}{number}'.encode()).hexdigest()
+ if '00000000'in hash
+ print(number)
+ break
+
+ Download Code
+ 


