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

Prevent PHP Warning: openssl_decrypt(): IV passed is only x bytes lo… #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rickfu
Copy link

@rickfu rickfu commented Nov 25, 2023

…ng, cipher expects an IV of precisely 16 bytes, padding with \0

It is suspected that the since the openssl_random_pseudo_bytes(16) function returns raw binary data, it is introducing inconsistencies in the resultant string.

These changes base64 encode the iv and string separately, then reassemble them with a separator that allows for more predictable use of the iv during the decrypt function

…g, cipher expects an IV of precisely 16 bytes, padding with \0

It is suspected that the since the openssl_random_pseudo_bytes(16) function returns raw binary data, it is introducing inconsistencies in the resultant string.

These changes base64 encode the iv and string separately, then reassemble them with a separator that allows for more predictable use of the iv during the decrypt function
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

Successfully merging this pull request may close these issues.

None yet

1 participant