New encryption script of mine...

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

axilant

Account Closed
Impact
28
A while ago i posted a encryption script in PHP I now have a better way to do it ;P and i usually sell it to other programmers i know for $20 and here it is for free to np members! :P

PHP:
class ppc
{
function makepassword($len)
	{
		$s[0]=range("0","9");
		$s[1]=range("A","Z");
		$s[2]=range("a","z");
		$l=count($s);
		for($i=0;$i<$l;$i++){for($a=0;$a<count($s[$i]);$a++){$all[]=$s[$i][$a];}}
 		for($i=0;$i<$l;$i++){shuffle($s[$i]);$z[]=$s[$i][0];}
		for($i=$l;$i<$len;$i++){shuffle($all);$z[$i]=$all[0];}
    	shuffle($z);
    	return implode('',$z);		
	}
	function encrypt($string, $key)
	{
		for($i=1; $i<=strlen($string); $i++)
		{
			$char = substr($string, $i-1, 1);
			$keychar = substr($key, ($i % strlen($key))-1, 1);
			$char = chr(ord($char)+ord($keychar));
			$result.=$char;
		}
		return $result;
	}

	function decrypt($string, $key)
	{
		for($i=1; $i<=strlen($string); $i++)
		{
			$char = substr($string, $i-1, 1);
			$keychar = substr($key, ($i % strlen($key))-1, 1);
			$char = chr(ord($char)-ord($keychar));
			$result.=$char;
		}
		return $result;
	}
}

Example Use:

PHP:
$key = "^&$#^#@^%&#@^%#@!_&#@)$&)#@&^)#@&"; //i use a combo something like that ;P
$ppc = new ppc();
$text = $ppc->makepassword(8);
$encrypt = $ppc->encrypt($text, $key);
$decrypt = $ppc->decrypt($text, $key);
print("Encrypted: $encrypt<BR>Decrypted: $decrypt");

Any questions or comments, please post here or private me :)

Cody Selzer

P.S PPC stands for: PHP Print Crypt ;P
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Was looking for something related. I'll give it a try tomorrow
 
0
•••
Uh, pardon my stupidity, Cody, but...is the encryption script you put here for
encrypting PHP? HTML?

What's the main goal of it?
 
0
•••
encryption of a string, could be used to store passwords in a txt file that is encrypted. Or how i use it is to encrypt files when stored in mysql (saves some space)
 
0
•••
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back