- constantTimeEq
Simple constant-time equality of two byte arrays. Used for security to avoid
timing attacks.
- copyOfRange
Copy the elements from the start to the end
- decryptString
AES CBC decrypt.
- encrypt
Generates a random IV and encrypts this plain text with the given key. Then
attaches a hashed MAC, w
- fixPrng
Ensures that the PRNG is fixed. Should be used before generating any keys. Will
only run once, and e
- generateIv
Creates a random Initialization Vector (IV) of IV_LENGTH_BYTES.
- generateKey
A function that generates random AES & HMAC keys and prints out exceptions but
doesn't throw them si
- generateKeyFromPassword
A function that generates password-based AES & HMAC keys. It prints out
exceptions but doesn't throw
- generateMac
Generate the mac based on HMAC_ALGORITHM
- keys
An aes key derived from a base64 encoded key. This does not generate the key.
It's not random or a P
- randomBytes