I had my SSH private key for a while now, but it used to be encrypted with a password that I since forgot.I re-encrypted it with my current password that still works, but now I have a problem:Whenever I try to use it for login at a remote machine (or anything really), i get the following error message from ssh:Load key /home/me/.ssh/id_rsa.pub: invalid formatThe password encryption still works and my password is correct. For example, when I try to change the password and enter a wrong password, I get$ ssh-keygen -p -f id_rsa.brokenEnter old passphrase: Failed to load key id_rsa.broken: incorrect passphrase supplied to decrypt private keyHowever, if I enter the correct password, I get:$ ssh-keygen -p -f id_rsa.brokenEnter old passphrase: Failed to load key id_rsa.broken: invalid formatThat's why I'm sure that the new password is correct. I also tried to process my Key using OpenSSL, but I get a lot of errors (at least with more detail):openssl rsa -text -in id_rsa.broken -out id_rsa.openssl-decryptEnter pass phrase for id_rsa.broken:unable to load Private Key140405067433728:error:0D07209B:asn1 encoding routines:ASN1_get_object:too long:crypto/asn1/asn1_lib.c:91:140405067433728:error:0D068066:asn1 encoding routines:asn1_check_tlen:bad object header:crypto/asn1/tasn_dec.c:1100:140405067433728:error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error:crypto/asn1/tasn_dec.c:274:Type=RSA140405067433728:error:04093004:rsa routines:old_rsa_priv_decode:RSA lib:crypto/rsa/rsa_ameth.c:72:140405067433728:error:0D07209B:asn1 encoding routines:ASN1_get_object:too long:crypto/asn1/asn1_lib.c:91:140405067433728:error:0D068066:asn1 encoding routines:asn1_check_tlen:bad object header:crypto/asn1/tasn_dec.c:1100:140405067433728:error:0D07803A:asn1 encoding routines:asn1_item_embed_d2i:nested asn1 error:crypto/asn1/tasn_dec.c:274:Type=PKCS8_PRIV_KEY_INFO140405067433728:error:0907B00D:PEM routines:PEM_read_bio_PrivateKey:ASN1 lib:crypto/pem/pem_pkey.c:86:My private key looks like this, and I can not see anything obviously wrong:-----BEGIN RSA PRIVATE KEY-----Proc-Type: 4,ENCRYPTEDDEK-Info: DES-EDE3-CBC,somehexvaluewith16digitssomeblockofcharacterswith24linesand64charactersperline-----END RSA PRIVATE KEY-----What I don't get is how this key got screwed up in the first place. I can guarantee that I did not do any manual editing when I changed my password. I'm pretty sure that all I ever used to edit it was the ssh-keygen program.Does anyone have an idea what could have gone wrong and how to get my key back?
OpenSSH private key screwed up: Load key: invalid format
ssh;openssl;ssh keygen