## Rainbow Table Hash Chain

### Forst

33 solved
Dec. 2, 2015, 10:10 a.m.

There is no instruction to do anything, the task just describes some sort of a rainbow table mechanism.

### Robert

Staff
Dec. 2, 2015, 3:29 p.m.

You're right! Will update immediately. The task is to recover the password corresponding to the hash given in the beginning of the problem description.

Also, holy crap you solved 15 problems quickly. You're currently the top solver on the site; we'd be interested in getting your input on a new problem. If you're interested would you please email us? Contact info is in the contact tab on the nav bar.

Thanks!

-Robert

### AsaAyers

1 solved
Dec. 3, 2015, 12:50 p.m.

val = sha256hash(val | pw) return hex(val)

Nothing here says what the difference is between sha256hash and hex. As this iterates is val a hex representation of the hash or something else?

### Robert

Staff
Dec. 3, 2015, 2:21 p.m.

AsaAyers, in the line val = sha256hash(val | pw), the return value of sha256hash is raw binary as opposed to the hex string representation, which is why the return value of the function is converted to hex.

For reference, the python function hashlib.sha256('password').digest() will return the raw binary, as will the program sha256 in Linux.

### IzaHacker

3 solved
Dec. 3, 2015, 5:20 p.m.

Is the rockyou file corrupted? If not what encoding is it using? The version I have has some odd binary and formatting on the end, and hashes to:

sha256: 6dfa76aa0e02303994fd1062d0ac983f0b69ece5474d85a5bba36362e19c1076
md5: 9076652d8ae75ce713e23ab09e10d9ee


I've downloaded both the bzip and raw versions, and they are the same.

### Forst

33 solved
Dec. 3, 2015, 5:56 p.m.

@IzaHacker The dictionary file is indeed malformed. The thing is, some lines are encoded as UTF-8 and some as CP1252. That's why Python stumbles over them. I don't know if I should give further hints, but there is quite an obvious "workaround" without a need to fix encodings.

### Robert

Staff
Dec. 3, 2015, 6:48 p.m.

@IzaHacker, added a clarification. The output of get_line_from_file('rockyou.txt', 14344108) should be ' \x93R3CKL3\x94'. Hopefully that helps!