473,659 Members | 2,681 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Generate password

If I could give an advice on your method, in fact, what I would do.. is :
Generate a password with your lower security set of characters. Then upper
case randomizally some letters and finally inserts special chars at
randomized positions.

I don't know if you like the proposition, but it can help.

Jonathan Boivin

"Morten Snedker" <mo************ @gmail.coma écrit dans le message de news:
%2************* ***@TK2MSFTNGP0 3.phx.gbl...
You certainly got a point there that I missed myself. Thanks for your
input.

Back to the drawing table :-)

Regards /Snedker

Family Tree Mike skrev:
>Your medium and complex modes do not force the generator to pick from the
other datasets, even though you add them to the list of random
characters. This means that in a given scenario, even if you pass in
"complex", you could get a password of "boogiewoog ie" (just an example,
all from the lower case). Random doesn't guarantee one from each set, is
what I am getting at. Our company requres the complex set, but at least
one from each group.

"Morten Snedker" wrote:
>>I'm using this for generating passwords. It seems to function okay.
Anything you guys reckon I missed out on?
'** CODE BEGIN
Public Class GeneratePasswor d

Public Shared Function GeneratePasswor d(ByVal Length As
Integer, ByVal Complexity As Complexity) As String

Dim characters As String =
"abcdefghijkl mnopqrstuvwxyz1 234567890"

If Complexity = Complexity.Medi um Or Complexity =
Complexity.Co mplex Then
characters += "ABCDEFGHIJKLMN OPQRSTUVWXYZ"
End If

If Complexity = Complexity.Medi um Then
characters += "!#%&/()=? "
End If

Dim password As String = ""
Dim random As New Random

For i As Integer = 0 To Length
password += characters.Subs tring(random.Ne xt(0,
characters.Le ngth - 1), 1)
Next

Return password

End Function

Public Enum Complexity
Simple
Medium
Complex
End Enum

End Class
'** CODE END

Regards /Snedker

Jun 27 '08 #1
0 1247

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

Similar topics

1
1504
by: Etienne | last post by:
Hi, in order to protect my software using web activation, I generate a computer hardware code. I'm using the motherboard serial and CPU serial, with ManagementObjectSearcher class. This relies on WMI. On Win9x, since it doesn't support WMI, I simply get the windows volume serial, although it's not as good. But now the problem is. The user needs to be admin in order to get those codes! If the software runs under a guess account, it...
2
1583
by: Joe | last post by:
Hi, I want to generate a random password every time a new user account is created. I want to include small and capital letters and 0 to 9 digits. Can someone give me some idea as how should I do it? I am a beginner in ASP.NET and using VB.net to code the pages so please do not give me any clues in C# because I don’t know that language. Thanks Joe
7
2109
by: MattB | last post by:
I have the following code to generate random passwords for new users of an application. Const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstyvwxyz1234567890" Dim r As Int16, i As Int16 Dim Pswd As String = "" For i = 1 To len
0
5106
by: Richard Gregory | last post by:
Hi, I have the wsdl below, for an Axis web service, and when I select Add Web Refernce in Visual Studio the proxy is missing a class representing the returnedElementsType (see reference.cs below the wsdl). This complex type is a collection of another complex type(elementType), and the Reference.cs has an array of these rather than the single returnedElementsType. If If I want to be able to obtain these elements from the SOAP response I...
0
1193
by: hon123456 | last post by:
Dear all, The following is some lines from app.config <connectionStrings> <add name="NoticeBoard.My.MySettings.MRP6ConnectionString" connectionString="Data Source=COMELONGSRV04;Initial Catalog=MRP6;Persist Security Info=True;User ID=sa;Password=password" providerName="System.Data.SqlClient" /> </connectionStrings>
0
8663
sashi
by: sashi | last post by:
Generate Random Password In the course of programming you may have cause to generate a password. The following function will generate a password of randomly selected characters up to a maximum of 10 characters (this is easy to increase). The number of characters required is passed as a parameter. Using this type of procedure as opposed to chosing your own passwords makes for better security. 'Form code - frmPasswordGenerate ...
1
2130
by: ganesh22 | last post by:
hi... I am doing a project asp.net with C#.my requirement I want to do auto generate password for my application that means when user forget his password when he clicks a link it will auto generate a new password and then it will send to a secondary mail
5
5975
by: ashurack | last post by:
I found a stored procedure online a while back and want to inplement it. The only problem is that it doesn't check to see if the number generated is currently in use in the DB. I know it's really unlikely for the same number to be generated twice (with a 10 digit number) but it's for a shopping cart so I need it to be 100% reliable. I thought about opening a cursor then looping through each distinct record in the DB but couldn't figure...
5
13011
topher23
by: topher23 | last post by:
I've seen a lot of questions about how to make secure database passwords. I'm going to go over a method of encrypting a password using the MD5 encryption algorithm for maximum security. First, you will need to download the attached class module (clsMD5.txt) and import it into your database. This class module is the core of what we're about to go over. Thanks to Robert Hubley for writing it - you're my hero! Next, your database needs a...
0
8851
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
8751
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...
0
7360
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...
1
6181
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
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
4176
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
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2757
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
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.