-
Notifications
You must be signed in to change notification settings - Fork 139
pkcs5 encryption + pkcs8 decryption #293
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
Conversation
Note: this initial draft is encryption only, but it manages to pass OpenSSL-generated test vectors! 🎉 The I'd like to wait until we release All that said, I can probably finish out adding things like encryption support as well as integrating this functionality with the |
aa8c99b
to
2f4f74f
Compare
Implements PKCS#5 encryption support, presently targeting only support for PBES2 with PBKDF2-SHA-256 and AES-CBC (with 128 or 256-bit key size) Note that these are presently the best options supported by PKCS#5 v2.1. Support for legacy algorithms like DES, 3DES, MD2, and SHA-1 is deliberately ommitted. We can revisit potentially adding these upon request if there is demand, however since these algorithms are insecure we don't support them in this initial implementation.
2f4f74f
to
f494da9
Compare
An MSRV change is breaking anyway, so we can use the latest released crates for now, and then bump them after the next release along with MSRV.
f494da9
to
ff44ba6
Compare
Due to the MSRV bump, I backpedaled on using the latest prerelease The upgrade is simple and I'd like to cut another breaking I'm pretty close to finishing this out and can cut an initial release with support, then we can circle back on the MSRV bump and crate upgrades. |
b09c565
to
7681f45
Compare
Following up on #293 which added PKCS#8 decryption support, this adds the corresponding support for encrypting `PrivateKeyInfo` as `EncryptedPrivateKeyInfo`. It provides a simple API which generates a random salt and IV using a provided `CryptoRng`, then uses PBES2 with PBKDF2-SHA256 and AES-256-CBC. It also provides a paramaterized `encrypt_with_params` which allows for supplying a `pbes2::Parameters` structure.
Following up on #293 which added PKCS#8 decryption support, this adds the corresponding support for encrypting `PrivateKeyInfo` as `EncryptedPrivateKeyInfo`. It provides a simple API which generates a random salt and IV using a provided `CryptoRng`, then uses PBES2 with PBKDF2-SHA256 and AES-256-CBC. It also provides a paramaterized `encrypt_with_params` which allows for supplying a `pbes2::Parameters` structure.
Following up on #293 which added PKCS#8 decryption support, this adds the corresponding support for encrypting `PrivateKeyInfo` as `EncryptedPrivateKeyInfo`. It provides a simple API which generates a random salt and IV using a provided `CryptoRng`, then uses PBES2 with PBKDF2-SHA256 and AES-256-CBC. It also provides a paramaterized `encrypt_with_params` which allows for supplying a `pbes2::Parameters` structure.
Implements PKCS#5 encryption support, presently targeting only support for PBES2 with PBKDF2-SHA-256 and AES-CBC (with 128 or 256-bit key size).
Note that these algorithm choices are presently the best options supported by PKCS#5 v2.1.
Closes #263