473,503 Members | 5,495 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****************@TK2MSFTNGP03.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 "boogiewoogie" (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 GeneratePassword

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

Dim characters As String =
"abcdefghijklmnopqrstuvwxyz1234567890"

If Complexity = Complexity.Medium Or Complexity =
Complexity.Complex Then
characters += "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
End If

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

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

For i As Integer = 0 To Length
password += characters.Substring(random.Next(0,
characters.Length - 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 1241

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

Similar topics

1
1496
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...
2
1568
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...
7
2098
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...
0
5091
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...
0
1181
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...
0
8633
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...
1
2116
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...
5
5941
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...
5
12957
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,...
0
7207
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
7291
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
7357
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...
1
7012
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...
0
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3180
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...
0
3171
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
402
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...

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.