Our Scripts Vault contains many game scripts that you can use to create your own game!
I will be however, doing a simple making sure that no two characters are within eachother,
And i'm also now going to be using teh twofish encryption algorithm with a key that'll be some random sha256 hashed version of some string.
Quote from: 133794m3r on February 09, 2010, 06:01:32 AMI will be however, doing a simple making sure that no two characters are within eachother,Keep in mind that this will substantially reduce the search space for brute-force attacks, since an attacker aware of this requirement would know not to try, say, "sdjjhsiuh". Whether that's more or less significant to the overall difficulty than the elimination of a certain class of weak passwords, I can't say, but a proper dictionary check would be more effective than banning doubled letters, particularly if you use wordlists that include '1ee+5p33|<' spellings as well as proper ones. (There's a link near the bottom of the page to download free versions of their wordlists near the bottom of the page; you don't have to buy their CDs.)Quote from: 133794m3r on February 09, 2010, 06:01:32 AMAnd i'm also now going to be using teh twofish encryption algorithm with a key that'll be some random sha256 hashed version of some string. You are aware that Twofish is actual (two-way) encryption, not (one-way) cryptographic hashing, yes? If you want to be able to decrypt the stored passwords to find their plaintext representation, then that is appropriate, but I've been assuming that you did not want this to be possible.
And php doesn't include bcrypt. It only includes blowfish. Which isn't bcrypt as far as i know. It has no option for bcrypt. So honestly, i don't know how using anything besides sha256 would be any better then.
Quote from: 133794m3r on February 09, 2010, 06:30:01 AMAnd php doesn't include bcrypt. It only includes blowfish. Which isn't bcrypt as far as i know. It has no option for bcrypt. So honestly, i don't know how using anything besides sha256 would be any better then.Ah, I had assumed when you mentioned finding blowfish earlier that you actually meant you had found bcrypt. According to the OpenWall site (the source of the dictionary lists I linked above), "To ensure that the fallbacks will never occur, PHP 5.3.0+ or the Suhosin patch may be used. PHP 5.3.0+ and Suhosin integrate crypt_blowfish into the PHP interpreter such that bcrypt is available for use by PHP scripts even if the host system lacks support for it." (Source) It looks like you access it by using the crypt() function and specifying CRYPT_BLOWFISH as the method.If your PHP is older than that, then, yeah, sha256 would likely be your best bet. It's still a very good option as far as resistance to reverse-engineering passwords or generating hash collisions. The only problem with it that I'm aware of is that it runs fast enough to allow brute-force attacks, which is the threat that bcrypt was specifically designed to counter. Note that you can still slow things down without using bcrypt if that's a major concern - just run 100 rounds of sha256 (i.e., create your hash, then hash the result, then hash that result...), or 1000, or however many you feel your hardware is capable of without harming the overall user experience.
Just for the sake of completeness, here's a link to an article I ran across which discusses the reasons behind using bcrypt (although it incorrectly calls it Blowfish), including a code snippet demonstrating how to use it in PHP:http://www.dereleased.com/2010/02/09/lets-talk-about-your-password-model/
if i know COMPLETELY understand how bcrypt works then that means that my users passwords will not be able to be as safe as i'd like them to be and i can't use the type of password that i like to do. Since it said that it can ONLY take a base64 string for the password, this means that i'm not able to use special characters such as (),{},[],!@#$%^&*_='":;><.,?/ and that doesn't make me feel remotely good about this crypt() function. Hmm.... seems that the base64 encoder might support said characters. I'll have to try it out officially.
I know cookies are supposed to be secure, but it's happened before that browsers have had vulnerabilities that allow 3rd party reading of cookie data. So, I consider it poor form to actually store the username password combination in a cookie.
Basically, if you're ever doing anything with the plain-text user password that you've received other than passing it directly (with or without salts and nonces though it's obviously better to have them) to a hashing function, you need to have your hand smacked with a wooden ruler.