Difference between revisions of "Linux openssl"

From John Freier
Jump to: navigation, search
(Created page with ' == Description == The way public/private keys work, is a public key is used to encrypt data and only a private key is capable of decrypting it. Public Key -> Encrypt. Private …')
 
Line 1: Line 1:
 
 
== Description ==
 
== Description ==
 
The way public/private keys work, is a public key is used to encrypt data and only a private key is capable of decrypting it.
 
The way public/private keys work, is a public key is used to encrypt data and only a private key is capable of decrypting it.
Line 10: Line 9:
  
 
This is a real example of public private key.
 
This is a real example of public private key.
 +
 +
== Create a public & private key. ==
 +
 +
Create a private key.
 +
  openssl genrsa -out mykey.pem 1024
 +
 +
Create a public key.
 +
  openssl rsa -in mykey.pem -pubout > mykey.pub
 +
This will extract the public key from the private key.

Revision as of 16:03, 17 November 2014

Description

The way public/private keys work, is a public key is used to encrypt data and only a private key is capable of decrypting it.

Public Key -> Encrypt.

Private Key -> Decrypt.

Example

This is a real example of public private key.

Create a public & private key.

Create a private key.

 openssl genrsa -out mykey.pem 1024

Create a public key.

 openssl rsa -in mykey.pem -pubout > mykey.pub

This will extract the public key from the private key.