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

Public key / Private key encryption using polkadot lib? #929

Closed
SachinSWN opened this issue Mar 19, 2021 · 5 comments
Closed

Public key / Private key encryption using polkadot lib? #929

SachinSWN opened this issue Mar 19, 2021 · 5 comments
Labels
Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance.

Comments

@SachinSWN
Copy link

I'm building a substrate blockchain backed by polkadot js. While working on a task I have a requirement of public/private key encryption and decryption. for ex: Bob wants to send Alice an encrypted email. To do this, Bob takes Alice's public key and encrypts his message to her. Then, when Alice receives the message, she takes the private key that is known only to her in order to decrypt the message from Bob. Does anyone know how this is done through Polkadot js library? Help will be appreciated!

@jacogr jacogr added the Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance. label Mar 19, 2021
@jacogr
Copy link
Member

jacogr commented Mar 19, 2021

@SachinSWN
Copy link
Author

Thank You..it was really helpful!

@SachinSWN SachinSWN reopened this Apr 2, 2021
@SachinSWN
Copy link
Author

SachinSWN commented Apr 2, 2021

without NaclBoxKeyPair, can we encrypt/decrypt message using the normal public key and private key pair which a nemonic already have ?
// Use the default validator to create new did
const keyring = new Keyring({ type: 'sr25519' });

@jacogr
Copy link
Member

jacogr commented Apr 5, 2021

No, there is no sr25519 exposed interfaces, see #633

@jacogr jacogr closed this as completed May 18, 2021
@polkadot-js-bot
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators May 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Support Tracks issues or requests related to troubleshooting, answering questions, and user assistance.
Projects
None yet
Development

No branches or pull requests

3 participants