Thanks for the replies,
The idea with rot13 is not bad, at least it is a good beginning. I took a look at the description of the function in the manual, and I've already seen a little problem, it doesn't replace numbers.
But reading the comments on this function I found a comment by Cristof Pollenius:
//For versions of php <= 4.2.0 you can use:
function rot13($str){
if (!function_exists('str_rot13')) {
$from = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$to = 'nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM';
$rot13str = strtr($str, $from, $to);
}else{
$rot13str = str_rot13($str);
}
return $rot13str;
}
I had an idea.
To make it a little like normal encrypting methods one could define something like a "key" and an "initial vector", these could be any string string-alpha or whatever you would like to use.
Now one could combine both, key and iv by mixing them up somehow to one string chain, eg.
$key = "abcdefg";
$iv = "1234";
$conv_strings ="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPQqrRsStTuUvVwWxXyYzZ0123456789._?";
$mix = "1a2b3c4d1e2f3g";
The $conv_strings string contains all the strings you would like to have replaced.
Lets say you have the string "house", as you could see in the $conv_string the lowercase h takes position 15. Now start conting in the mix. Since the mix only contains 14 chars, start over counting => position 15 is equivalent to position 1 and position one is the char "1".
Now replace the "h" with the "1".
To make it a little more complicated we could use a third input parameter, namely $sc (start counting) which means "start counting at position $sc".
Well, this is just an idea, and I haven't tested it yet.
I think that something like this could be strong enough to keep users away from the data and a little stronger than just using rot13.
What do you think?
Best regards
gaucho
P.S.: OK, looked at this again and found a little problem, which ist if you start counting over, how would you know at "decrytion" time how many turns you took.