Welcome Guest, Not a member yet? Register   Sign In
Best way to handle passwords using CI library?
#21

[eluser]fdog[/eluser]
Instead of using $config['encryption_key'] for the encryption salt, just randomly generate a new salt for each new password. But be sure of also inserting the salt in the database Smile
#22

[eluser]Chris.Campbell[/eluser]
I am glad I sparked such huge debate, and got great discussion out of this. I learned a lot and will defiantly implement some of the ideas here into my project, when I read the thread more throughly I may have some questions. This should possibly be stickied as it is a very important topic.
#23

[eluser]xwero[/eluser]
[quote author="fdog" date="1203160627"]Instead of using $config['encryption_key'] for the encryption salt, just randomly generate a new salt for each new password. But be sure of also inserting the salt in the database Smile[/quote]
Storing the salt in the database is less safe than putting it into a php file because a clever hacker will see the connection.

I agree with Elliot decodable passwords can be a security risk but if they can see the passwords they can also see the data they are really after. The only thing they can't crack is the password which isn't always the main target for a hacker.

If you are paranoid you will encrypt all hacker valuable data but it will reduce performance.
#24

[eluser]adamp1[/eluser]
Let me just throw my view in. I have done a cryptography course at degree level. let me just say one thing, if you have a two way encryption algorithm it can be broken very easily. You don't even need the key, if you know how it works (the algorithm) most can be broken by simple processes.

If someone really wants some data you store they will be able to get it, doesn't matter how much you encrypt it. The only way you can stop it is to make the process so hard the data isn't worth it to decrypt it.

I store my passwords using a SHA-1 with salt method. I would advice you all to do the same. DO NOT use two way encryption just so the password can be made into ****'s. This is crazy, just say to the client NO. Your the expert they should listen to you, and if they still refuse print out a random length string of **'s or something.

So just to clarify, use SHA-1 with salt, its the best there is at the moment. I know SHA-1 has been broken but unless your a crypto-geek its probably the best and easiest to use.
#25

[eluser]xwero[/eluser]
So you are saying encryption is useless?
#26

[eluser]adamp1[/eluser]
No I'm saying its useless if you use basic methods. As said before even the SHA-1 with salt can be broken, its just very HARD. So don't think there's no point then to using encryption, there is, I just don't want anyone here thinking anything is safe. Because its not, make sure you use a clever method thats all, and don't do silly things.

How many hackers will want to brute force crack a SHA-1 string just to gain access to a small website? None, if you have more important data I would go talk to someone with the latest knowhow of cryptography.
#27

[eluser]Techie-Micheal[/eluser]
[quote author="adamp1" date="1203171322"]Let me just throw my view in. I have done a cryptography course at degree level. let me just say one thing, if you have a two way encryption algorithm it can be broken very easily. You don't even need the key, if you know how it works (the algorithm) most can be broken by simple processes.

If someone really wants some data you store they will be able to get it, doesn't matter how much you encrypt it. The only way you can stop it is to make the process so hard the data isn't worth it to decrypt it.

I store my passwords using a SHA-1 with salt method. I would advice you all to do the same. DO NOT use two way encryption just so the password can be made into ****'s. This is crazy, just say to the client NO. Your the expert they should listen to you, and if they still refuse print out a random length string of **'s or something.

So just to clarify, use SHA-1 with salt, its the best there is at the moment. I know SHA-1 has been broken but unless your a crypto-geek its probably the best and easiest to use.[/quote] I'm sorry, but this bugs me. Not that you aren't right (well, except for SHA-1 being the best there is, there's SHA-256, SHA-512 Tongue), but two-way encryption is redundant. Just like how Microsoft says reversible encryption. Encryption is, by its very definition, reversible. (A)Symmetric ciphers, block ciphers (eg. Fiestel Network), they are all encryption and are two-way in definition.

Hashing on the other hand is one-way. It cannot be reversed. Sure, you can get collisions, run birthday attacks, brute force it, and various other attacks, but you cannot reverse it. At the end of the day, you get a string, compare it to the hash you are trying to find, and keep going. Contrast that to the Level 7 Cisco passwords which can be broken in under a minute because they used sorry encryption algorithms instead of hashing (ala Level 5).

As for handling passwords, phpBB (my favorite bb software) [disclaimer: I used to be on the team, handling support and security] uses a slightly modified version of this: http://www.openwall.com/phpass/, which came highly recommended from SektionEins (http://www.sektioneins.de/). I would suggest you too look at it.




Theme © iAndrew 2016 - Forum software by © MyBB