Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Asymmetric Encryption and Decryption #122

Closed
joaosantos15 opened this issue May 27, 2018 · 3 comments
Closed

Asymmetric Encryption and Decryption #122

joaosantos15 opened this issue May 27, 2018 · 3 comments
Labels
status/ready Ready to be worked

Comments

@joaosantos15
Copy link
Contributor

From what I understand, js-libp2p-crypto is the JS implementation of go-libp2p-crypto and uses the WebCrypto API whenever possible.
For asymmetric encryption/decryption, go-libp2p-crypto uses RSASSA-PKCS1-v1_5, which is only supported for digital signature by the WebCrypto API.
On the other hand, the only asymetric encryption supported by WebCrypto API is RSA-OAEP.

It would be nice to have RSA encryption in js-libp2p-crypto ☀️.

What would be the way to do it? Use the WebCrypto API's RSA-OAEP or implement go-libp2p-crypto's RSASSA-PKCS1-v1_5?
Thanks!

@daviddias daviddias added the status/ready Ready to be worked label May 29, 2018
@dignifiedquire
Copy link
Member

  • If we add RSA encryption, we want to match what go does for full interop.
  • Ideally we would add encryption and decryption to all supported key types in one go, but this is not a requirement.
  • we already use node-forge for some operations, so you could use it for doing the RSA encryption/decryption

@joshuaquek
Copy link

Oh hey @joaosantos15 , five months ago I developed this package that does decryption and encryption natively in Nodejs. Kind of a wrapper package that makes RSA Keypair encryption and encryption easier in terms of coding syntax:

https://github.com/joshuaquek/QuickEncrypt
https://www.npmjs.com/package/quick-encrypt

Not sure if it might be of help to you haha!

@achingbrain
Copy link
Member

Fixed in #125

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/ready Ready to be worked
Projects
None yet
Development

No branches or pull requests

5 participants