I'm writing a Java EE application, which allows new users to register themselves and then log in over the Internet. I'm storing the credentials an a db.
Now, there are several ways to do that, e.g.:
- send username and password, preferably over a TLS/SSL connection
- send username and a hashcode of the password, preferably over a TLS/SSL connection
- use the Secure Remote Password protocol (preferably over a TLS/SSL connection ?)
Reading some articles, it seems the Secure Remote Password Protocol (SRP) is the way to go.
But then reading some other articles it seems as this is only used on some low-level layers, e.g. such as TLS/SSL itself.
I still think, it's recommended to use the Secure Remote Password Protocol on application level.
Is this correct? Or are there some good reasons why this is not needed on application level?
People should use SRP over TLS/SSL as they are complimentary.
If your users register or reset their SRP password verifier over the network then you need to encrypted the connection; as the verifier should to be kept secret so that it is not subjected to an offline brute force attack. TLS/SSL/HTTPS are perfect for this. They are well established, encrypt all data, and gives the protection of server certificates which try to ensure that the browser does not talk to a spoofing server.
SRP means that the password your users authenticate with does not cross the network. If your users use a company supplied computer going via a corporate web proxy then HTTPS may be decrypted and monitored. The Hearbleed bug also shows that well configured HTTPS can have problems. Laptop manufacturers have deliberately compromised HTTPS on the laptops they sell with Superfish so they can inject ads into encrypted pages. There could be compromised root certificates as deployed by the French government to snoop on employees. Even with a perfect encryption setup an application may leak passwords into logs by accident; whereas SRP does a one-time password proof using randomised inputs. So SRP protects the password from leaving the client machine which is inherently more secure than having it come into memory (from where it can be leaked) on two machines.
The upshot is that people should use both SRP and HTTPS/TLS/SSL.