Business Sites     

Web Applications      Web Site Hosting      Search Engine     
CompanyWeb.net: Web Hosting, Internet Programming, Search Engine Optimization

If your company needs web design, web application programming, script installation or web hosting, send email to help@companyweb.net or call us at 412.253.4160 for a quote or just to ask a question.

 

What about C-T-P-M?
Content Traffic PREsell Monetize.

Give searchers what they want by converting your knowledge into high-quality, in-demand CONTENT.

SiteSell.com


Low Cost Web Hosting
Use a CompanyWeb recommended web hosting company and save. Get outstanding hosting service for $5.00/month or less.

hosting.sohosoftware.com


For Serious Companies
1,000+ pages of up - to - the - minute research, test results, examples, case studies, and the newest and hottest strategies for marketing your business on the Internet!

marketingtips.com


Step by step procedure
More than 200 million people a day search on Google for products and services, and there are less than 100,000 advertisers. Make money by placing Google AdWords ads for your affiliate programs.

googlecash.com

 

 

CompanyWeb Articles

Book Reviews
Columns

Web-Source Topics...

Horse's Mouth
ProBizTips

CompanyWeb Search



Web Design Master Series Article

Web Design Master Series Article is syndicated from Web-Source.net.

Syndicated articles are written by independent authors and the contents represent the author's views. The content of the article does not necessarily represent the views of Company Web staff and management.


Master Series

Master Password Generator V1

By William Bontrager

This article talks about Master Password Generator V1, a free Master Series CGI program.

It also talks about incorporating the password generating subroutine, developed for Master Password Generator V1, into your own scripts.

If you want to go straight to the product description page to try the demo or download the program, here is the URL: http://willmaster.com/a/17/pl.pl?art172

Automatic password generation can be desired for many and varied reasons. Here are a few.

  • For webmasters selling downloadable products, like ebooks or software, where a unique password is provided with each sale.
  • For personal use, when a password is desired that's not easily guessable.
  • Membership software, where new members must be assigned a password.

Master Password Generator V1

When you use Master Password Generator V1, you'll find three form fields for numbers and five checkboxes.

The three form fields for numbers are all optional:

  1. The number of passwords you want generated. If not filled in, 1 is assumed.
  2. The minimum length for each password. If not filled in, 7 is assumed.
  3. The maximum length for each password. If not filled in, 7 is assumed.

As you can see, you can generate any number of passwords, with variable lengths.

The checkboxes tell Master Password Generator V1 which character set or sets to use when generating the password or passwords. At least one of the five checkboxes must be checked:

  1. A character set composed of digits. If an alphabet set is also checked, the digits 0 and 1 are not included because they can easily be confused with the letter O or the letter l.
  2. A capitalized alphabet set, excluding the letter O.
  3. An alphabet set of lower-case characters, excluding the letter l.
  4. A set of non-alphanumeric printable characters.
  5. The space character.

Simply check the checkboxes you want to use for your passwords. Then click the submit button.

Installation

Master Password Generator V1 is simple to install. Just verify that the first line of the script points to the location of perl on your server, upload the script, and give it 755 permissions. The README.txt file, included in the download package, has instructions.

To use Master Password Generator V1, type its URL into your browser. Example:

http://domain.com/cgi-bin/MasterPasswordGenerator.cgi

That URL will display the control panel in your browser.

The Password Generating Subroutine

The subroutine in Master Password Generator V1 that generates passwords is MakePassword()

To give your own script password generation functionality, paste the subroutine into your script. Here is the subroutine in its entirety:

sub MakePassword
{ my($composition,$lowlength,$highlength) = @_; return '' unless $composition; my @p = split //,$composition; my $arraylength = @p; $lowlength = 7 if $lowlength < 1; # default to 7. $highlength = 7 if $highlength < 1; # default to 7. if($lowlength > $highlength) { ($highlength,$lowlength) = ($lowlength,$highlength); } my $length = int(rand($highlength - $lowlength + 1)); $length += $lowlength; my $password = ''; for(1..$length) { my $i = int(rand($arraylength)); $password .= $p[$i]; } return $password; } # sub MakePassword # end of subroutine

To use the subroutine, you have to provide it with the set of characters from which to generate the password. Optionally, you can also provide it with the minimum and maximum length for the generated password. If you do not provide those numbers, 7 will be assumed for both.

Here is a complete Perl script as an example of using the subroutine (paste the subroutine into place where indicated):

#!/usr/bin/perl
my $characterset = 'abcdefghijklmnopqrstuvwxyz';
my $minimum = 5;
my $maximum = 9;

# Paste subroutine MakePassword() above this line.
my $password = MakePassword($characterset,$minimum,$maximum);
print "Content-type: text/plain\\n\\n";
print $password;
# end of script

The script provides a character set, along with the minimum and maximum length, to the subroutine. The subroutine generates the password and returns it to be stored in the variable $password, which is then printed.

There you have it, easy password generation, in a stand-along program and a subroutine to incorporate into your own scripts.

Will Bontrager

Copyright © 2002 Bontrager Connection, LLC

About the Author:

William Bontrager Programmer/Publisher, "WillMaster Possibilities" ezine mailto:possibilities@willmaster.com

Are you looking for top quality scripts? Visit Willmaster and check out his highly acclaimed Master Series scripts. Some free, some for a fee.

Content Provided By:

More Master Series Articles...

 


Frontpage, NT are Trademarks of Microsoft Corporation. CompanyWeb Site Copyright (c) 1998 - 2003, CompanyWeb.net Site Development Service Group.