473,782 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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******@eminen t.demon.co.uk.n ot.this.bit.no. html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.dem on.co.uk>
Aug 2 '05 #1
3 2050
*** 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.demo n.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 New Member
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
43073
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 (or would HDD be better, or both?) and put that info into VB prog so the program won't work on another computer. My program uses an MSAccess table. Much appreciated if you can help! Thanks
21
3114
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 bit by bit to another byte. They have some weird way they set this up that i have to compare these things with AND. in other words, if bit 1 is 1 AND bit 1 is 1 then the real value is 1... long story short. is there a good way to compare...
1
2839
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 the Serial number from a Customer table. This serial number just starts at 10000 and goes up. This number is incremented everytime a label is printed and I am printing 2 copies of each label, each with the same serial. But during any one print...
3
3279
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 query should find every machine that has that part number between the serial number range. The problem is that the serial number stored is a text field and the results are not what they should be.
3
9827
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
1494
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 wondering if there is any built-in support for generating random passwords in .Net. If the support is built-in, can you show me how to do it. Thanks, Joe
0
2194
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
8177
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. I need to keep a running inventory of serials by customer, by model and then by serial. Customer 1>Model1>Serial1
26
7915
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()); int r2 = rand(); bool f = r1 == r2;
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10313
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8968
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6735
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.