SSH adds new defenses against side-channel attacks

Hardware vulnerabilities exposed in the past two years, such as Spectre, Meltdown, Rowhammer, and Rambleed, can be used to steal keys stored in memory by guessing and side channels. Today, the popular network transport encryption protocol SSH introduces the ability to defend against such vulnerabilities and protect keys stored in memory.

OpenSSH

Add protection for private keys at rest in RAM against speculation and memory sidechannel attacks like Spectre, Meltdown, Rowhammer and Rambleed. This change encrypts private keys when they are not in use with a symmetic key that is derived from a relatively large “prekey” consisting of random data (currently 16KB).

Attackers must recover the entire prekey with high accuracy before they can attempt to decrypt the shielded private key, but the current generation of attacks have bit error rates that, when applied cumulatively to the entire prekey, make this unlikely.

Implementation-wise, keys are encrypted “shielded” when loaded and then automatically and transparently unshielded when used for signatures or when being saved/serialised.