- 🇯🇵Japan ptmkenny
In EncryptionMethodInterface, this is the phpdoc for the decrypt method:
/** * Decrypt text. * * @param string $text * The text to be decrypted. * @param string $key * The key to decrypt the text with. * * @return string * The decrypted text * * @throws \Drupal\encrypt\Exception\EncryptException * Thrown when decryption fails. * @throws \Drupal\encrypt\Exception\EncryptionMethodCanNotDecryptException * The method should throw this exception when the plugin can not decrypt * (i.e. use a public key). */ public function decrypt($text, $key);
According to the interface, we have to return the decrypted text. So if you want to change this behavior, you need to make a feature request upstream with the Encrypt module. Once the interface is changed, then we can change the behavior here.