I am currently developing an application in HTML + JS based almost entirely on ajax connections (using jQuery.ajax() call to make the process easier).
I was thinking of best practices for making secure calls without using HTTPS (at least for the time being. I cannot afford to pay for a certificate right now).
At this moment, the only thing that concerns me is the steps of registering and entering the system. Maybe login is a little easier. I thought about sending the username and timestamp, and then encrypt them using the user password. . That way, I would not send any passwords (keeping secret as in OAuth). The server must verify the user, decrypt with a password, and pair the received timestamp with the decrypted result. The server must store the inconsistent number in the database (to avoid repeated attacks), and then return another unique identifier to the user (encrypted using the user's password). At this point, the user should start using this key to encrypt all of his information (and possibly another version of nonce) and send it to the server. Please correct me if you find any error or leak.
The biggest problem for me is registration. I cannot encrypt information using a regular password, because if I do this in javascript, anyone can find out the password. If I serve temporary generated passwords for encryption, and I send them from the server to the client, any sniffer can get it and use it to decrypt the information.
I know that HTTPS can save my life at this stage (and maybe this is the only solution), but at the moment I can not use it.
Is there any other solution, or should I wait until I can use HTTPS? Keep in mind that if I could miss the wait, it would be better. Thank you comrades!
source share