Magento 2 – Fix SodiumChachaIetf::decrypt() Must Be of Type String, Boolean Error

helpermagento2magento2.3register

I did migration Magento 1 to Magento 2.3.0 all is good but when I create customer form both of side (front and admin) I got the error related to decrypt even I can not edit the customer when I click on save same error has occurred.

Below error is :

Fatal error: Uncaught TypeError: Return value of
Magento\Framework\Encryption\Adapter\SodiumChachaIetf::decrypt() must
be of the type string, boolean returned in
public_html/vendor/magento/framework/Encryption/Adapter/SodiumChachaIetf.php:68
Stack trace: #0
public_html/vendor/magento/framework/Encryption/Encryptor.php(358):
Magento\Framework\Encryption\Adapter\SodiumChachaIetf->decrypt('"\x10\x88\x8E\xB5\x851;H\xB1\x12\xE1aaP…')

#1 /public_html/vendor/dotmailer/dotmailer-magento2-extension/Helper/Data.php(744):
Magento\Framework\Encryption\Encryptor->decrypt('IhCIjrWFMTtIsRL…')

#2 /public_html/vendor/dotmailer/dotmailer-magento2-extension/Helper/Data.php(203):
Dotdigitalgroup\Email\Helper\Data->getApiPassword(Object(Magento\Store\Model\Website\Interceptor))

#3 public_html/vendor/dotmailer/dotmailer-magento2-extens
in

/public_html/vendor/magento/framework/Encryption/Adapter/SodiumChachaIetf.php on line 68

Best Answer

Go to Below file:

vendor/magento/framework/Encryption/Adapter/SodiumChachaIetf.php

And Update Below Code on decrypt() method:

$plainText = sodium_crypto_aead_chacha20poly1305_ietf_decrypt(
    $payload,
    $nonce,
    $nonce,
    $this->key
);

return $plainText ?: '';
Related Topic