Jump to content

PG23186706924's Content

There have been 1 items by PG23186706924 (Search limited from 04-December 20)

By content type

See this member's

Sort by                Order  

#278930 Elliptic Curve Cryptography

Posted by PG23186706924 on 09 April 2019 - 11:59 PM in Programs

Hey it's me again. I'm back with another approach to public key cryptography, elliptic curve cryptography. ECC has smaller keys and is faster than RSA and regular Diffie-Hellman. This API implements the ECDH key exchange, EdDSA-like digital signatures, a pseudorandom byte generator as well as authenticated symmetric cryptography.

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.

Note: you must either use dofile or require when loading the API.
Pastebin: ZGJGBJdg