Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

How can i encrypt or hash a password inside a trigger using sha-256 so that i can store the hashed value in another table using that trigger? Also how can I decrypt it??

share|improve this question
1  
Why are you sending a plain text password in the first place? –  gbn Jan 30 at 8:31
add comment

1 Answer

Unfortunately DBMS_CRYPTO in Oracle 11.2 only supports SHA1 (documentation link), which is 160-bit. .

DBMS_CRYPTO in Oracle 12.1 supports SHA2 HASH_SH256 (documentation link), which does what you require.

There are some free implementations of SHA2 just a google away. This blog post, for example.

As for decrypting a hashed password? I don't think you understand hashing. Hashing is 1-way. To check if a password is correct, you would hash it and compare it to the stored hash.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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