View Single Post
  #1  
Old 05-02-2008, 07:50 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
encrypt function

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
__________________
Reply With Quote