What type of OpenSSH key?

I have an example of a public key (I do not have the matching private key):

Although it looks like OpenSSH format, it is missing the first part which says what type of key it is (e.g. ssh-dss, ssh-rsa etc).

Is there any way of working out what type it is?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

This looks like an OpenSSH RSA or DSA key converted to RFC4716 (SSH2) format.

You can read this key with

ssh-keygen -i -f filename_of_keyfile

You will see on stdout the corresponding OpenSSH key, converted back from RFC4716. You will then be able to see the key format in the first few bytes (as you're already aware of).

If RFC4716 doesn't work (which I don't expect) try the other key formats like “PKCS8” (PEM PKCS8 public key) or “PEM” (PEM public key).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
clarisoAuthor Commented:
Thanks, but I can't read the file with that command.  I get either:

buffer_get_ret: trying to get more bytes 4 than in buffer 0
buffer_get_string_ret: cannot extract length
key_from_blob: can't read key type
decode blob failed.


input line too long.
I can read your key (just copy-and-paste via PuTTY) without any issue and get this:

ssh-dss AAAAB3NzaC1kc3MAAACAc/gsM3sPH0chLFpssmf28dORdPXkTNQy7ldi2A9QfQ5YA/k2Zufz9ZNY2x027sLkZi3rGpWBepwDXGz1RCVMJgwAa03Td3OuIAOq3rRkZ5TBYaXszYWFA6sQDOtErx7FRagCuODCPTVxqVqW9gA7qgy3XLK3eea8AxQdqCCwJ8EAAAAVAL4B9vIjLonmr+KcBqzj/KG0f4YFAAAAgDbeKXC+Lgb6iBX6mY8TG+kQbrbbiiJ7QD0Bi7PBorDpSsa7IDLOB0P4OhXK6sjY8rQkzdD7GRIwztwe+jkXtFJ+3hp650p/ITUZmLTWwHt+zobiyXIXmwZHF+GacaQKq5LDEafzOoMqA1RSuPlyHa/eUlaCCArw3v0OPTpPew0NAAAAgDW+aRNC8yciGm9N02jyumuiuBKaprVkRuaF/XbEKdnATRurNLAa9b/hmvgF9KjDbxnieqs3grhxLDP8lorrmhEa+EnblJVrKrUphOpFD8w/8Vm4YlZBhk0m/1wHw3S5K7KsFaEL91guq+B7b0hug7SjPk33YgKPHP0njxyYY5lK

I tried with OpenSSH_5.8p1 and OpenSSH_6.0p1. Both work.
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

clarisoAuthor Commented:
I've just tried the one I posted at the top, and it works for me too (using OpenSSH_6.2p2).  Others that I'm trying give the errors, such as:

(gives "input line too long")


(gives the buffer error)
I cannot convert them either. Those files might be corrupted or incomplete.

Both seem to contain (part of?) RFC4716  converted OpenSSH keys.
I tried the other key formats nonetheless, but they don't work (as expected).

Can you get new versions of the keys (perhaps by retransmitting them from where they originally came from)?

Besides that, I fear it will not be possible to repair those files, at least I don't know how it could be done.
clarisoAuthor Commented:
The strange thing is that they still work in our old SFTP software (CoreFTP), but our new software (Cerberus FTP) requires them to be proper OpenSSH keys (hence me needing to add the first bit on).
Therefore I don't believe they are corrupt.

Anybody else got any ideas?
clarisoAuthor Commented:
I think that for the ones which don't work, it was an issue with how they were transferred to my *nix box (which has the ssh-keygen application).
I'm all sorted now.

Many thanks for your help!
clarisoAuthor Commented:
The original post actually solved the problem, but issues my side prevented me from being able to use it!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SSH / Telnet Software

From novice to tech pro — start learning today.