Encrypt Post Data Before Submit and Decrypt it in Controller

Hi All,

I am trying to encrypt the form data before the form submission to secure the data without using the ssl. I got https://www.phpclasses.org/blog/package/9912/post/1-Encrypt-form-data-without-SSL-in-PHP.html and is working fine. But it seems it isn’t working in cakephp, if we decrypt it from the ctp file then it is working but it isn’t decrypt the values if we try to decrypt it from the controller. Did anyone use this class for the encryption? or anyone knows how we can encrypt the data before submitting the form? The above class is using the php openssl aes encryption/decryption method.

Thanks in advance.

Is there any reason you can’t use SSL? Generally it’s considered a bad idea to do browser-side encryption/decryption.

If you still want to go ahead, there are a number of javascript libraries that can handle the encryption/decryption on the user-end.

https://www.quora.com/What-are-some-of-the-best-client-side-encryption-libraries


Why no SSL? Thanks to lets encrypt it’s free to get a certificate. Client-side encryption is not secure at all (Since the encryption key needs to be sent to the client in order to be used)