Test of your OpenSSL setup

This page will help you to check your OpenSSL setup and to generate a private and public key pair.

The public and private keys are generated on the fly each time the page is loaded.

PHP Security library

', '', strip_tags($matches[2][$i]))); // Remove letter part in OpenSSL version if (!preg_match('/(\d+\.\d+\.\d+)/i', $fullVersion, $m)) { $versions[$matches[1][$i]] = $fullVersion; } else { $versions[$matches[1][$i]] = $m[0]; } } } echo "'; echo "'; echo "'; echo "'; echo "'; echo "'; echo "'; $rsa = new \phpseclib\Crypt\RSA(); echo "'; $rsa->setEncryptionMode(phpseclib\Crypt\RSA::ENCRYPTION_OAEP); $plaintext = 'Jorani is the best open source Leave Management System'; $rsa->loadKey($publicKey); $ciphertext = $rsa->encrypt($plaintext); $time_start = microtime(true); $rsa->loadKey($privateKey, phpseclib\Crypt\RSA::PRIVATE_FORMAT_PKCS1); echo "'; $time_end = microtime(true); $time = $time_end - $time_start; echo "'; if (function_exists('openssl_pkey_get_private')) { $time_start = microtime(true); $key = openssl_pkey_get_private($privateKey); openssl_private_decrypt($ciphertext, $message, $key, OPENSSL_PKCS1_OAEP_PADDING); echo "'; $time_end = microtime(true); $time = $time_end - $time_start; echo "'; } //Generate public and private keys for a single usage extract($rsa->createKey(KEY_SIZE)); ?>
Requirement Value / Description
PHP_VERSION" . (version_compare(PHP_VERSION, '4.2.0', '>=')? '>=4.2.0' : '<4.2.0') . '
openssl" . ((extension_loaded('openssl'))? 'extension loaded' : 'extension not loaded') . '
openssl_pkey_get_details" . ((function_exists('openssl_pkey_get_details'))? 'exists' : 'doesn\'t exist') . '
Private key" . (($privateKey!='')? 'Found' : 'Not found') . '
Public key" . (($publicKey!='')? 'Found' : 'Not found') . '
OpenSSL Library" . ((isset($versions['Library']))? $versions['Library'] : 'Not found') . '
OpenSSL Header" . ((isset($versions['Header']))? $versions['Header'] : 'Not found') . '
CRYPT_RSA_MODE" . ((CRYPT_RSA_MODE==1)? 'MODE_INTERNAL' : 'MODE_OPENSSL') . '
Decrypted message" . $rsa->decrypt($ciphertext) . '
Decryption speed (fallback)" . $time . '
Decrypted message" . $message . '
Decryption speed (native)" . $time . '

Private and public key pair

This section will help you to create assets/keys/private.pem and assets/keys/public.pem files. Beware that it is a pair of keys that must be set together (i.e. you must update the both files at the same time with the corresponding content).

Private Key

You can copy/paste the content below into assets/keys/private.pem.

Public Key

You can copy/paste the content below into assets/keys/public.pem.