What’s this upcoming “Encryption” component of Symfony 6.1?

You may say it’s to encrypt data. Yes. But no. Let’s clarify.

Alexandre Daubois
4 min readNov 30, 2021

Did you ever try to encrypt data with vanilla PHP? Well, I did (try), and I definitely don’t want to do it again. Let me explain.

One of the most famous library to do encryption with PHP is called OpenSSL. It does the job right, and it has been tried and tested for years, and even decades. The release date of this library is 1998, I was 2 years old at this time.

But here is the real deal, do you even know how to use properly? That’s the question I asked myself lately, because I had the need. Then I found the method openssl_encrypt of PHP. But what a (bad) surprise. Just take a look at the signature of this function:

openssl_encrypt method’s signature

I won’t show you the description of the each argument because it wouldn’t bring anything. But you can definitely see this function is from another time.

Well, brace yourself, Encryption component is coming and it’s an abstraction layer to these things!

As the component is being developed at the time these lines are written, some things

--

--