Page 1 of 1

Encrypting CreditCard Numbers

Posted: Tue Feb 04, 2003 11:53 am
by daven
I am setting up a ShoppingCart application, and I need to encrypt the credit card numbers (I have a thing about sticking plain-text CCs in a database).
Unfortunately, I do not have the MCrypt functions installed, nor can I get them (I do not have control over the server). Any ideas?

Posted: Tue Feb 04, 2003 12:30 pm
by nielsene
I suspect the answer is no, but do you have the openssl functions installed? While harder to use than mcrypt, the library does support a full suite of crypto-tools.

Does your database support encryption at the database level? How secure is your database?

What is your threat model? Are you worried about exposing CC# to local or remote users, etc?

Posted: Tue Feb 04, 2003 1:19 pm
by daven
I do have OpenSSL, since I beat the server admin until he gave me it. I did not know about the crypto tools in the library. I'll check them out.

Thanks.

Posted: Tue Feb 04, 2003 2:04 pm
by volka
if you're using mysql and the version does support it you may use some of the functions listed at http://www.mysql.com/doc/en/Miscellaneo ... tions.html
there are several encode/decode and encrypt/decrypt functions.

Posted: Tue Feb 04, 2003 8:22 pm
by Stoker
None of the mysql crypto options are providing any type of security if you are using a shared web hosting service, even if running suExec with private files I would never ever consider anything that can be decryprypted at the server as safe....

Unless you have a dedicated (or preferably two) and fairly hardened server(s), your only secure option is a public/private key type encryption, such as GnuPG, PGP or S/Mime (or whatever x509 stuff the S/mime stuff uses, I am not sure on the right terms there, OpenSSL supports S/Mime).

Posted: Tue Feb 04, 2003 9:06 pm
by volka
how would you store the private part of an public/private key mechanism more secure then the passphrase needed e.g. for mysql's aes_decrypt?

Posted: Tue Feb 04, 2003 9:56 pm
by Stoker
sorry about that, I didn't think of the new stuff in MySQL version 4, but as most web hosts still use version 3.23, and 4 is still not production-stable.. But yeah, that is right, MySQL 4 offers full DES,SHA, AES and others support..

And your are right that there would be no difference in how to store the keys, myself I would never store that in any format on a shared-hosting server, nor any server with user login accounts and such..

Posted: Wed Feb 05, 2003 6:55 am
by volka
of course you need a trustworthy host for that kind of action and I'm glad not to have to make that decision (lucky me).
And, yeah, msql4 support ist thinspread and even about the reliability of the new version I haven't found much (useful)