| No Comments | No TrackBacks
RSA Public Key / Private Key Encryption with OpenSSL

You can do RSA (and DSA actually) on most unix systems without any additional software... No GPG/PGP required. It's less than obvious however, as I couldn't find any documentation that puts this all in one place. So here it is...

Generate a new private key:

openssl genrsa -out test.priv_key

Generate the public key for this private key:

openssl rsa -in test.priv_key -pubout -out test.pub_key

RSA encrypt a block:

openssl rsautl -sign -inkey test.priv_key -pkcs -out test.sig

Decrypt an RSA block:

openssl rsautl -verify -in test.sig -inkey test.pub_key -pubin

You can also sign a block using MD5:

openssl md5 | openssl rsautl -sign -inkey test.priv_key -pkcs -out test.sig

No TrackBacks

TrackBack URL:

Leave a comment



Monthly Archives


About this Entry

This page contains a single entry by Robert W. Rose published on November 14, 2004 1:24 AM.

was the previous entry in this blog.

is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.