openssl_get_cipher_methods -- get per-cipher keylengths?
| From: | PGNet Dev | Date: | Thu, 13 Aug 2020 20:01:35 +0000 |
| Subject: | openssl_get_cipher_methods -- get per-cipher keylengths? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-327280@lists.php.net to get a copy of this message | ||
I'm deploying a php app that makes use of "openssl_get_cipher_methods"
Its config defaults to
$config['cipher_method'] = 'DES-EDE3-CBC';
and
$config['des_key'] = '123456789012345678901234';
where
"This key (generically named, 'des_key') is used to encrypt the users imap password
which is stored
in the session record. For the default cipher method it must be exactly 24 characters long."
The project recommends
$config['cipher_method'] = 'AES-256-CBC';
as a 'better option'. IIUC, as it uses "openssl_get_cipher_methods", additional
ciphers _are_ supported; as listed by
https://www.php.net/manual/en/function.openssl-get-cipher-methods.php
That list includes
[23] => aes-256-cbc
[32] => aes-256-gcm
[93] => chacha20-poly1305
What, if any, are current recommendations -- either specifically for php, or in the general case --
for cipher usage of 'aes-256-cbc' vs 'aes-256-gcm' ?
How are required php-config keylengths, in characters, determined for any available/usable cipher?
e.g., for 'chacha20-poly1305' ?