I (for a test) just randomly altered a private RSA key by opening it up in Vim and changing a few bytes. It is the private part of an SSH key pair used for logging in on a remote system. Puzzlingly, it still allows me to login.
I did some research and found that it is a base64 encoded ASN.1 container, so I pulled all the relevant integers out with OpenSSL and it seems only $d$, the private exponent, has changed (and only slightly at that). Is it possible the additional cached values are therefore being used to decrypt the value sent from the server, in order to still allow me to be logging in? The public key can (as expected) still be derived due to the other integers in the ASN.1 still being the same.
As I'm an encryption dufus I'd appreciate some guidance on how the above is possible. I've found when I modify the key in Vim by larger amounts it rejects me as expected. Thanks.
d
, private exponent without changing other parameters, you will lose the original properties of the whole key pair. Check how is thed
argument generated. Anyway quite interesting topic. Can you share the keys (or create similar) to reproduce the case? $\endgroup$ – Jakuje Jan 9 '16 at 19:33ssh -v host
. Isn't there a DSA-key too by chance? $\endgroup$ – ott-- Jan 10 '16 at 7:20