Welcome Guest, Not a member yet? Register   Sign In
Encrypter class error
#4

(08-12-2020, 05:22 AM)ebuoe Wrote:
(07-20-2020, 12:16 AM)zoom360 Wrote: I have used encrypter class:

Code:
$this->encrypter = \Config\Services::encrypter();

$abc = 'abc/def/ghi';
$encrypt = $this->encrypter->encrypt($abc);
$decrypt = $this->encrypter->decrypt($encrypt);
There is an error "authentication failed".


Hi , I had a similar problem , you have to load the default encryption configuration in the config folder this way:



PHP Code:
public function __construct(){

  $this->config    = new \Config\Encryption();      // load the configuration for the encryption service
  $this->encrypter = \Config\Services::encrypter($this->config); // start the encryption service



And then you can use $this->encrypter to encrcypt and decrypt, also ensure that OpenSSL is enabled in php.ini , I asked and found the solution to the same problem here
Thanks !
Reply


Messages In This Thread
Encrypter class error - by zoom360 - 07-20-2020, 12:16 AM
RE: Encrypter class error - by InsiteFX - 07-20-2020, 08:15 AM
RE: Encrypter class error - by ebuoe - 08-12-2020, 05:22 AM
RE: Encrypter class error - by zoom360 - 08-12-2020, 08:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB