1

I'm trying to understand the Oracle 11g password hashing algorithm, I found this link explaining how it is done, however, I have some confusion on how they say it's done. According to that link it goes like this:

  • Random 10 byte salt string is generated by oracle
  • The password and the salt string itself become one
  • Oracle runs the string through an SHA1 algorithm
  • The output is S:<HASH(password+salt)><SALT>

So for example:

>>> import hashlib
>>> d = hashlib.sha1()
>>> salt = "test"  # random salt (not 10 bytes)
>>> password = "testing"  # password
>>> password2 = password + salt  # salt and password become one
>>> print password2
testingtest
>>> d.update(password2)  
>>> data = d.hexdigest()  # hexdigest the password string (password+salt)
>>> hash_to_display = "s:{}{}".format(data, salt)  # return s:<HASH(pass+salt)><SALT>
>>> print hash_to_display.upper()
S:6B399DF23C6B76D667F5E043D2DD13407A2245BBTEST
>>> 

Am I correct in assuming that this is how Oracle 11g does it's hashing?

13aal
  • 265
  • 1
  • 2
  • 8
  • Possible duplicate of [Why store a salt along side the hashed password?](https://security.stackexchange.com/questions/100898/why-store-a-salt-along-side-the-hashed-password) – PwdRsch Jun 25 '17 at 16:37
  • 1
    @PwdRsch how do you figure that it's the same question? – 13aal Jun 25 '17 at 16:38
  • I know you're asking specifically about Oracle and not hashing in general, but I believe the linked answer is still applicable. – PwdRsch Jun 25 '17 at 16:38
  • Hmm, I actually think that might have helped, it still doesn't answer if I'm correct about the Oracle algorithm, but it does explain why the salt is added twice – 13aal Jun 25 '17 at 16:42
  • Glad it helped. I'd consider editing your question so it's now more focused on whether this is how Oracle 11g does it's hashing (your last question) rather than the two earlier ones about salt storage. It shouldn't be a duplicate then. – PwdRsch Jun 25 '17 at 16:51

1 Answers1

1

What you have matches the documentation I found (both official and not). Too bad, it's not as secure as it could be. Even if using SHA-1 (perhaps to be FIPS 140-2 compliant), one could run the data through many iterations to make it much harder to brute force.

Swashbuckler
  • 2,115
  • 8
  • 9
  • I found it hard to believe that this was how Oracle 11g hashed its password, as you said it's pretty insecure – 13aal Jun 25 '17 at 22:29