• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

BCrypt Password Hashing

Admin

Well-Known Member
Staff member
Administrator
This is a 'howto' use bcrypt for your password hashs, instead of the default vBulletin one, which is highly insecure.








More information about BCrypt can be found here: http://codahale.com/how-to-safely-store-a-password/ - http://phpmaster.com/why-you-should-use-bcrypt-to-hash-stored-passwords/


tl;dr: if you want to be moar secure, use bcrypt.




" How much slower is bcrypt than, say, MD5? Depends on the work factor. Using a work factor of 12, bcrypt hashes the password yaaa in about 0.3 seconds on my laptop. MD5, on the other hand, takes less than a microsecond."




BEFORE YOU DO THIS, PLEASE CREATE A .PHP FILE WITH THIS IN IT
Code:
<?php
if (defined("CRYPT_BLOWFISH") && CRYPT_BLOWFISH) {
    echo "CRYPT_BLOWFISH is enabled!";
}
else {
    echo "CRYPT_BLOWFISH is not available";
}


If it is not available, please contact your host.








/includes/functions.php
Add this to the end, just before the footer message.


Code:
/**


White-Hat work by http://www.internot.info/
More information regarding BCrypt: http://codahale.com/how-to-safely-store-a-password/ 
http://www.vbulletin.org/forum/showthread.php?p=2369367#post2369367


 **/
function hash_password_bcrypt($password, $salt) {
       $cost = 15; // must be in range 04 - 31


       // The salt can only contain the characters "./0-9A-Za-z" and the length must be > 2, so the input gets md5ed
       return md5(crypt($password, '$2a$' . sprintf('%02d', $cost) . '$'. md5($salt) . '$'));
}






includes/class_dm_user.php
Now..


Find this:
Code:
if ($password == md5(md5($this->fetch_field('username')) . $salt))
and replace it with this:
Code:
if ($password == md5(hash_password_bcrypt(md5(md5($this->fetch_field('username')) . $salt), $salt)))


Then, on the same file, replace this:
Code:
return md5($password . $salt);
with this
Code:
return md5(hash_password_bcrypt(md5($password . $salt), $salt));








includes/functions_login.php




Find this:
Code:
                       $vbulletin->userinfo['password'] != iif($password AND !$md5password, md5(md5($password) . $vbulletin->userinfo['salt']), '') AND
                       $vbulletin->userinfo['password'] != iif($md5password, md5($md5password . $vbulletin->userinfo['salt']), '') AND
                       $vbulletin->userinfo['password'] != iif($md5password_utf, md5($md5password_utf . $vbulletin->userinfo['salt']), '')


And replace it with this:


Code:
                       $vbulletin->userinfo['password'] != iif($password AND !$md5password, md5(hash_password_bcrypt(md5(md5($password) . $vbulletin->userinfo['salt']), $vbulletin->userinfo['salt'])), '') AND
                       $vbulletin->userinfo['password'] != iif($md5password, md5(hash_password_bcrypt(md5($md5password . $vbulletin->userinfo['salt']), $vbulletin->userinfo['salt'])), '') AND
                       $vbulletin->userinfo['password'] != iif($md5password_utf, md5(hash_password_bcrypt(md5($md5password_utf . $vbulletin->userinfo['salt']), $vbulletin->userinfo['salt'])), '')


Please click 'Installed', will be much appreciated.
If any support is needed, please post. I will only support people who have clicked installed. :):D
 

Facebook Comments

Similar threads
Thread starter Title Forum Replies Date
Admin Increase Cost on bcrypt passwords vBullein 5.4.2 Add-ons 0
N Brute XMLRPC 2.11 + top password list Tut, tool, mmo 0
Admin Disable email and password edit xenforo 2 Xenforo 0
P Elcomsoft Distributed Password Recovery.v4.10.1245.4902.Cracked by Yoza Phần mềm 0
P Phần mềm PC Elcomsoft Advanced Office Password Breaker.v3.06.803.5013 Phần mềm 0
Admin Temporary Passwords by BOP5 (Allow admins to login as any user without user password) Add-ons 0
caonguyenpc Thủ thuật Cách phá Password Excel "Sheet" không cần phần mềm Thủ thuật máy tính 0
Admin Facebook Password Extractor 2.0.306 - Phần mềm khôi phục mật khẩu Facebook nhanh chóng Phần mềm 1
Admin Password Strength Check Add-ons 0
djdungcuty Thủ thuật Ngăn Người Khác Xem Trộm Password Lưu Trên Trình Duyệt Sử dụng, chia sẻ, hỏi đáp 0
Admin Cách lấy lại password của thẻ nhớ Thủ thuật ĐTDĐ 3
S [Mod] Bàn phím ảo khi nhập password login cho VBB 4.x Add-ons 1
T Crack password WIFI (WEP/WPA/WPA2) Sử dụng, chia sẻ, hỏi đáp 3
Admin Wrong username or password. You have used up your failed login quota! Xenforo 1
Admin Hướng dẫn lấy lại password joomla administrator Add-ons 2
Admin Hàm mã hóa MD5 password bằng c# và VB.NET C# / C++ 0
Admin Cách đổi password cho vps win VPS & Dedicated Server 0
Admin Cách đổi password cho vps VPS & Dedicated Server 0
Admin Share BBCode Download và Password Add-ons 0
Admin Bảo mật hơn cho password - Web programer Bảo mật 0
style RSL Hosting New PassWord Hosting & Domain Share 1
Admin Video hướng dẫn tạo user/password admin khi người share code ko đưa thông tin này Mã nguồn web 7
Admin Share bbcode spoiler kèm password cho phpbb3x Phpbb3x 4
Admin Reset password Admin không cần hirenboot Thủ thuật máy tính 0

Similar threads

New posts New threads New resources

Back
Top