Skip to content
Advertisement

phpseclib loadKey works on mac, not on CentOS

I am attempting to load a hardcoded (for the sake of testing) RSA public key in phpseclib (stable version 0.3.10). This code works perfectly correctly when run locally on my Mac and spits back out the key I entered:

JavaScript

However when I push it to an AWS instance running CentOS, the loadKey call returns false. I’m not seeing any other error notifications to tell me what went wrong. Any ideas what the issue could be? Some dependency not installed?

Advertisement

Answer

The issue is from having mbstring function overloading enabled on the CentOS server but not locally, which is breaking some of the binary data comparisons. I’ll need to find a way around that when performing the encryption.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement