Using the PHP functions openssl_pkey_new
and openssl_pkey_export
to generate an RSA key, how can one ensure the toughest password protection?
e.g.
$conf = array (
'digest_alg' => 'sha256',
'private_key_type' => OPENSSL_KEYTYPE_RSA,
'private_key_bits' => 2048,
'encrypt_key' => true,
);
$keypair = openssl_pkey_new( $conf );
openssl_pkey_export( $keypair, $keyout, 'foopass', $conf );
Komut satırından openssl kullanarak, ben şöyle TripleDESGiriş belirtebilirsiniz:
openssl genrsa -des3 -passout pass:foopass 2048