This is a mirror of official site: http://jasper-net.blogspot.com/

Store credit card number using openssl rsa(Encryption & Decryption)

| Wednesday, May 18, 2011
There are lots of ways to store credit card information in a datastore with the two way encryption method. I would like to share one with Openssl RSA-dse3 with 2048 bits. Lets start playing with it. 
#Requirements:
1) Openssl (yum install openssl) # centos flavor
# Now if need to create public and private key. Public key to decrypt and private key to encrypt.
* Create private key(Details: http://www.openssl.org/docs/apps/genrsa.html)
[root@localhost sudhir]# openssl genrsa -des3 -out private.pem 2048
Generating RSA private key, 2048 bit long modulus
..........................+++
......+++
e is 65537 (0x10001)
Enter pass phrase for private.pem:
Verifying - Enter pass phrase for private.pem:
[root@localhost sudhir]#
* View generated file

[root@localhost sudhir]# ls -la
drwxr-xr-x 2 root root 4096 Nov 24 21:03 .
drwxr-x--- 16 root root 4096 Nov 24 21:03 ..
-rw-r--r-- 1 root root 1751 Nov 24 21:04 private.pem

[root@localhost sudhir]#
* Check whats in private.pem file

[root@localhost sudhir] rvim ./private.pem
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,88831CE47DB54B21

Read more: Sudhir Chauhan

Posted via email from Jasper-net

0 comments: