-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues decoding with PHP OpenSSL generated private key #37
Comments
resolves issue with OpenSSL private keys #37
Maybe my solution clarifies this issue The only problem I have is when I send a long text. i.e. If I use private_key_bits of 512 I can send I don't know why is that. It seems that the size of the data jsencrypt can send depends on the size of the key. On long strings JavaScript console reports: "Message too long for RSA" If someone find how to fix I'll appreciate a lot that information My working code is as follows:
|
Encryption works fine, and I can decrypt again in PHP using the private key. However, using a PHP5.5 private key, I'm unable to decrypt with JSEncrypt. PHP 5.4 generated private keys on my mac is able to decrypt with JSEncrypt however.
I do notice that the key no longer included RSA on the failing private keys (http://php.net/manual/en/function.openssl-pkey-export.php#101839)
Example Public Key:
Example Private Key:
Example of 'testing' encrypted:
I've attempted multiple key lengths etc but that makes no difference.
SSL VERSIONS:
WORKS WITH: OpenSSL 0.9.8za 5 Jun 2014
FAILS WITH: OpenSSL 1.0.1f 6 Jan 2014
The text was updated successfully, but these errors were encountered: