-1

Password - test

SHA512 Encryption - ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff

How decrypt SHA512 Encrypted data?

$decr_pw = hash("sha512", $row['pass']);

I have written like this, but it not decrypting password

Thanks,

Ajanyan Pradeep
  • 1,097
  • 1
  • 16
  • 26
  • 1
    SHA512 is a *hashing* algorithm, not an *encryption* algorithm. The main point of hashes is that they are one-way. You can’t reverse them (or if you could you would get infinite number of inputs that produce the same hash). What are you trying to do here? Check if password is correct? Hash it the same way and see if the result is the same. – Sami Kuhmonen Mar 04 '19 at 07:37
  • @SamiKuhmonen You should add this as an answer. – Blue Mar 04 '19 at 07:38

1 Answers1

4

SHA-512 is a cryptographic (one-way) hash function, so there is no direct way to decode it. The entire purpose of a cryptographic hash function is that you can't undo it.

One thing you can do is a brute-force strategy, where you guess what was hashed, then hash it with the same function and see if it matches. Unless the hashed data is very easy to guess, it could take a long time though.

Ajanyan Pradeep
  • 1,097
  • 1
  • 16
  • 26