I'm using Composer and this is my first time trying to use phpseclib. I can't find the docs or any wiki about it, it's like there is no information.
I tried searching on stackoverflow but still couldn't get it to work.
This is my .php file:
<?php
require __DIR__ . '/../vendor/autoload.php';
$loader = new Composer\Autoload\ClassLoader();
$loader->addPsr4('phpseclib\\', __DIR__ . '/../vendor/phpseclib/');
$loader->register();
use phpseclib\Crypt\RSA;
$rsa = new Crypt_RSA();
$plaintext = 'terrafrost';
$rsa->loadKey($privatekey);
$signature = $rsa->sign($plaintext);
$rsa->loadKey($publickey);
echo $rsa->verify($plaintext, $signature) ? 'verified' : 'unverified';
?>
This is the error: [23-Mar-2020 14:04:51 UTC] PHP Fatal error: require(): Failed opening required '[23-Mar-2020 00:53:12 UTC] PHP Fatal error: Uncaught Error: Class 'Crypt_RSA' not found in /home/123/domains/asd.com/public_html/Auth/test.php:93
- This .php is located in: public_html/Auth
- Autoload is located in: public_html/vendor/autoload.php
- Composer folder is located in: public_html/vendor/composer
All I need to do is RSA signing and verifying. Also need to be able to generate a key pair for RSA too.
Please if there is any documentation or wiki about phpseclib tell me. I couldn't find anything on their Github. They link to this page Sourceforge but it's for 1.0, I only could find 1 example for 2.0. It's like the worst documented library I've ever seen.
If anyone knows a better library please tell me, I'm using this one instead of openssl because I need PSS padding.