logo
g Text Version
Auto
Beauty & Self
Books & Music
Career
Computers
Education
Family
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
Money
News & Politics
Relationships
Religion & Spirituality
Society & Culture
Sports
Travel & Leisure
TV & Movies

dailyclick
Bored? Games!
Postcards
Astrology
Take a Quiz
Rate My Photo

new
Journals
Folklore and Mythology
Business Coach
Marriage
Senior Living
Ethnic Beauty
Adolescence


dailyclick
All times in EST

Full Schedule
g
g ASP Site
Editor Wanted
BellaOnline's ASP Editor

g

Creating a Random Password Generator
Guest Author - Lisa Shea

If you're using passwords of any type on your site, it is best to keep them random. That way they cannot be easily guessed at by intruders.

First, it's good to know a little about ASCII characters. Every character your keyboard can type is actually represented by a number. So the letter A is represented by 65. The letter Z is represented by 90. So all you need to do is generate a series of random numbers, each number between 65 and 90. That would give you a way to find the equivalent letters.

If you want to include numbers too, those are found between spots 48 and 57. I wouldn't use the spots between 57 and 65 - those are odd characters like colons.

So let's say you want to create a 7 character password that contains a random assortment of letters and numbers. You could do something like this:

Randomize()
PassLen = 0
CurrPass = ""

do while PassLen < 7
CurrLtr = Int((42 * Rnd()) + 48)
if CurrLtr < 57 or CurrLtr > 65 then
CurrPass = CurrPass & Chr(CurrLtr)
PassLen = PassLen + 1
end if
loop

So you just keep generating a new ASCII character, and each time you do, you see if it's in either the letter or number range. If it is, you use it to add to your password. If it isn't (i.e. if it is in that 'symbol' middle area) you ignore it and keep looking. When you are done, you should have a nice, random password!

ASCII Chart

This site needs an editor - click to learn more!

RSS | Related Articles | Previous Features | Site Map

Add Creating+a+Random+Password+Generator to Twitter Add Creating+a+Random+Password+Generator to Facebook Add Creating+a+Random+Password+Generator to MySpace Add Creating+a+Random+Password+Generator to Del.icio.us Digg Creating+a+Random+Password+Generator Add Creating+a+Random+Password+Generator to Yahoo My Web Add Creating+a+Random+Password+Generator to Google Bookmarks Add Creating+a+Random+Password+Generator to Stumbleupon Add Creating+a+Random+Password+Generator to Reddit


Content copyright © 2009 by Lisa Shea. All rights reserved.
This content was written by Lisa Shea. If you wish to use this content in any manner, you need written permission. Contact BellaOnline Administration for details.

g


For FREE email updates, subscribe to the ASP Newsletter


Past Issues


print
Printer Friendly
bookmark
Bookmark
tell friend
Tell a Friend
forum
Forum
email
Email Editor

g features
Best uses for RSS

RSS and its future.

Force Download Dialog box with ASP

Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter

jobs
what
job title, keywords
where
city, state or zip
jobs by job search


vote
Growing a Garden
Veggies and Flowers
Veggies Only
Flowers Only
No Garden

g


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2009 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor