To be clear: I'm by no means an expert, so take my advice with a huge grain
of salt (pun intended). But from what it seems, with no offense intended,
neither are you.

On Wed, Sep 20, 2023 at 10:32 AM Axel Wagner <axel.wagner...@googlemail.com>
wrote:

> As I understand it, ed25519 is using Curve25519 in EdDSA, which is a
> signing scheme. So using "ed25519" for encryption does not make any sense.
> NaCl also uses Curve25519, ultimately using ECDH (again, as I understand
> it) to establish a secret key for Salsa20. So it is pretty fundamentally
> different than ed25519.
> Note that golang.org/x/crypto/nacl *is* a pure Go package, not a
> libsodium wrapper. And yes, it's very likely what you want, if you want to
> use Curve25519 for encryption. Unless you want to roll your own
> cryptography, in which case, here be dragons. But the `crypto/ecdh` package
> (available since Go 1.20) would probably the primitive to look at.
>
> On Wed, Sep 20, 2023 at 10:02 AM christoph...@gmail.com <
> christophe.mees...@gmail.com> wrote:
>
>> Hello,
>>
>> I noticed that the go standard library only support ed25519 signing (
>> https://pkg.go.dev/crypto/ed25519@go1.21.1).
>>
>> I would need to encrypt a small secret with the public key of the
>> receiver so that he is the only one able to decrypt it with its private
>> key. The small secret would typically be a random symmetric key used to
>> encrypt the possibly long message.
>>
>> The only solution I found is to use nacl.Box (
>> https://pkg.go.dev/golang.org/x/crypto/nacl/box). Why is it so ?
>>
>> Are there alternative reliable go packages I could use ? I'll use only a
>> pure Go package, not a libsodium wrapper package.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/8018a90a-fae2-4c45-8c19-ed8b5c205319n%40googlegroups.com
>> <https://groups.google.com/d/msgid/golang-nuts/8018a90a-fae2-4c45-8c19-ed8b5c205319n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAEkBMfGUwCYsF%2BvDUf2VXfbOeTextJXiFTKjQrO9WLQuRmsQ_w%40mail.gmail.com.

Reply via email to