Answer the question
In order to leave comments, you need to log in
How to decode sha1 hash captcha?
There is a frontend application that sends a POST request to the backend, protecting it with a sha1 hash using the object-hash npm module. The backend is already checking the correctness of the captcha. The captcha is generated on the front and sent along with the request. Example:
{
"operationName": "promocode",
"variables": {
"code": "hello",
"captcha": "a9c761a0be87d0e96d9203887725f1ac0f2acddf"
},
"query": "mutation promocode($code: String!, $captcha: String!) {\n promocode(code: $code, captcha: $captcha) {\n error\n message\n __typename\n }\n}\n"
}
Answer the question
In order to leave comments, you need to log in
to begin with, determine exactly what the hash sum is generated from, get examples of this data. ideally - in a debugger.
once you have examples of hashable data, define the part to be changed. let's say only 6 characters are changed, the captcha itself - in this case, sorting through the data is possible and will not take much time. but if, for example, this data contains a random character identifier for 16, the search becomes extremely complicated and the selection becomes impossible in a reasonable time
no way.
Hashing is not encryption. This is a one-way operation with compression, that is, with the loss of information.
It is impossible to restore the original string from the hash.
Given a hash algorithm, you can try different strings to see which ones generate the same hash. But due to collisions, this does not make it possible to tell exactly which line was the original one.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question