Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Random generate a "pronounceable" password for your users. Details »»
Random generate a "pronounceable" password for your users.
Version: 1.00, by TripLcixx TripLcixx is offline
Developer Last Online: Aug 2004 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 07-30-2004 Last Update: Never Installs: 1
 
No support by the author.

Since VB3's expire function for passwords, you can now force your members to change password. But very often, people tend to forget their recently changed password.
Also, if you add the "history" option, people will have to come up with a new password everytime and that particular detail is not always appreciated.

One thing to do is random generate a password but you can be sure you users will never remember this one.

So I came up with the idea to random generate an "easy to remember" password.
A while back I read on php.net about a small piece of code that generates a "pronouncable" password which is easier to remember, so I decided to integrate this function into vB.

What the hack does is add a link in the "Change password" page which makes the page auto-generate a "pronounceable" password. Also, it changes the inputfields from passwordfields to regular textfields. In the first passwordfield, the generated password is placed. The second field will still be empty so the user will have to retype the password.

Changes to do:
-file edits (2)
-template edits (1)
-adding phrases (1)


Installation:
Open admincp/functions_user.php and look for:
PHP Code:
     return $word;

After that, add:
PHP Code:
// ############ Extra function to create random pronouncable password ##########
function createpronouncepass() {
    
$array = array(
            
'ap','dus','tin','rog','sti','rev','pik','sty','lev','qot','rel','vid'
            
'kro','xo','pro','wia','axi','jer','foh','mu','ya','zol','gu','pli','cra'
            
'den','bi','sat','ry','qui','wip','fla','gro','tav','peh','gil','lot'
            
'azz','oi','sut','ury','kwi','owp','fli','ws','ava','nou','gae','ing'
            
'132','you','789','buo','gro','mup','flo','alc','spi','nku','gui','win'
            
'kal','zan','noc','bat','tev','lun','pal','hom','cun','wos','vox'); 

    
$num_letters 7//The number of letters 
    
mt_srand((double)microtime()*1000000);

    for(
$i=0$i<$num_letters$i++)
    
$pass .= $array[mt_rand(0, (count($array) - 1))]; 

    for(
$i=1$i<strlen($pass); $i++) {
        if(
substr($pass$i1) == substr($pass$i-11)) 
            
$pass substr($pass0$i) . substr($pass$i+1);
    } 

    
$pass substr($pass0$num_letters);
    return 
$pass;

Save and upload functions_user.php

Open profile.php and look for:
PHP Code:
    // show Optional because password expired
    
$show['password_optional'] = !$show['passwordexpired'];
    
$templatename 'modifypassword'
After that, add:
PHP Code:
    if ($_REQUEST['extra'] == 'genrandom') {
        
$randompass createpronouncepass();
        
$passwordfield "text";
    } else {
        
$randompass "";
        
$passwordfield "password";
    } 
Save and upload profile.php

In the template "modifypassword", look for:
PHP Code:
<input type="password" class="bginput" name="newpassword" size="50" maxlength="50" /> 
and replace it with:
PHP Code:
<input type="$passwordfieldclass="bginput" name="newpassword" size="50" maxlength="50" value="$randompass/> 
look for:
PHP Code:
<input type="password" class="bginput" name="newpasswordconfirm" size="50" maxlength="50" /> 
and replace it with:
PHP Code:
<input type="$passwordfieldclass="bginput" name="newpasswordconfirm" size="50" maxlength="50" />
<
br />$vbphrase[generate_random_password

Add the following phrase:
Code:
Phrase Type: User tools (global)
Varname: generate_random_password
Text: <a href="profile.php?s={$session['sessionhash']}&do=editpassword&extra=genrandom">Click here to have a random password generated for you.</a>

That's it!

Small note:
A 7 char "pronounceable" password is generated every time. If you want more or less characters, all you have to do is change this value in admincp/functions_user.php:
PHP Code:
    $num_letters 7//The number of letters 

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 08-01-2004, 12:25 PM
Reeve of shinra's Avatar
Reeve of shinra Reeve of shinra is offline
 
Join Date: Oct 2001
Location: NYC
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very useful. Thanks for sharing!
Reply With Quote
  #3  
Old 08-02-2004, 05:07 AM
rookie7 rookie7 is offline
 
Join Date: Apr 2004
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The only thing I hesitate to install this hack is the possibility of cracking the passwords. Any chance your hack can prevent the generated passwords from being cracked?
Reply With Quote
  #4  
Old 08-02-2004, 05:39 AM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nothing in a hack can prevent a password cracker from cracking a password - that would be magic, and we don't deal in magic here - tbh 7 characters seems a little low as a default in this situation as the mini-phrases that make up the passwords are a known factor... in this instance I would sughgest users use a default of 15 or 20 characters at least - as it's pronounceable it is less of an issue it being longer...
Reply With Quote
  #5  
Old 08-02-2004, 08:59 AM
TripLcixx TripLcixx is offline
 
Join Date: Jul 2004
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any password can be "cracked" if you do a bruteforce check on it and have enough time. The good thing with VB3 is the "scratches" system, which bans ppl for 15mins if they use the wrong password 5 times. This makes any bruteforce attempt a lot harder.

@ Natch: well, your post makes sense, but I somehow believe that a 7 char random generated password is harder to guess than a password made up by a user (as they tend to use real life words, which can easily be cracked with some sort of dictionary search)

Well, you can specify the amount of chars the password has to be so...everybody happy?
Reply With Quote
  #6  
Old 08-02-2004, 03:33 PM
j_86 j_86 is offline
 
Join Date: May 2003
Posts: 275
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

All passwords can be cracked, if you have the strikes system you'll be fine with this hack because practicaly all probabilities are in your favour.

If you DO NOT use the strike system, however; because the possible components of passwords have been released to the public, it does indeed become easier to crack. But nothing to worry about, with the strikes system
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:31 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04675 seconds
  • Memory Usage 2,291KB
  • Queries Executed 21 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (9)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete