Tag Info

2

Libsodium is written/implementable in C++, C and Python. It implements lots of crypto systems, such as public key cryptography. Here is the intro in the docs: https://libsodium.gitbook.io/doc/

2

It's easier to take the questions out of order. what can be said about the distribution of exponents a+b mod p when b is taken at random from Zp, but a is fixed? If $b$ is a uniform independent random value from the range $[0, p-1]$, that is, the probability of each possible value is $1/p$, and $b$ is distributed independently from $a$, then $a+b \bmod p$...

2

As the output of the DH key exchange is a number, it has to be converted into big-endian bytes before running it through a hash - say SHA (SHA2 or SHA3) for example, can convert it into a key of the correct length. If you need variable-length keys, then you can use XOFs, which provide variable length outputs. This cannot increase the entropy of the result ...

1

To remain at the introductory level used in the question's reference¹, a simple (and not necessarily perfect) method: if the modulus used is large (hundreds of decimal digits) and significantly larger than the text to encrypt, the right part of the shared secret can be used as a key for a Vigenère cipher. With Vigenère, it is essential for confidentiality ...

1

Poly1305 itself has the requirement that its keys can only ever be used to generate a tag for a single message. That means that when Poly1305-AES (or another Poly1305-based authenticated encryption algorithm) is used as intended, the Poly1305 authentication key will be different for each message even if a key is reused. However, the various Poly1305-based ...

1

I think Crypto++ will help you. This is a cryptography library implemented in C++. Its homepage: Crypto++ Library.

Only top voted, non community-wiki answers of a minimum length are eligible