User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 428,641 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,990 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 654 | Replies: 2
Reply
Join Date: Mar 2007
Location: RI
Posts: 146
Reputation: Dsiembab is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
Dsiembab's Avatar
Dsiembab Dsiembab is offline Offline
Junior Poster

sha1 md5

  #1  
Dec 7th, 2007
Good morning,
I am sure this has been asked before. So here it goes. I've been playing with these two php functions and was wondering if I have the logic right.
let's say I wrote a function called crazy encrypt
<?php
function crazyencrypt($password){
$is="isthis";
$overkill="overkill";
$pass = $password.$is;
$pass1=md5($pass).$is;
$pass2=sha1($pass1).$overkill;
$password=md5($pass2, true);
return $password;
}
?>
I mean what the function is doing is salting the hashes is this overkill though I mean I could write it like
function crazyencrypt($password){
$i = array("isthis", "overkill",md5, sha1,$pass, $pass1, $pass2, $password, true);
$i[4]=$i[7].$i[0];
$i[5]=$i[2]($i[4]).$i[0];
$i[6]=$i[3]($i[5]).$i[1];
$i[7]=$i[2]($i[6],$i[8]);
return $i[7];
}
could I make two arrays with the second code? Just playing around, this is how i learn
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 240
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: sha1 md5

  #2  
Dec 7th, 2007
Dang ! Do you really need this level of encryption ! But anyways, What do you mean by 2 arrays with 2nd code ?
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Mar 2007
Location: RI
Posts: 146
Reputation: Dsiembab is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
Dsiembab's Avatar
Dsiembab Dsiembab is offline Offline
Junior Poster

Re: sha1 md5

  #3  
Dec 7th, 2007
no just like to play with php. Putting the second part into an array
Last edited by Dsiembab : Dec 7th, 2007 at 2:08 pm.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 1:10 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC