Byte Array Format
Elliptic Curve Functions Usage
Authenticated Encryption Usage
Random Usage
Authenticated Encryption - Proper Usage of Encryption
Authenticated Encryption means only messages that have been encrypted with the key will be decrypted without an error in the decryption function, this means messages cannot be modified when intercepted (regular symmetric encryption does not grant this).
Replay Attacks
Authenticated encryption preventing modifying ciphertexts doesn't mean an attacker can't send a valid ciphertext twice or delay a sent ciphertext for some time. This can lead to undesirable consequences such as a second bank transfer or a delay in a message to a door lock program. Protection against replay attacks require more intricate APIs that deal with sending messages directly and other things such as nonces, timestamps or counters. Replay attack protection is outside of the scope of this API.
Other Functions
Finally, the API also includes (and makes use of) Anavrins' ChaCha20 and SHA-256.
Download
Note: you must either use dofile or require when loading the API.
Pastebin: ZGJGBJdg
Edited by PG23186706924, 25 April 2019 - 12:04 AM.