Forum Moderators: coopster
thanks for all the input,
jeff
function encrypt($string, $key) {
$result = '';
for($i=0; $i<strlen($string); $i++) {
$char = substr($string, $i, 1);
$keychar = substr($key, ($i % strlen($key))-1, 1);
$char = chr(ord($char)+ord($keychar));
$result.=$char;
}
return base64_encode($result);
}
function decrypt($string, $key) {
$result = '';
$string = base64_decode($string);
for($i=0; $i<strlen($string); $i++) {
$char = substr($string, $i, 1);
$keychar = substr($key, ($i % strlen($key))-1, 1);
$char = chr(ord($char)-ord($keychar));
$result.=$char;
}
return $result;
}
>> The only really private thing is clients names.
if you store addresses, emails or anything else that pertains specifically to these customers then that qualifies as well.
if the decrypt function is stored on the same server as the encrypted data then it isn't really secure.
do you have https? if not then this data is sent over an unencrypted connection and that is an issue.
Nothing is ever truly secure, though using one way encryption such as MD5 for passwords is an accepted standard (yes, I know MD5 can be cracked too). So using MD5 to encrypt the password before you put it in the db is fine. Then have a forgot password that generates a new password and forces them to change it on next login would be acceptable.
we have some library [webmasterworld.com] threads that might be of interest
PHP User Authentication and Passwords [webmasterworld.com]
PHP Security [webmasterworld.com]
/* The SimpleXor encryption algorithm **
** NOTE: This is a placeholder really. Future releases of $$$ Form will use AES or TwoFish. Proper encryption **
** This simple function and the Base64 will deter script kiddies and prevent the "View Source" type tampering **
** It won't stop a half decent hacker though, but the most they could do is change the amount field to something **
** else, so provided the vendor checks the reports and compares amounts, there is no harm done. It's still **
** more secure than the other PSPs who don't both encrypting their forms at all */
When handling personal data of any description you can never be to careful.