md5 encryption |
[eluser]junaids[/eluser]
hi i have a registration module and i save user password using md5 encryption. then on login i use md5 to encrypt the password and match it with database. but it does not match Code: $this->db->from('user'); against a particular username and password with the echo statement i m getting pw as "7fa8282ad93047a4d6fe6111c93b308a " while in the db the password is "7fa8282ad930" the password in the db is just a part of password produced on login so i m unable to login why?
[eluser]Slowcheetah[/eluser]
Check your maximal fieldsize for the password column in the database. Then try to register a new account, and check again. p.s. There are several pre-made codeigniter authentication librarys, check out this article.
[eluser]Dam1an[/eluser]
An md5 will always be 32 characters long, regardless of the input side
[eluser]Thorpe Obazee[/eluser]
@OP. You shouldn't probably use md5 alone since there's a growing number of md5 hashes nowadays. You should probably work on 'salting' passwords.
[eluser]n0xie[/eluser]
md5 rainbow tables are abundant. Use either sha1, a salt, or both for better security. Also use prepared statements. There are a number of articles floating around on this forum about proper authentication conventions, maybe they're some use to you. Good luck.
[eluser]the_namdeeW[/eluser]
I personally would use SHA1. MD5 hashing doesn't seem to be as secure. |
Welcome Guest, Not a member yet? Register Sign In |