secKeyDecryptedWithSek static method

String? secKeyDecryptedWithSek(
  1. Map<String, dynamic> hashMap
)

Implementation

static String? secKeyDecryptedWithSek(Map<String, dynamic> hashMap) {
  try {
    final iv = IV.fromUtf8(UFUtils.encryptionIV);
    final key = hexStringToByteArray(hashMap[HASH] as String);
    final toDecode = hexStringToByteArray(hashMap[SEK] as String);
    final encrypter = Encrypter(AES(Key(key), mode: AESMode.cbc));
    final decrypted = encrypter.decryptBytes(Encrypted(toDecode), iv: iv);
    return utf8.decode(decrypted);
  } catch (e) {
    return null;
  }
}