I am trying to solve a security challenge on a website.
Basically, the website computes sha1(key + cookie)
to sign a cookie so that the user can't change it himself, and to accomplish the goal you have to find the key
value.
I have two (not really good) ideas to find the secret key value :
- 1: Online (way too slow) try all combinations of the authentication hash with an empty (0 bytes) cookie: this way the website will compute
sha1(key)
only and will stop displaying an error when I find the correct secret key value. - 2: Offline (still very slow but better since you don't need any network requests) go on the website and get {cookie, cookie_hash}. Try to hash
xxx + cookie
for every possible value ofxxx
: whensha1(xxx + cookie) == cookie_hash
, I know that xxx == secret key.
The thing is, as you noticed, that even the second method is brute forcing and therefore very slow.
Do you think there is a faster method?