My application should send encrypted data via POST to a PHP server.
In PHP there are two functions for dealing with rsa public and private keys:
openssl_public_encrypt: Encrypts some text with a public key generated from a private key.
openssl_private_decrypt: Decrypts the encrypted text with the private key.
I want my Ionic 2 application (Client) to encrypt in a equivalent way to what
openssl_public_encrypt does, so that the server’s
openssl_private_decrypt can decrypt it.
For openssl in Ionic 2 I only found
JSEncrypt, which encrypts with a public key, but the result of its method in not “understood” by the PHP decryption function.
Am I doing the wrong process?
How is this kind of cryptography usually dealt with in Ionic 2?
Thanks in advance!