Update codebase
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:math';
|
||||
import 'package:tripz_rider/env/env.dart';
|
||||
import 'package:siro_rider/env/env.dart';
|
||||
import 'package:encrypt/encrypt.dart' as encrypt;
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:secure_string_operations/secure_string_operations.dart';
|
||||
@@ -42,6 +42,15 @@ class EncryptionHelper {
|
||||
debugPrint("EncryptionHelper initialized successfully.");
|
||||
}
|
||||
|
||||
/// Encrypts a string using AES-256-CBC with constant IV (deterministic)
|
||||
/// Same input always produces the same output
|
||||
String encryptDataCbc(String plainText) {
|
||||
final cbcEncrypter =
|
||||
encrypt.Encrypter(encrypt.AES(key, mode: encrypt.AESMode.cbc));
|
||||
final encrypted = cbcEncrypter.encrypt(plainText, iv: iv);
|
||||
return encrypted.base64;
|
||||
}
|
||||
|
||||
/// ✅ FIX H-04: Encrypts a string using AES-256-GCM (new) with random IV
|
||||
String encryptData(String plainText) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user