i am providing a php/mysql app for a customer who insists on keeping cc info in the data base. i realize the short answer to my question is, "don't". however...
a few pionts:
-i am using php4 on a remote server with mcrypt 2.4
-i am using the twofish cipher in CBC mode
-i store the key in an include file above DOCUMENT_ROOT in a directory inaccessible via URL in a
file inacessible via URL - the file is "require'd" from php files (not readable as text) in
directories and files which (obviously) are accessible via URL
-i base64 encode the encrypted data and store it in a varchar(64), and base64 decode the data prior to
decrypting. twofish/CBC produces 64 byte base64 data from 16 character credit card numbers.
-i use a wrapper class to manipulate mcrypt from Stone PHP SafeCrypt, Copyright (c) 2006, John
Haugeland, viewable at http://blog.sc.tri-bit.com/archives/101
-the set of possible modes is
cbc cfb ctr ecb ncfb nofb ofb stream
-the set of possible ciphers is
cast-128 gost rijndael-128 twofish arcfour cast-256 loki97
rijndael-192 saferplus wake blowfish-compat des rijndael-256
serpent xtea blowfish enigma rc2 tripledes
-the default cipher/mode in the Stone wrapper is twofixh/CBC
-the whole application is behind https
my question is, can someone with approp knowledge comment on the security of the method suggested above and/or suggest other ciphers, modes, or methodology to safely meet my customer's requirement?