You can use CMS encryption (part of
https://datatracker.ietf.org/doc/html/rfc5652)
For example you can try https://github.com/mozilla-services/pkcs7
In CMS you use a public key to encrypt the generated intermediate
symmetric key (content encryption key) and the receiver can decrypt
this key and then decrypt content with it.


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.



-- 
Kind regards,
Alexey

-- 
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/CAMDzThjNmR2KWy16CXPEQ1ezrW0bkK3wVAWk4B7B6yReqXrvqQ%40mail.gmail.com.

Reply via email to