Is it possible to encrypt a message with a public key in PHP, then decrypt it with the private key in JS?
I've found a few different RSA encryption scripts for PHP and jQuery, but none of them seem to work both ways. Maybe i'm going about it all wrong, but basically i'm starting with: phpseclib-jsbn-rsa (https://github.com/mvhaen/phpseclib-jsbn-rsa) and i'm trying to reverse the process.
After a few searches I came accross this guy who seems to be trying to do the same thing: phpseclib/jsbn: encrypt with public key in PHP, decrypt with private key in jsbn .. But i've tried that code a few different ways and I can't get it to work.
I know that there are ways that I could achieve nearly the same thing using AES by just sharing a client generated key with the server through RSA. But is it possible to do what i'm trying to do?