jedisct1 / libsodium

A modern, portable, easy to use crypto library.
https://libsodium.org
Other
12.15k stars 1.73k forks source link

single SK for crypto_sign() and crypto_box_*() #1000

Closed niXman closed 3 years ago

niXman commented 3 years ago

Hi,

in my app I need the possibility to sign the one type of messages using crypto_sign() and to crypt the another type of messages using crypto_box_*().

my question is, since crypto_sign_keypair() and crypto_box_keypair() both generate a private keys, can I use the same private key for both crypto_sign()/crypto_box_*() ?

how can I solve this task?

thanks!

jedisct1 commented 3 years ago

See

niXman commented 3 years ago

thank you, but I think we did not understand each other. I will try to explain.

there is a server that can respond to users with two types of responses: 1) signed (crypto_sign()) only. 2) encrypted (crypto_box_*()).

my question is, can I use the same PK/SK pair for both crypto_sign() and crypto_box_*() ?

thanks.

niXman commented 3 years ago
  • How can I sign and encrypt using the same key pair?

paraphrasing on my way it would sound like this: How can I sign **OR** encrypt using the same key pair?

jedisct1 commented 3 years ago

The title of the section has been changed from sign and encrypt to sign and/or encrypt. Thanks!

niXman commented 3 years ago

=)

jedisct1 commented 3 years ago

Reverted, it was actually more confusing :)

niXman commented 3 years ago

ok %)