This is a little encrypt function I made, attached below
encrypt.txt
Now, there are 3 arguments, encrypt(
string,
key,
buffer);
String can be anything from "foo" to "Hi there, I'm Chompy and this text is going to be encrypted".
Key is just an extra factor to the encryption, it can be whatever you want it to be
Buffer, this is the length of the string that you will get in return, can be any length, from 1 to 100 or more
Remember, the longer the arguments are, the longer it takes to encrypt, logical
anyways, some examples:
PHP Code:
function onCreated() {
echo(encrypt("foo", "bar", 8)); // FrvUqQuU
echo(encrypt("Hi there, I'm Chompy", "key", 8)); // lCAP4FFy
echo(encrypt("Hi there, I'm Chompy", "key", 6)); // YkI6IL
echo(encrypt("wee, I'm being encrypted!", "yep", 16)); // b845MaTRcmOG4EjC
echo(encrypt("baz", "bar", 24)); // 3hBPVspQmuKQ1PrAvuG4FmdL
echo(encrypt("foo", "foo", 10)); // 4KjCpuokgC
}
How effective it is,.. I don't know how to measure that, but it does the job.
If you find any bugs and such, feel free to post them :o