protected function canDecryptField(EntityInterface $entity, string $field): bool
    {
        if (!$this->getTable()->hasField($field)) {
            return false;
        }
        $decryptAll = $this->getConfig('decryptAll');
        if ($decryptAll === true) {
            return true;
        }

        $fields = $this->getFields();
        if (!isset($fields[$field])) {
            return false;
        }

        $decrypt = $fields[$field]['decrypt'];
        if (is_callable($decrypt)) {
            $decrypt = $decrypt($entity, $field);
        }

        return $decrypt;
    }