0

I have the following line in my /etc/shadow file (SALT and HASHED_PASSWORD are not real values for obvious reason). And I understand $6 means SHA512 is used.

testuser:$6$SALT$HASHED_PASSWORD:19591:0:99999:7:::

I wonder how do I combine the SALT and my real password PASSWD as input for SHA512 to get the HASHED_PASSWORD value?

I tried to run sha512sum command and paste in PASSWD+SALT and SALT+PASSWD (without the + sign). But the result is nothing like the HASHED_PASSWORD stored in the file.

DrizzleX
  • 125
  • 1
    @DrizzleX The insight you may be missing is that the algorithm is not just salted SHA512, but rather a series of multiple sha512+salt hashing iterations (thousands of them), in order to make the hash "slower" (bad for the attacker, good for the defender) – Royce Williams Aug 22 '23 at 17:33
  • @RoyceWilliams that makes sense. – DrizzleX Aug 24 '23 at 02:04
  • 1
    The second insight needed is that output of sha*sum is usually hex but the crypt output is base64 (but not the traditional base64!) – muru Aug 24 '23 at 10:13

0 Answers0