473,395 Members | 1,537 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,395 software developers and data experts.

unique password everytime on click of button

Hi!

I need to create a unique password everytime i click a button .
what technique/Algo should i follow.

Abhishek
Nov 16 '05 #1
8 2104

I forgaot to add that I do not want to use any third party tools or any
external program
Abhishek
Nov 16 '05 #2

"Abhishek" <ab******@alwayshelpful.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi!

I need to create a unique password everytime i click a button .
what technique/Algo should i follow.


I'd start with System.Guid.NewGuid(), which generates a new Guid each time,
presumably intended to be unique. (Though given the random appearance of
the results, I'm not sure how unique it really is. For example, it doesn't
appear to use the MAC address, the natural way to ensure that two different
machines won't generate duplicate Guids.)
Nov 16 '05 #3

"Mike Schilling" <ms*************@hotmail.com> wrote in message
news:eU*************@TK2MSFTNGP11.phx.gbl...

I'd start with System.Guid.NewGuid(), which generates a new Guid each time, presumably intended to be unique. (Though given the random appearance of
the results, I'm not sure how unique it really is. For example, it doesn't appear to use the MAC address, the natural way to ensure that two different machines won't generate duplicate Guids.)

Thanks I knew i could use GUID's but did not know how to generate them thru
C#
Thanks a lot

Abhishek
Nov 16 '05 #4
I believe they used to use the MAC address but stopped because a GUID could
be traced back to the computer that originated it and that created some
privacy concerns. They apparently use some other technique to ensure
randomness and no collisions between GUIDs.

- JW

"Mike Schilling" <ms*************@hotmail.com> wrote in message
news:eU*************@TK2MSFTNGP11.phx.gbl...

"Abhishek" <ab******@alwayshelpful.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi!

I need to create a unique password everytime i click a button .
what technique/Algo should i follow.


I'd start with System.Guid.NewGuid(), which generates a new Guid each
time, presumably intended to be unique. (Though given the random
appearance of the results, I'm not sure how unique it really is. For
example, it doesn't appear to use the MAC address, the natural way to
ensure that two different machines won't generate duplicate Guids.)

Nov 16 '05 #5
Jonathan Woodbury <jw@systrackinc.com> wrote:
I believe they used to use the MAC address but stopped because a GUID could
be traced back to the computer that originated it and that created some
privacy concerns. They apparently use some other technique to ensure
randomness and no collisions between GUIDs.


I suspect they don't actually *ensure* that there aren't any
collisions. From a theoretical point of view, they can't - Guids have a
finite size (128 bits). While in a practical sense you can't call
NewGuid that many times, there's nothing to stop it from being done
theoretically.

Like hashes, I suspect it's just very, very unlikely that you'll get
two identical Guids.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #6

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Jonathan Woodbury <jw@systrackinc.com> wrote:
I believe they used to use the MAC address but stopped because a GUID
could
be traced back to the computer that originated it and that created some
privacy concerns. They apparently use some other technique to ensure
randomness and no collisions between GUIDs.


I suspect they don't actually *ensure* that there aren't any
collisions. From a theoretical point of view, they can't - Guids have a
finite size (128 bits). While in a practical sense you can't call
NewGuid that many times, there's nothing to stop it from being done
theoretically.


Actually, you can ensure it, and the original spec for UUIDs shows how. I
don't recall all the details, but it's basically:

There are 6 bits of UUID version and type information.

The last 48 bits are the MAC address. All are guaranteed unique by the
manufacturer, so the problem of uniqueness is now restricted to a single
machine.

There are 14 bits called the "clock sequence". IIRC, it's intended that
each process (or thread) on the machine that produces UUIDs gets a unique
clock sequence number either from the OS or from a piece of specialized
hardware.

This leaves 60 bits for the time, which represent the absolute time of UUID
creation in 100s of nanoseconds. That's good for about 3500 years. (You're
right that the algorithm breaks down after that. Sue me :-)

If a thread is asked to generate more than 1 UUID every 100 nanoseconds, it
can either ask for a new clock sequence, or just wait.

I've written UUID generators that follow this algorithm (more or less
closely), and they work well enough. Clearly .NET doesn't, though I suppose
it could be doing so and then doing a reversible encryption of the result.
Nov 16 '05 #7
Mike Schilling <ms*************@hotmail.com> wrote:
I suspect they don't actually *ensure* that there aren't any
collisions. From a theoretical point of view, they can't - Guids have a
finite size (128 bits). While in a practical sense you can't call
NewGuid that many times, there's nothing to stop it from being done
theoretically.
Actually, you can ensure it, and the original spec for UUIDs shows how. I
don't recall all the details, but it's basically:

There are 6 bits of UUID version and type information.

The last 48 bits are the MAC address. All are guaranteed unique by the
manufacturer, so the problem of uniqueness is now restricted to a single
machine.


Except they're not, because these days many devices allow you to set
MAC addresses. As Jonathan said, using the MAC address also introduces
privacy concerns. As far as I know, there's nothing which can
definitively be used in all processors that Windows runs under and
which will guarantee to give a number which is unique to that computer
forever.
There are 14 bits called the "clock sequence". IIRC, it's intended that
each process (or thread) on the machine that produces UUIDs gets a unique
clock sequence number either from the OS or from a piece of specialized
hardware.
Again though, how can that be unique? 14 bits only gets 16384
possibilities. If I run a hundred processes, each with 10 threads, then
set the clock back and do it again and again, you soon end up with
there having been one point in time (as far as the computer is
concerned) which has had more than 16384 threads running at the same
time. They can't all have different numbers.
This leaves 60 bits for the time, which represent the absolute time of UUID
creation in 100s of nanoseconds. That's good for about 3500 years. (You're
right that the algorithm breaks down after that. Sue me :-)

If a thread is asked to generate more than 1 UUID every 100 nanoseconds, it
can either ask for a new clock sequence, or just wait.
And what happens if the user adjusts the clock back in time? Again, the
*guarantee* of uniqueness is gone.
I've written UUID generators that follow this algorithm (more or less
closely), and they work well enough. Clearly .NET doesn't, though I suppose
it could be doing so and then doing a reversible encryption of the result.


As I said, "works well enough" is one thing - but to guarantee
uniqueness is a different matter.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #8

"Scott C. Reynolds" <sr*********@noemail.nospam> wrote in message
news:OI**************@TK2MSFTNGP09.phx.gbl...
A while back, in my network support days, I ran into two 3com cards with
identical MAC addresses. The DHCP server ran upstairs and threw itself
from the roof in dispair! Nothing generated is "guaranteed" unigue in the
same sense that there is no true random number generator, and that no
system is 100% secure. the idea is to come close enough.


Each manufacturer is assigned a range of MAC addreseses; what you're
describing is a failure in 3COM's processes (or quality control.)
Nov 16 '05 #9

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

Similar topics

4
by: J Sahoo | last post by:
Hello, I have a registration page where I am collecting user information (username, password, last name, age, etc...). I made the password field as PASSWORD (field type from the textbox). If user...
3
by: Randall Parker | last post by:
I have this element in an asp:DataGrid: <asp:TemplateColumn HeaderText="Edit Record Button"> <ItemTemplate> <asp:Button ID='<%# "Edit" + DataBinder.Eval(Container, "DataItem.owner_serial_num")...
2
by: jdstroud | last post by:
I have an asp.net application on our intranet, and I am trying to use windows authentication. My problem is that I would like to get the user's credentials without having the login / password...
2
by: brino | last post by:
hi all ! i have developed a database for a client which is working fine , however another developer has sold another database to this client and in this database the developer has inserted some...
3
by: Co | last post by:
Hi All, I use a website in asp for which I have to type a username and password everytime I want to login. On the form are two fields for typing the username and password and one button LOGIN....
2
by: Darvon | last post by:
Hello everyone. I have this website I would like to add some simple password protection to.. Nothing too fancy, so I decided to pull out an old javascript I came across sometime in the past that...
3
by: Porkie999 | last post by:
-----------------------------------------------------------------------QUESTION hi i am really stuck with this and its only a small problem. i want to be able to type ......... dsfsjfjsjjfs in...
13
by: gamernaveen | last post by:
I am coding a script , where basically the user has to enter his name , choose file , file comments if required and upload. The file comments , name , filename will be stored in the database with...
2
by: ma.giorgi | last post by:
Hi Everybody! I have the following problem: from the application mainForm the user can do several operation Some of them are password protected (the password is a code that change everytime on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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...

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.