1

I'm working on a Drupal 8 project. I want to send a link to the user via email and passing as parameters some user details that I want to encrypt. When the user clicks the link, I will get those encrypted data from URL and I will decrypt them.

After some research, I decided to use the Encrypt module.

I installed it, I added my key in settings.php, I also created a key in admin/config/system/keys, and now I'm trying to create an encryption profile, but the encryption method list is empty.

Is this the correct way to implement data encryption/decryption? If so, how can I get the encryption method list?

1 Answer 1

3

The Encrypt module provides an API, but no encryption methods. You'll need to install a module that provides one. I recommend the Real AES module

5
  • Actually, the project page says: The module is bundled with three encryption methods. So, the module does provide encryption methods.
    – avpaderno
    Commented Aug 30, 2017 at 11:01
  • @kiamlaluno, I suppose that applies to the 7.x version. The 8.x versions used to ship with Mcrypt only, but that has been deprecated and abandoned (?), so could very well have been removed. Real AES is a good and cryptographically safe alternative. (That means it is safe for passwords; depending on the nature of the data, this might be overkill and calculation heavy) Commented Aug 30, 2017 at 12:42
  • Yes, the information about bundled encryption methods applies to the 7.x version. There's been talk about including with 8.x a No Encryption method (which is one of the 7.x methods), so at least there's one method available, but you obviously wouldn't want to use it for anything but testing.
    – rlhawk
    Commented Aug 31, 2017 at 15:24
  • Real AES remains my current recommendation, though I did write the Sodium module, which is an alternative. It may become the preferred method at some point, since adoption of Libsodium is increasing; the library will be a core extension in PHP 7.2.
    – rlhawk
    Commented Aug 31, 2017 at 15:35
  • Thank you @rlhawk! That's exactly what I was looking for!
    – Ismini
    Commented Sep 7, 2017 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.