[advanced search]
Results from the most recent live auction are here.
12 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming > CODE
User Name
Password

Old 05-15-2004, 06:23 PM   · #1
axilant
Account Closed
 
axilant's Avatar
 
Name: Cody Selzer
Location: /etc/passwd
Trader Rating: (40)
Join Date: May 2004
Posts: 2,194
NP$: 0.00 (Donate)
axilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to behold
Member of the Month
July 2005
PHP Encryption Class

Code:
<?PHP /* How to use: $key = "PaSsWoRd"; $toencrypt = "Encrypt me!"; $crypt = new MD5Crypt; $en $crypt->Encrypt($toencrypt,$key); //encrypts but if i show you output, and you do the same exact words its probally going to be differnt. $de = $crypt->Decrypt($en,$key); makes the value of $toencrypt If you need any help with this just email me @ axilant07@yahoo.com or im me on AIM @ axilant */ class MD5Crypt{ function keyED($txt,$encrypt_key) { $encrypt_key = md5($encrypt_key); $ctr=0; $tmp = ""; for ($i=0;$i<strlen($txt);$i++){ if ($ctr==strlen($encrypt_key)) $ctr=0; $tmp.= substr($txt,$i,1) ^ substr($encrypt_key,$ctr,1); $ctr++; } return $tmp; } function Encrypt($txt,$key) { srand((double)microtime()*1000000); $encrypt_key = md5(rand(0,32000)); $ctr=0; $tmp = ""; for ($i=0;$i<strlen($txt);$i++) { if ($ctr==strlen($encrypt_key)) $ctr=0; $tmp.= substr($encrypt_key,$ctr,1) . (substr($txt,$i,1) ^ substr($encrypt_key,$ctr,1)); $ctr++; } return base64_encode($this->keyED($tmp,$key)); } function Decrypt($txt,$key) { $txt = $this->keyED(base64_decode($txt),$key); $tmp = ""; for ($i=0;$i<strlen($txt);$i++){ $md5 = substr($txt,$i,1); $i++; $tmp.= (substr($txt,$i,1) ^ $md5); } return $tmp; } function RandPass() { $randomPassword = ""; srand((double)microtime()*1000000); for($i=0;$i<8;$i++) { $randnumber = rand(48,120); while (($randnumber >= 58 && $randnumber <= 64) || ($randnumber >= 91 && $randnumber <= 96)) { $randnumber = rand(48,120); } $randomPassword .= chr($randnumber); } return $randomPassword; } } ?>


Please register or log-in into NamePros to hide ads
axilant is offline   Reply With Quote
Old 05-15-2004, 06:27 PM   · #2
e39m5
Senior Member
 
Trader Rating: (13)
Join Date: Apr 2004
Posts: 1,201
NP$: 178.05 (Donate)
e39m5 is a jewel in the roughe39m5 is a jewel in the roughe39m5 is a jewel in the rough
looks good, nice code
e39m5 is offline   Reply With Quote
Old 05-15-2004, 07:49 PM   · #3
axilant
Account Closed
 
axilant's Avatar
 
Name: Cody Selzer
Location: /etc/passwd
Trader Rating: (40)
Join Date: May 2004
Posts: 2,194
NP$: 0.00 (Donate)
axilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to behold
Member of the Month
July 2005
yea thanks i couldnt stand not being able to decrypt md5...
axilant is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


Site Sponsors
Find out how! http://www.mobisitetrader.com/ Exdon
Advertise your business at NamePros
All times are GMT -7. The time now is 06:13 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0