Home » » openssl_private_decrypt

openssl_private_decrypt

Written By 1 on Tuesday, October 2, 2012 | 10:21 AM

bool openssl_private_decrypt ( string $data , string &$decrypted , mixed $key [, int $padding = OPENSSL_PKCS1_PADDING ] )
Decrypts data with private key
openssl_private_decrypt() decrypts data that was previous encrypted via openssl_public_encrypt() and stores the result into decrypted.

When used with RSA, this function only accepts a single block. Block size is equal to the RSA key size - i. e., with a 1024-bit key, block size should be 128 bytes. Depending on the padding scheme, the payload may be even smaller. The padding is removed, so you'll receive the ready to use plaintext. Blocking logic is up to the caller, though.

0 Comment:

Post a Comment