Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use a specific algorithm #94

Open
rofl0r opened this issue Sep 13, 2020 · 7 comments
Open

how to use a specific algorithm #94

rofl0r opened this issue Sep 13, 2020 · 7 comments

Comments

@rofl0r
Copy link

rofl0r commented Sep 13, 2020

i'd like to use crypto_box_curve25519xsalsa20poly1305 so i know what i get, but it isn't provided.

@stef
Copy link
Owner

stef commented Sep 13, 2020

it's kinda organic, if people miss a function they most of the time add it themselves and i just merge it in. it's pretty easy, checkout this https://github.com/stef/pysodium/blob/master/pysodium/__init__.py - and also previous closed PRs are a good info source.

@jedisct1
Copy link
Contributor

It's already there and it's simply called crypto_box().

The full name crypto_box_curve25519xsalsa20poly1305 is just a deprecated alias for backward compatibility with the original NaCl API.

@rofl0r
Copy link
Author

rofl0r commented Sep 14, 2020

It's already there and it's simply called crypto_box().

no, it isn't. i want to use the full name of the API so if in 5 years a new algorithm is considered more secure and the default changed to point to that, my program will continue working because it explicitily calls crypto_box_curve25519xsalsa20poly1305.

@jedisct1
Copy link
Contributor

jedisct1 commented Sep 14, 2020

https://doc.libsodium.org/quickstart#shall-i-call-crypto_generichash_blake-2-b-or-just-crypto_generichash

What is more likely is that undocumented, low-level APIs like this one will eventually get removed.

@rofl0r
Copy link
Author

rofl0r commented Sep 14, 2020

What is more likely is that undocumented, low-level APIs like this one will eventually get removed.

if they'd do that, generated keys for the current "whatever-is-currently-standard" API would suddenly stop working. imagine if you'd lose the key to your bitcoin wallet due to such a change...
i suppose djb had a reason that e.g. tweetnacl ships with a huge header file that defines all these "undocumented, low-level APIs"

@jedisct1
Copy link
Contributor

Just use crypto_box (or, better, crypto_kx and an AEAD). It won't be changed to a different algorithm. All high-level APIs won't see breaking changes.

Anyway, the good news is that what you are asking already exists in PySodium.

@stef
Copy link
Owner

stef commented Dec 7, 2020

if you agree i'll close this issue next time i come across it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants