Search code examples
phpopensslcryptographypublic-key-encryption

PHP Asymmetric encryption without external extension


I recently trying to find php function or class that can create asymmetric encryption without use any of php external libraries/extension so it will be portable to all PHP version or web server environment without any problem.

The problem that I have here because I can't find any of function/class that can do this operation.

So could someone can get me to the right direction ?

I know there are openssl function in PHP, but it is not portable and some work has to be done if I want to get it work on some environment like Windows OS.


Solution

  • You can try to look into phpseclib and simplier RSA implementation with pure php here

    But pure implementations won't be as fast as C/C++ and will need more resources. So it won't be effective using it on a big scale applications.