How to make PKCS5 and PKCS7 padding with openssl_public_encrypt
?
These are the options:
OPENSSL_PKCS1_PADDING
, OPENSSL_SSLV23_PADDING
, OPENSSL_PKCS1_OAEP_PADDING
, OPENSSL_NO_PADDING
How to make PKCS5 and PKCS7 padding with openssl_public_encrypt
?
These are the options:
OPENSSL_PKCS1_PADDING
, OPENSSL_SSLV23_PADDING
, OPENSSL_PKCS1_OAEP_PADDING
, OPENSSL_NO_PADDING
How to make PKCS5 and PKCS7 padding with openssl_public_encrypt?
openssl_public_encrypt
is used with asymmetric encryption (encrypting by public key) and indeed only the listed paddings are available.
PKCS7 padding is used with symmetric encryption (openssl_encrypt).
You can pkcs#7 padding with openssl_encrypt
documentation. Apparently (according to the comments) the pkcs#7 padding is used when no option is specified.
Seems in php you will have to it yourself, see How to add/remove PKCS7 padding from an AES encrypted string?
please note - I am not php developer, so if there's better way, please comment / correct.