R
Rob
Hi All;
I've come up with a solution and I'd like some feedback on whether or
not it is secure.
SYNOPSIS: Is Crypt::RSA secure acceptable in open source if the
private key password is in a browser cookie?
DETAILS:
We're running a pretty basic LAMPS system with MySQL 5.1 and Perl 5.8.
The client asked me to devise "a secure way to save credit card
numbers in the sales database". Every paper I've read recommends
saving the card numbers off site or not at all, but in this case the
the client is a middle-man who collects the sales information
(including card numbers) in one place, and needs to pull up the entire
customer record including card data in a back-office setting using a
secure server.
Most encryption and decryption schemas I came up with had the same
problem -- open source. Any method that would encrypt the data in
MySQL and be decrypted by Perl could be read if someone were to gain
access to the server. The MySQL login script could also be read in
open source, so I feared that no matter how well we encrypted the
data, a hacker would only have to follow the script to gain access to
thousands of card numbers.
The staff members will be opening hundreds of orders per day, and they
need the encryption to be fast and transparent with no inconvenience
at all to the legitimate users.
Here is the solution I came up with:
1. Using Crypt::RSA I created a 256 bit public and private key with a
63 character password. Both keys are saved on the server, but the
password is not.
2. The credit card number is a blob field. When a new order is
entered, it is encrypted with the public key and saved.
3. Authorized users will use a JavaScript page to set a cookie with
the private key's password. It will be a session only cookie, which is
removed automatically when the user logs out of the database
interface.
4. If the cookie is present, the script will use its value to open the
private key and display the card info. Otherwise, it only displays
************.
I believe that this solution is secure because the private key
password is never saved on the server. A hacker would have to gain
access to an authorized user's PC to gain the password. I am not sure
how difficult it is to crack a 256 bit private key with a 63 character
pass. There is plenty of documentation on how hard it is to brute
force the entire key, but not much I could find on the password.
If you can see a security hole with this method, please reply.
Thanks,
Rob
I've come up with a solution and I'd like some feedback on whether or
not it is secure.
SYNOPSIS: Is Crypt::RSA secure acceptable in open source if the
private key password is in a browser cookie?
DETAILS:
We're running a pretty basic LAMPS system with MySQL 5.1 and Perl 5.8.
The client asked me to devise "a secure way to save credit card
numbers in the sales database". Every paper I've read recommends
saving the card numbers off site or not at all, but in this case the
the client is a middle-man who collects the sales information
(including card numbers) in one place, and needs to pull up the entire
customer record including card data in a back-office setting using a
secure server.
Most encryption and decryption schemas I came up with had the same
problem -- open source. Any method that would encrypt the data in
MySQL and be decrypted by Perl could be read if someone were to gain
access to the server. The MySQL login script could also be read in
open source, so I feared that no matter how well we encrypted the
data, a hacker would only have to follow the script to gain access to
thousands of card numbers.
The staff members will be opening hundreds of orders per day, and they
need the encryption to be fast and transparent with no inconvenience
at all to the legitimate users.
Here is the solution I came up with:
1. Using Crypt::RSA I created a 256 bit public and private key with a
63 character password. Both keys are saved on the server, but the
password is not.
2. The credit card number is a blob field. When a new order is
entered, it is encrypted with the public key and saved.
3. Authorized users will use a JavaScript page to set a cookie with
the private key's password. It will be a session only cookie, which is
removed automatically when the user logs out of the database
interface.
4. If the cookie is present, the script will use its value to open the
private key and display the card info. Otherwise, it only displays
************.
I believe that this solution is secure because the private key
password is never saved on the server. A hacker would have to gain
access to an authorized user's PC to gain the password. I am not sure
how difficult it is to crack a 256 bit private key with a 63 character
pass. There is plenty of documentation on how hard it is to brute
force the entire key, but not much I could find on the password.
If you can see a security hole with this method, please reply.
Thanks,
Rob