Where is the encryption based on if the string which should be encrypted is empty?
$string = ''; // empty string
$met_enc = 'aes256';
$key_enc = '1234';
$iv = '1234567891011121'; // 16 chars
$encryption = openssl_encrypt($string, $met_enc, $key_enc, 0, $iv); // encrypt string
$decryption = openssl_decrypt($encryption, $met_enc, $key_enc, 0, $iv); // decrypt string
echo 'Encrypted name: '.$encryption.'<br />';
echo 'Original name: '.$decryption.'<br />';
Code above outputs:
Encrypted name: NMPSQ1v5tCTFn9tazrsSQA==
Original name:
Can someone explain me where the encryption is generated from? Because the string is empty...