QuickCrypto class

QuickCrypto provides a set of utility methods for cryptographic operations.

This class contains static methods for generating random bytes, hashing data, and performing other cryptographic operations commonly used in various applications.

Constructors

QuickCrypto()

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 Properties

prng FortunaPRNG
field to hold the FortunaRandom instance for generating random numbers.
final

Static Methods

aesCbcDecrypt(List<int> key, List<int> data, {PaddingAlgorithm? paddingAlgorithm}) List<int>
Decrypt the input data using AES in Cipher Block Chaining (CBC) mode with the provided key. Optionally, specify the padding algorithm to be used.
aesCbcEncrypt(List<int> key, List<int> data, {PaddingAlgorithm? paddingAlgorithm}) List<int>
Encrypt the input data using AES in Cipher Block Chaining (CBC) mode with the provided key. Optionally, specify the padding algorithm to be used.
blake2b128Hash(List<int> data, {List<int>? key, List<int>? salt}) List<int>
Calculate the BLAKE2b-128 hash of the input data
blake2b160Hash(List<int> data, {List<int>? key, List<int>? salt}) List<int>
Calculate the BLAKE2b-160 hash of the input data
blake2b224Hash(List<int> data, {List<int>? key, List<int>? salt}) List<int>
Calculate the BLAKE2b-224 hash of the input data
blake2b256Hash(List<int> data, {List<int>? key, List<int>? salt}) List<int>
Calculate the BLAKE2b-256 hash of the input data
blake2b32Hash(List<int> data, {List<int>? key, List<int>? salt}) List<int>
Calculate the BLAKE2b-32 hash of the input data
blake2b40Hash(List<int> data, {List<int>? key, List<int>? salt}) List<int>
Calculate the BLAKE2b-40 hash of the input data
blake2b512Hash(List<int> data, {List<int>? key, List<int>? salt}) List<int>
Calculate the BLAKE2b-512 hash of the input data
chaCha20Poly1305Decrypt({required List<int> key, required List<int> nonce, required List<int> cipherText, List<int>? assocData}) List<int>
Decrypt data using the ChaCha20-Poly1305 authenticated encryption algorithm. Requires a key, nonce, ciphertext, and optional associated data.
chaCha20Poly1305Encrypt({required List<int> key, required List<int> nonce, required List<int> plainText, List<int>? assocData}) List<int>
Encrypt data using the ChaCha20-Poly1305 authenticated encryption algorithm. Requires a key, nonce, plaintext, and optional associated data.
generateRandom([int size = 32]) List<int>
This function generates a random List
hash160(List<int> data) List<int>
Calculate the RIPEMD-160 hash of the SHA-256 hash of the input data
hmacsha256Hash(List<int> key, List<int> data) List<int>
Calculate the HMAC-SHA-256 hash of the input data using the provided key
hmacSha512Hash(List<int> key, List<int> data) List<int>
Calculate the HMAC-SHA-512 hash of the input data using the provided key
hmacSha512HashHalves(List<int> key, List<int> data) Tuple<List<int>, List<int>>
Calculate the HMAC-SHA-512 hash of the input data using the provided key and split the result into two halves. Return a tuple containing both halves
keccack256Hash(List<int> data) List<int>
Calculate the Keccak-256 hash of the input data
pbkdf2DeriveKey({required List<int> password, required List<int> salt, required int iterations, HashFunc? hash, int? dklen}) List<int>
Derive a key from a password using PBKDF2 algorithm
processCtr({required List<int> key, required List<int> iv, required List<int> data}) List<int>
ripemd160Hash(List<int> data) List<int>
Calculate the RIPEMD-160 hash of the input data
setupRandom(GenerateRandom? random) → void
sha256DoubleHash(List<int> data) List<int>
Calculate the SHA-256 hash of the SHA-256 hash of the input data
sha256Hash(List<int> data) List<int>
Calculate the SHA-256 hash of the input data
sha3256Hash(List<int> data) List<int>
Calculate the SHA-3-256 hash of the input data
sha512256Hash(List<int> data) List<int>
Calculate the SHA-512/256 hash of the input data
sha512Hash(List<int> data) List<int>
Calculate the SHA-512 hash of the input data
sha512HashHalves(List<int> data) Tuple<List<int>, List<int>>
Computes the SHA512 hash of the input data and returns its halves.
twoX128(List<int> data) List<int>
twoX256(List<int> data) List<int>
twoX64(List<int> data) List<int>

Constants

blake2b32DigestSize → const int
Define the size of BLAKE2b-32 digests, which is 4 bytes (32 bits)
blake2b40DigestSize → const int
Define the size of BLAKE2b-40 digests, which is 5 bytes (40 bits)
blake2b128DigestSize → const int
Define the size of BLAKE2b-160 digests, which is 20 bytes (128 bits)
blake2b160DigestSize → const int
Define the size of BLAKE2b-160 digests, which is 20 bytes (160 bits)
blake2b224DigestSize → const int
Define the size of BLAKE2b-224 digests, which is 28 bytes (224 bits)
blake2b256DigestSize → const int
Define the size of BLAKE2b-256 digests, which is 32 bytes (256 bits)
blake2b512DigestSize → const int
Define the size of BLAKE2b-512 digests, which is 64 bytes (512 bits)
chacha20Polu1305Keysize → const int
Define the key size for ChaCha20-Poly1305, which is 32 bytes
chacha20Polu1305Taglenght → const int
Define the tag length for ChaCha20-Poly1305, which is 16 bytes
hash160DigestSize → const int
Define the size of RIPEMD-160 digests, which is 20 bytes (160 bits)
hmacSha512DigestSize → const int
Define the size of HMAC-SHA-512 digests, which is 64 bytes (512 bits)
sha256DigestSize → const int
Static property that defines the size of SHA-256 digests in bytes
sha512DeigestLength → const int
Gets the length of the SHA512 digest.
sha3256DigestSize → const int
Define the size of SHA-3-256 digests, which is 32 bytes (256 bits)
twoX64DigestSize → const int
twoX128DigestSize → const int
twoX256DigestSize → const int