HiveBrain v1.2.0
Get Started
← Back to all entries
patternModerate

SHA-256 hashing in oracle 11g

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
11gsha256hashingoracle

Problem

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??

Solution

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, unless you brute-force it, or use Rainbow Tables. To check if a password is correct, you would hash it and compare it to the stored hash.

Context

StackExchange Database Administrators Q#57843, answer score: 12

Revisions (0)

No revisions yet.