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. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
Why are you sending a plain text password in the first place? – gbn Jan 30 '14 at 8:31

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

Your Answer


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.