1. Go to this page and download the library: Download kare/kare_enc library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kare / kare_enc example snippets
use kare\kare_enc\RSA as RSA;
$keyPair = RSA::generateKeyPair(); //generates a RSA key pair of bit-length 2048 - default key length
$keyPair = RSA::generateKeyPair(4096); //generates a RSA key pair of bit-length 4096
$pubKey = $keyPair['publicKey']; // get the public component
$pvtKey = $keyPair['privateKey']; // get the private component
$pubKeyString = "-----BEGIN PUBLIC KEY-----\nMIIBITANBgkqhkiG9w0BAQEFAAOCAQ4AMIIBCQKCAQBGIdM1Sg1AEV7fR2auPild\nd+YQKkhzm0AbFPesm/ZaB7cSnfCbb9KhxSH63JVsJvK9mAT4r8ctmbKHTLkwLx6m\nw652g1Px7qDHAvQghkoXlsRjE2CvuiIx1hAdp9QezkFaNB5yutHhOs6PJGVOnG/0\nzaQJ3516vtFV6PyJe/KWTvVs5FeqaJMWi4UjOgm71q7V6/rY+cP64xplF4lZPN6v\n2RtsM/wxz2pr+rLvIMbNoX2y8RWRYRM3NWlE9dCrfh4aul6tGPdATXutgaYXHDRT\nGL7FxPrPI63RgsNSqxyXVq1J8ccStnuB9QQ/7YbIArMf+z6FLEm32kIokn1yBQ5R\nAgMBAAE=\n-----END PUBLIC KEY-----";
$pubKey = RSA::importPrivateKeyString($pubKeyString);