Information Security Stack Exchange is a question and answer site for information security professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have learned there are 2 methods to make SSH remote login easier and secure , those are;

  1. ssh generated keys (using ssh-keygen)OpenSSH Keys

  2. PEM (.pem) keys usually generated with OpenSSL (Amazon Web Services uses this method) OpenSSL

my question is that what are the differences of these 2 methods which one is more secure and why is it more secure ?

share|improve this question
Generate your SSH keys with openssl if you like. The only part that is special is the public key. – Zoredache Jan 30 '13 at 1:44
up vote 6 down vote accepted

The file format is different but they both encode the same kind of keys. Moreover, they are both generated with the same code: openssl (the command-line tool) is a wrapper around OpenSSL (the library), and OpenSSH actually uses OpenSSL (the library) for its cryptographic operations, including key pair generation. So there is no direct security difference.

We could argue a bit about password-based encryption of the private keys, but there is nothing really significant here.

share|improve this answer

Assuming you are generating same-size RSA keys for both, there is no difference other than file format. Using one or another will mean absolutely nothing in terms of their effect on security.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.