Skip to content

Comment on OpenSSH Keys: A Walkthrough

Comments

Very clear and informative!

I got lost at this part, if anyone could clarify that would be great:

3. The key uses the PKCS#5 padding scheme: the last byte contains the number of padding bytes; e.g. if there are 5 bytes of padding, it contains 0x05. The last five bytes of the plaintext should then be 0x05 (something you should validate if you are decrypting the key yourself). If you decrypt the key above, you’ll see the last eight bytes are, in fact, 0x08.

The key is the MD5 of the combination of IV+pass, so how could the last byte of the key be controllable? The last two bytes shown are 532b, which is not 0x08? I must be missing some step that happens between getting the MD5 and this padding scheme.

The "key" in that sentence, the one that gets padded, is the (RSA) private key, not the AES key.

Got it, thanks!

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.