tokens->encryptValue($unencryptedData); } protected function decrypt(string $encryptedData): string { try { return Yii::$app->tokens->decryptValue($encryptedData); } catch (SodiumException|RangeException $e) { throw new LogicException($e->getMessage(), 0, $e); } } }