Page 1 of 1

New SHA Security Functions (Convert Value Back)

Posted: Fri Dec 13, 2013 9:34 pm
by sarah
Howdy!

Vertica 7 has the new SHA() security functions.

Code: Select all

dbadmin=> select sha256('Dog');
                              sha256
------------------------------------------------------------------
 0eb129bf94594aaeee66e38361d7be212cd927c3df4dd92e3ded2e0da0c7ad88
(1 row)
Is there a way I can covert " 0eb129bf94594aaeee66e38361d7be212cd927c3df4dd92e3ded2e0da0c7ad88" back to "dog"?

Thanks...

Re: New SHA Security Functions (Convert Value Back)

Posted: Sat Dec 14, 2013 12:38 pm
by JimKnicely
SHA-1 is a one-way cryptographic hash function designed to make it practically impossible to reverse the process.

So the easiest answer to your question is "no" :(

Re: New SHA Security Functions (Convert Value Back)

Posted: Sun Dec 15, 2013 2:53 am
by quantomatic
One thing to have in mind is not to use straight SHA or any other hash functions to encrypt passwords without salt.
Hashed non strong passwords can be easily decrypted with a rainbow table.
To use your 'dog' example below, a simple Google search will reveal the password just by searching for the hash:

https://www.google.com/search?q=0eb129b ... a0c7ad88&o

If you want to use it storing passwords, you should use salted hashes.
https://exyr.org/2011/hashing-passwords/