473,414 Members | 1,989 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Tip for generating passwords/serial numbers

The recent thread in generating PINs reminded me:

Suppose I want to give someone a random password or ID then this is what
I do:
(1) Generate a hash, eg. MD5 form something, possibly a random number.
This gives a string in hex.
(2) Truncate it to the required number of characters

THEN
(3) Substitute the characters 0,1,5,8,B,C with eg h,k,p,r,t,w,x,y.
eg "AB15708" might become "AKTX7YH"

THE REASON is that O/0 1/l 5/S 8/B c/C can be mis-read. (Also M and N
are not suitable substitutes as if they are read over the phone are
easily confused. )

Personally for 1-off numbers I prefer to have a longer string and use
all upper case but for passwords use mixed case and shorter string to
encourage users to mix their case when they pick their own.


--
PETER FOX Not the same since the submarine business went under
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Aug 2 '05 #1
3 2039
*** Peter Fox wrote/escribió (Tue, 2 Aug 2005 09:54:31 +0100):
Suppose I want to give someone a random password or ID then this is what
I do:
(1) Generate a hash, eg. MD5 form something, possibly a random number.
This gives a string in hex.
(2) Truncate it to the required number of characters

THEN
(3) Substitute the characters 0,1,5,8,B,C with eg h,k,p,r,t,w,x,y.
eg "AB15708" might become "AKTX7YH"


It's a very complicate algorithm to just produce a password that will only
use 16 different characters, isn't it?
http://es.php.net/mt_rand (check the user notes for examples)
http://es.php.net/uniqueid
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Aug 2 '05 #2
I noticed that Message-ID: <98**************@eminent.demon.co.uk> from
Peter Fox contained the following:
THEN
(3) Substitute the characters 0,1,5,8,B,C with eg h,k,p,r,t,w,x,y.
eg "AB15708" might become "AKTX7YH"


hmm, not very memorable though.

www.ckdog.co.uk/php/randpass.php
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Aug 2 '05 #3
xeno
3
thanks for tips
Aug 4 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Gavin | last post by:
Hi, I'm a newbie to programming of any kind. I have posted this to other groups in a hope to get a response from anyone. Can any one tell me how to make my VB program read the Bios serial number...
21
by: nephish | last post by:
i have an interesting project at work going on. here is the challenge. i am using the serial module to read data from a serial input. it comes in as a hex. i need to make it a binary and compare it...
1
by: Darren DeCoste | last post by:
I am trying to create an application in Access that I will be able to print bar code labels. A stumbling block that I have hit is the Serial Number on the bar code. I would like to be able to read...
3
by: Stewart Allen | last post by:
Hi there I'm trying to find part serial numbers between 2 numbers. The user selects a part number from a combo box and then enters a range of serial numbers into 2 text boxes and the resulting...
3
by: Gianmaria | last post by:
Anyone knows how can i get the cpu serial or the hd serial of the machine runnig the application with c#? regards Gianmaria
2
by: Joe | last post by:
Hi, I am building web in ASP.NET using VB.NET to code the pages. I want to generate random passwords for users. I know that password hashing is built right into the .NET Framework. I was...
0
by: Ryan Liu | last post by:
How to read NIC card serial numbers or MAC address , Hard Drive serial numbers in Java or Delphi or C/C++ or C#? Thanks, Ryan
2
blyxx86
by: blyxx86 | last post by:
Great insight needed!! Good evening everyone.. I've come to a point where I can't even fathom how to go forward. I'm attempting to create a serialized inventory. I don't know where to begin....
26
by: bilgekhan | last post by:
What is the correct method for generating 2 independent random numbers? They will be compared whether they are equal. What about this method: srand(time(0)); int r1 = rand(); srand(rand());...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.