Skip to content

Conversation

@Eugeny
Copy link
Contributor

@Eugeny Eugeny commented Dec 29, 2024

This PR implements full support for PuTTY's version 2 and 3 key formats, including encryption and all supported key types.

Format documentation: https://tartarus.org/~simon/putty-snapshots/htmldoc/AppendixC.html#ppk

New code and deps are gated behind the ppk feature:

  • argon2 - decryption KDF
  • hmac - key MAC
  • hex - for parsing the embedded MAC

Keys are decrypted immediately on parse, as PPK can't be cleanly integrated into the KeyData::Encrypted architecture because the existing decryption code just assumes OpenSSH format. PPK's private key part does not include the key elements present in the public key and has both different order and format of the fields (except for DSA)

New code is mostly confined in a separate ppk.rs mod

Tests included

@Eugeny Eugeny changed the title Support for PPK key format ssh-key: support for reading PPK format private keys Dec 29, 2024
@baloo baloo merged commit 9764c7a into RustCrypto:master Feb 26, 2025
30 checks passed
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

Successfully merging this pull request may close these issues.

2 participants