I've been searching for a solution to this problem for some time. I need a way to encrypt form data using JS. Then I need to be able to decrypt it using PHP. A public/private key system seems perfect, however I can't find any solutions or documentation on how to implement it. I really want to be able to implement this myself. I just need some resources to get me started.
And yes, I'm aware of SSL. Please don't remend it. I don't want to invest the money unless the site is a success.
An example of public key encryption then private key decryption in any language would be very helpful.
I've been searching for a solution to this problem for some time. I need a way to encrypt form data using JS. Then I need to be able to decrypt it using PHP. A public/private key system seems perfect, however I can't find any solutions or documentation on how to implement it. I really want to be able to implement this myself. I just need some resources to get me started.
And yes, I'm aware of SSL. Please don't remend it. I don't want to invest the money unless the site is a success.
An example of public key encryption then private key decryption in any language would be very helpful.
Share Improve this question edited Jul 9, 2012 at 15:57 Zombie asked Jul 9, 2012 at 15:50 ZombieZombie 1392 silver badges7 bronze badges 5- jcryption is one option (or rapidssl. $9.95/yr) – Alex K. Commented Jul 9, 2012 at 15:55
- First hit for "rsa javascript" + second hit for "rsa php" – lll Commented Jul 9, 2012 at 15:57
- You may have trust issues - if the information is really sensitive to your site users, then running it without SSL will seem pretty flaky. – Pointy Commented Jul 9, 2012 at 15:58
- The only way I know how to do this requires SSL. – Security Hound Commented Jul 9, 2012 at 15:58
- I'm not collecting credit card information or anything really "sensitive". I just want to give some additional privacy to users. And Leigh, the first was 100% JS second was 100% PHP - neither will work for me. Thank you though. – Zombie Commented Jul 9, 2012 at 16:04
2 Answers
Reset to default 1You could try symmetric encryption using RC4:-
https://gist.github./2185197
However, SSL is relatively cheap these days and would be far easier, more secure and less error prone than a roll-your-own solution so I really wouldn't just write it off because you want to save money, it will save you in the long run.
You could do this:
http://www.frostjedi./terra/dev/rsa/index.php
More info:
http://area51.phpbb./phpBB/viewtopic.php?f=84&t=33024&start=0