I was recently solving a CTF problem and it involved a shadow and passwd file. I got to know the username easily but I am unable to find the password since it is SHA-512 hashed. My doubt is that when I read the hashed value it is not exactly a random hexadecimal value. It contains many characters other that 1, 2, 3 ... F. How can I decrypt it because I can't even use tools online since they return a hexadecimal value.

  • 1
    $\begingroup$ How are we supposed to answer this if you don't show us the hashed value? It sounds like it is either using another encoding than hex (base 32, base 64) or maybe it is not encoded at all. $\endgroup$ – Maarten Bodewes Oct 2 '18 at 23:07
  • $\begingroup$ unix password shadow files encode the password and salt, see Modular Crypt Format for reference $\endgroup$ – Richie Frame Oct 2 '18 at 23:52

A cryptographic hash function like SHA-512 is a “one-way compression function” – so it can not simply be “decrypted” with some tool.

Instead, when you are trying to “break“ a hash output like the hex string you are looking at, you will need to find the input that produces that hex string. You will have to use a brute force attack using the hints provided within the CTF itself.

As for any potential encoding/decoding issues you might be facing (since you mention something about characters outside of the HEX range), that’s more of a programming thing and not really related to cryptography.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.