GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Showing posts with label Security. Show all posts
Showing posts with label Security. Show all posts

Tuesday, May 17, 2011

SSL - Generate RSA Key

To simply generate rsa key to stdout in default 512
OpenSSL> genrsa
For 1024
OpenSSL> genrsa 1024
For saving it to file
OpenSSL> genrsa -out mykey.pem 1024

To generate public RSA key, use
OpenSSL> rsa -in mykey.pem -pubout

Read more on here
Share/Bookmark

OpenSSL Introduction

To encrypt a text file use:
OpenSSL> enc -base64 -in myfile.txt
or
OpenSSL> enc -base64 -in myfile.txt -out myfile.txt.enc
or just a test using pipe
D:\git\bin>echo "Hello World" | openssl enc -base64
To decrypt, use
OpenSSL> enc -base64 -d -in myfile.txt.enc
To decrypt from pipe, use
D:\git\bin>echo "encrypted" | openssl enc -base64 -d
Learn more on here
Share/Bookmark