Problem Hashing Passwords with Symbol

Started by mattizzy, August 30, 2018, 02:04:06 AM

Previous topic - Next topic

mattizzy

Hi, I really love you guys for your assist.

Please, I migrated to SMF.

passwords with symbols are not working.

$user = "help";
$pass = "&6";
I used sha1(strtolower($user) . htmlspecialchars($pass);

Output: d28891dab2b40294066ccf95ec68967408cf0017

but when I use
sha1(strtolower($user) . $pass;

Output:fd0b3aef67010249072b7aae917887b08a7bb4a4

I figured that it's majorly happening with the & symbol.

I tried SMF function
sha1(strtolower($user) . un_htmlspecialchars($pass);

Output: fd0b3aef67010249072b7aae917887b08a7bb4a4 which is similar to the second output.

Unfortunately, the first output in the password in my database.

Every other password with normal letters works well. I don't know why the symbol is affecting it. Help
I am only an SMF Addict. I think I took overdose.

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

mattizzy

Quote from: vbgamer45 on August 30, 2018, 07:48:31 AM
& gets converted to an html entities
https://www.w3schools.com/php/func_string_htmlspecialchars.asp

How do I handle it now?? like how do I make the password converted to HTML attribute to work on SMF??
I am only an SMF Addict. I think I took overdose.

vbgamer45

Why are you htmlspecialchars the password? There should not be a reason to.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

mattizzy

Quote from: vbgamer45 on August 30, 2018, 01:32:32 PM
Why are you htmlspecialchars the password? There should not be a reason to.

Thanks a lot but I fixed it. I added the sha function of my forum to $other_passwords[] array in loginout.php
I am only an SMF Addict. I think I took overdose.

Advertisement: