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

Encryption with public key then decryption with private key #18

Closed
edubois opened this issue Mar 14, 2018 · 1 comment
Closed

Encryption with public key then decryption with private key #18

edubois opened this issue Mar 14, 2018 · 1 comment

Comments

@edubois
Copy link

edubois commented Mar 14, 2018

Hi again,

I read the doc, but I'm trying to do something customized.
I need:

  • Something so that I can encode with the PUB public key but can't decrypt the stream with the same PUB key.
  • When something is encrypted with the PUB key, it can be decrypted with the PRV private key.

I also need the reciprocity (something encoded with PRV is decryptable by the PUB)

Is it something I can do with your library?

Thanks,

@jedisct1
Copy link
Owner

Encrypting with your own public key is equivalent to symmetric encryption.

So I assume you want to encrypt using another party's public key instead, and that other party will use its private key to decrypt the content.

Use the Noise N variant: https://github.com/jedisct1/libhydrogen/wiki/N-variant to get a shared key. Encrypt using that shared key, and wipe that shared key. That shared key can be later recovered using the initiator's public key and the receiver's secret key.

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

2 participants