Sunday, January 16, 2022

[FIXED] undefined method Cake\Utility\Security::cipher()

Issue

I am trying to create users management modal. I am using this code

      $encryptKey = 'ab12333way2code';
      $secret = Security::cipher('StringToEncrypt', $encryptKey);

But it's showing the following Fatal error

enter image description here


Solution

The method has been removed in CakePHP 3.0

Security::cipher() has been removed. It is insecure and promoted bad cryptographic practices. You should use Security::encrypt() instead.

https://book.cakephp.org/3.0/en/appendices/3-0-migration-guide.html#security



Answered By - jbe

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.