TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-26-2008, 09:57 PM   #1 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Default new challenge!!

heres another great challenge for you all.

create a simple hash algorithm that can be used to encrypt a string
who knows your hash can be the next famous one.
make sure it cant be reverted.
__________________
no signature set
sarmenhb is offline  
Reply With Quote
Old 01-26-2008, 10:34 PM   #2 (permalink)
The Acquainted
 
sjaq's Avatar
 
Join Date: Nov 2007
Location: Netherlands
Posts: 113
Thanks: 11
sjaq is on a distinguished road
Default

Creating a hash algorithm isn't that easy, so I don't think this thread is going to produce one..
sjaq is offline  
Reply With Quote
Old 01-26-2008, 11:15 PM   #3 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Default

hence its a challenge. :D
__________________
no signature set
sarmenhb is offline  
Reply With Quote
Old 01-26-2008, 11:32 PM   #4 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by sarmenhb View Post
hence its a challenge. :D
I am not good with arithmetic in PHP when using it with Variables, Functions, etc, so I guess I cannot continue.

To me, doing that kinda crap is like playing a guessing game, you don't know what is going to output!
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 01-27-2008, 01:34 AM   #5 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

there ya go:

Code:
$encrypted = md5( sha1( 'some string' ) );
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
Old 01-27-2008, 02:49 AM   #6 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

php Code:
function wildhoney_encrypt($szString)
{
    $szEncrypted = '';
    $aParts = str_split($szString, 1);
   
    foreach($aParts as $szLetter)
    {
        $szEncrypted .= chr(ord($szLetter) + 5);
    }
   
    return $szEncrypted;
}

function wildhoney_decrypt($szString)
{
    $szDecrypted = '';
    $aParts = str_split($szString, 1);
   
    foreach($aParts as $szLetter)
    {
        $szDecrypted .= chr(ord($szLetter) - 5);
    }
   
    return $szDecrypted;
}

$szString = 'Bleh';
$szEncrypted = wildhoney_encrypt($szString);
$szDecrypted = wildhoney_decrypt($szEncrypted);

echo 'Encrypted: ' . $szEncrypted . '<br />';
echo 'Decrypted: ' . $szDecrypted;

Lol Night night everybody.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 01-27-2008, 03:44 AM   #7 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by Wildhoney View Post
php Code:
function wildhoney_encrypt($szString)
{
    $szEncrypted = '';
    $aParts = str_split($szString, 1);
   
    foreach($aParts as $szLetter)
    {
        $szEncrypted .= chr(ord($szLetter) + 5);
    }
   
    return $szEncrypted;
}

function wildhoney_decrypt($szString)
{
    $szDecrypted = '';
    $aParts = str_split($szString, 1);
   
    foreach($aParts as $szLetter)
    {
        $szDecrypted .= chr(ord($szLetter) - 5);
    }
   
    return $szDecrypted;
}

$szString = 'Bleh';
$szEncrypted = wildhoney_encrypt($szString);
$szDecrypted = wildhoney_decrypt($szEncrypted);

echo 'Encrypted: ' . $szEncrypted . '<br />';
echo 'Decrypted: ' . $szDecrypted;

Lol Night night everybody.
I laughed at this post.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 09:48 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design