I have a Html form. I want to get the file containing posted form's data instead of sending raw posted data to the server.
In brief, I want to decrypt the form's data client side (before sending to the server). Therefore, in man-in-the-middle scenario, listener could not understand it.
Step one should be serializing form's data on Submit button's click event. Then, I can decrypt data with a private key (which my client has it) and then send it to the server.
First of all, I want to know if sending a file containing encrypted data is more safe than posting an encrypted posted data or not? And if yes, is it possible?!
Edited: I can't use SSL!
That's what SSL is for. You could try hashing the data using JS but eventually you will find that the password/passphrase that is necessary for encryption, will need to be passed to the javascript. Since JS runs on the client and is not precompiled your passphrase will be plain-text in the file => not very secure. So unless you find a way to somehow pass a passphrase in a secure way, you would have to go with SSL