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
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 08-26-2009, 11:38 PM   #1 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default Best way to use salts?

I've been wondering this for a while.
  1. The longer the salt the better, right?
  2. What is the best way to use a salt?**

** -
Which way would be best?
PHP Code:
$pw $_POST['pass'];
$salt gen_salt(16); // Function to create a random string of [a-zA-Z0-9{Plus symbols}].
$salt_big gen_salt(32);

// First
$pass sha1($salt $pw $salt);

// Second
$pass sha1(substr($salt08) . $pw substr($salt98));

// Third
$pass sha1($salt_big $pw $salt_big);

// Fourth
$pass sha1(substr($salt_big016) . $pw substr($salt_big1716));

// Fifth
// Note, $mcyrpt would be a class that has the mcrypt() encryptions.
$pass sha1($salt $mcrypt->blowfish($pw) . $salt);
$pass sha1($mcrypt->blowfish($salt) . $mcrypt->blowfish($pw) . $mcrypt->blowfish($salt)); 
Or is there some even better way?
__________________
My Site
adamdecaf is offline  
Reply With Quote
 



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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with Dynamic Cryptography Salts Wildhoney Tips & Tricks 15 01-29-2013 12:19 PM
Password salts h0ly lag General 9 06-27-2008 07:27 PM
Whats wrong with storing your salt in DB? Nor General 10 12-03-2007 03:45 PM


All times are GMT. The time now is 08:57 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