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

node.forge and crypto #7

Open
richardschneider opened this issue Dec 6, 2017 · 6 comments
Open

node.forge and crypto #7

richardschneider opened this issue Dec 6, 2017 · 6 comments
Labels

Comments

@richardschneider
Copy link
Contributor

node-forge is being used because it supports PKCS 7 and 8. One major drawback is that it only uses RSA private keys.

libp2p-crypto should be enhanced to support PKCS 8 (encrypted private keys).

@daviddias
Copy link
Member

Yes, please always augment libp2p-crypto first rather than importing other crypto libraries.

@richardschneider
Copy link
Contributor Author

@diasdavid Rolling our own crypto is not recommened. libp2p-crypto should be a wrapper around crypto primitives. That said, PKCS 7 and 8 are not primitives and I agree with you.

@daviddias
Copy link
Member

libp2p-crypto should be a wrapper around crypto primitives.

It is what it is currently and I'm just encouraging to continue to be just that.

@richardschneider
Copy link
Contributor Author

richardschneider commented Dec 13, 2017

Keychain needs the following from a crypto library

  • ipfs key requirements
    • PKCS 1, RSA key generation
    • PKCS 5, PBKDF2 (derived password)
    • PKCS 8, Encryption/Decryption of private key with password (pem)
  • ipfs crypto requirements
    • PKCS 7, Create/Read CMS data
    • X.509, Create certificate for a key

It would be nice to have support for DSA, ECDSA, ed25519 key types.

@richardschneider
Copy link
Contributor Author

richardschneider commented Dec 14, 2017

@diasdavid I've searched npmjs and only found two packages that support PKCS 8 with a password; jsrsasign and node-forge.

"extracting PKCS 8 code" to add to libp2p-crypto is not practical. There are too many internal dependencies in both packages to make it easy.

@richardschneider
Copy link
Contributor Author

libp2p-crypto now supports PBKDF2.

daviddias pushed a commit that referenced this issue Jan 29, 2018
CMS - PKCS #7
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants