Urgent.News

the world's headlines, one feed

Editions

Tech

OpenSSH Key Structure Guide

Abstract editorial illustration

This guide aims to provide a comprehensive understanding of the key formats used by OpenSSH. The documentation's source, PROTOCOL.key, is somewhat lacking, so this document attempts to offer a more thorough and easily-understood presentation of the formats. Notably, private keys have been restructured in the v1 format, which is now the standard for newly created keys in recent OpenSSH versions.

The v1 format boasts several advantages over the older format, such as customizable key derivation and encryption ciphers, embedded public keys, and checksumming for encrypted keys verification.

RSA remains a widely-supported PKI system, although it is recommended to use newer systems like ED25519 for OpenSSH if all clients and destinations support them. According to RFC 8017, RSA key structures are referenced in single quotes. For a plaintext example of an RSA key, refer to the original source material.

Public keys in OpenSSH are typically stored in a packed binary format that is identical to the legacy format. RSA keys should be at least 4096 bits long for optimal security. Public keys are stored in a structure that is consistent with legacy private keys, also encoded in standard RSA PEM format.

The guide highlights the importance of using strong passphrases when encrypting private keys. The passphrase can significantly enhance the security of the encrypted key, as demonstrated by the examples provided. All other key types, including ED25519, are stored in a similar structure, with the addition of a passphrase for encryption when necessary.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — it may contain errors, so check the original before relying on it.

Read the original at sshref.dev →

More in Tech