Report this

What is the reason for this report?

Unable to decrypt string with openssl_decrypt() error

Posted on April 20, 2021

I’m using LAMP on Ubuntu20.04 (1-Click LAMP Droplet).

When I use a link like this:

https://mydomain/sendy/confirm?e=TE3TnN892Q98UFZKeQULRsBA&l=763yDUk9HKBBhKPBG7JSP0JQ

I get the following error:

Unable to decrypt string with openssl_decrypt() 

My server’s openssl version is OpenSSL 1.1.1f 31 Mar 2020.

What am I doing wrong here? Do I need to configure Openssl?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Heya,

Just came across this answer and decided to write some general guidelines for anyone who comes across this in the future despite the old question.

The error you’re encountering is not specifically related to the version of OpenSSL installed on your server. It’s typically related to the encryption/decryption keys or method used in your application.

Make sure to check the following:

  • Encryption method: Ensure that the encryption method used in the openssl_encrypt() function in your application is the same as the one used in openssl_decrypt().
  • Secret keys: The secret key used to encrypt the data needs to be the same when decrypting.
  • Options: Check that the options provided to both encrypt and decrypt functions are the same.

If you are using any third-party software like Sendy, consult their documentation or contact their support for specific help.

For generic programming issues, StackOverflow can be a rich resource.

Lastly, here’s a link to DigitalOcean’s LAMP guide: How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 22.04.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.