Working on a web site, and want to be 100% ( well, as close as possible ) to not being "that guy" who just used MD5 in my database after an attack. SO I'm looking for comments, criticisms, or other suggestions.
So I'll outline what I have.
You sign in with a username and password, BUT if you opted in for 2 factor, my app is integrated with Twilio, so you send a txt message to the phone number containing just AUTH, it sends back a 5 digit code you must also use, which is only good for 5 minutes.
Before that password is sent, it's hashed with SHA512, combined with another hash of you username ( to avoid the Birthday Problem ), and key stretched a few times.
The login data is not sent in the body ( because I have compression on, and we have BEAST and CRIME, although I'm trying to avoid RC4 ), but my testing shows I have PFS/ECC available for most browsers that support it. ( I have an A grade from ssllabs.com )
So, I can honestly say that I have not seen the users plaintext password.
The server side of auth is rate limited ( Guava's RateLimiter ), but, to prevent timing based attacks, I record the start time, and throughout the day the average successful login time. If the login is not successful, the thread sleeps for the difference of duration to the average success time.
I also have some form of session ID rotation, IP tracking, etc, which I'm not going to detail here.
When the password is first created, I then use BCrypt, with the salt and users other information in not just different tables, but different databases.
Then it is encrypted, AES-256/PKCS, and I have many keys and salts, so there isn't just ONE AES key, if one key is compromised, the entire database is not. Which key/salt to use is based of a numeric hash of the users login ID and other information when they created their account.
BUT here is my issue. I need to store those AES keys SOMEWHERE. Somewhere secure, so that the keys can't be expose if the machine is broken into.
Currently I have them in a file on an encrypted filesystem, that I have to mount and enter the password for THAT, boot the app server, and unmount the filesystem.
Anyone have a better idea for storing the master key file???
I also have,... about 5% of my accounts as honey pot accounts, IF they are successfully signed into, I get an immediate alert, and I know SOMETHING was hacked.
Any other comments/criticisms welcome
So I'll outline what I have.
You sign in with a username and password, BUT if you opted in for 2 factor, my app is integrated with Twilio, so you send a txt message to the phone number containing just AUTH, it sends back a 5 digit code you must also use, which is only good for 5 minutes.
Before that password is sent, it's hashed with SHA512, combined with another hash of you username ( to avoid the Birthday Problem ), and key stretched a few times.
The login data is not sent in the body ( because I have compression on, and we have BEAST and CRIME, although I'm trying to avoid RC4 ), but my testing shows I have PFS/ECC available for most browsers that support it. ( I have an A grade from ssllabs.com )
So, I can honestly say that I have not seen the users plaintext password.
The server side of auth is rate limited ( Guava's RateLimiter ), but, to prevent timing based attacks, I record the start time, and throughout the day the average successful login time. If the login is not successful, the thread sleeps for the difference of duration to the average success time.
I also have some form of session ID rotation, IP tracking, etc, which I'm not going to detail here.
When the password is first created, I then use BCrypt, with the salt and users other information in not just different tables, but different databases.
Then it is encrypted, AES-256/PKCS, and I have many keys and salts, so there isn't just ONE AES key, if one key is compromised, the entire database is not. Which key/salt to use is based of a numeric hash of the users login ID and other information when they created their account.
BUT here is my issue. I need to store those AES keys SOMEWHERE. Somewhere secure, so that the keys can't be expose if the machine is broken into.
Currently I have them in a file on an encrypted filesystem, that I have to mount and enter the password for THAT, boot the app server, and unmount the filesystem.
Anyone have a better idea for storing the master key file???
I also have,... about 5% of my accounts as honey pot accounts, IF they are successfully signed into, I get an immediate alert, and I know SOMETHING was hacked.
Any other comments/criticisms welcome