CryptoUtils mixin

Utility methods for cryptographic algorithms AES-CBC and HMAC-SHA256.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

aesCbc(Uint8List key, Uint8List iv, Uint8List sourceText, bool encrypt) Uint8List
Encrypts/Decrypts sourceText with symmetric key and initialization vector iv.
hmacSHA256Digest(Uint8List key, Uint8List data) Uint8List
Return HMAC-SHA256 digest of data for given secret key.
listEquals(List<int> list1, List<int> list2) bool
Compare 2 lists of integers element-by-element in constant-time.
pad(Uint8List bytes, int blockSizeBytes) Uint8List
PKCS7 padding before AES-CBC encryption.
secureRandomBytes(int length) Uint8List
Generate a Uint8List of random bytes of size length suitable for cryptographic use.
unpad(Uint8List bytes) Uint8List
PKCS7 unpadding after AES-CBC decryption.