Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes.... #280

Open
hasanuzzamanbe opened this issue Feb 16, 2025 · 0 comments

Comments

@hasanuzzamanbe
Copy link

Creating the IV manually needs to be 16 bytes long for algorithms like AES. Where the proper IV is not created throws a critical warning like this:
Warning: openssl_decrypt(): IV passed is only 12 bytes long, cipher expects an IV of precisely 16 bytes, padding with \0 in /var/www/frameme.org/wp-content/plugins/fluent-smtp/app/Functions/helpers.php on line 826

We just have to ensure the 16 bytes iv, we may use padding into it like this:

if (strlen($iv) < 16) {  
    $iv = str_pad($iv, 16, "\0");  // Pad with null bytes if it's shorter  
}  

Image
hasanuzzamanbe added a commit to hasanuzzamanbe/fluent-smtp that referenced this issue Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant