What type of OpenSSH key?

I have an example of a public key (I do not have the matching private key):
AAAAB3NzaC1kc3MAAACAc/gsM3sPH0chLFpssmf28dORdPXkTNQy7ldi2A9QfQ5YA/k2Zufz9ZNY2x027sLkZi3rGpWBepwDXGz1RCVMJgwAa03Td3OuIAOq3rRkZ5TBYaXszYWFA6sQDOtErx7FRagCuODCPTVxqVqW9gA7qgy3XLK3eea8AxQdqCCwJ8EAAAAVAL4B9vIjLonmr+KcBqzj/KG0f4YFAAAAgDbeKXC+Lgb6iBX6mY8TG+kQbrbbiiJ7QD0Bi7PBorDpSsa7IDLOB0P4OhXK6sjY8rQkzdD7GRIwztwe+jkXtFJ+3hp650p/ITUZmLTWwHt+zobiyXIXmwZHF+GacaQKq5LDEafzOoMqA1RSuPlyHa/eUlaCCArw3v0OPTpPew0NAAAAgDW+aRNC8yciGm9N02jyumuiuBKaprVkRuaF/XbEKdnATRurNLAa9b/hmvgF9KjDbxnieqs3grhxLDP8lorrmhEa+EnblJVrKrUphOpFD8w/8Vm4YlZBhk0m/1wHw3S5K7KsFaEL91guq+B7b0hug7SjPk33YgKPHP0njxyYY5lK

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?
clarisoAsked:
Who is Participating?

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

x
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.

woolmilkporcCommented:
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.

or

input line too long.
woolmilkporcCommented:
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:

AAAAB3NzaC1kc3MAA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(gives "input line too long")

and

AAAAB3NzaC1yc2EAAAABIwAAAQEAmPvRVRtjLtEIrshnXLw5DszWEKhjpZXoyV8KCun+uy9Y90zjIm8uqCnlfdxfSPzG7dpm4PoUYqQ0mEN6NMk1DGtwkVIh9xtQK6pvm9zLDvgRU7N0RT+oOmAQEIiwn+gg8OiC0y8PsQUm5zfABHYST68MzOypdSZ87za+8voTpSEIRGHlzE9dEFwSkrZ6+AHil/ZcjjT/A0r5KQ9LIgkR10Q1ShBie7vGPlg8bUQD6ZHO3t0xYVwVRfNTWPUCnR/ExHaxoqFCuJ+kv+Am2HTuWNPEJiczcqrcdhlfBgg44eM+fH8ZvlbOehleYR37wclBSPDurrj4PBZX239HUsNx5w==
(gives the buffer error)
woolmilkporcCommented:
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.