So if we look here, it shows that libsodium uses three 3 different algorithms for this, which sounds weird to me, cause nothing indicates that anything besides Curve25519 is used in those specific functions (the boxes specifically take private and public keys and nothing indicates there is any key generation for XSalsa20):


And if we look here, it is stated that the python implementation of this uses only Curve25519:


What is going on here?


1 Answer 1


The python docs only lists the public-key algorithm, not all algorithms it uses. Poly1305 and XSalsa20 aren't public-key algorithms, and thus aren't listed. PyNacl's docs are simply incomplete, it uses libsodium internally.

It's worth noting that Curve25519 is only ever used for key exchange (in the X25519), never directly for encryption. Ed25519 uses a curve birationally equivalent to Curve25519 for signatures. While it's possible to use Curve25519 in an ElGamal encryption system that's non-standard and not a very good idea.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.