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