Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Security / October 2005

Tip: Looking for answers? Try searching our database.

how does System.Guid.NewGuid() work ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John A Grandy - 08 Oct 2005 01:18 GMT
Does anyone know the technique used by System.Guid.NewGuid() to create the
Guid ?

C# code would be great !
Joseph Bittman MCSD - 08 Oct 2005 02:32 GMT
October 7, 2005

  I know in VB:
Dim G as Guid = Guid.NewGuid

In C# I believe:
dim guid G = Guid.NewGuid

I hope I got the C# right, although probably now... (the truth is NewGuid()
returns a new guid object). Hope this helps!

Signature

                Joseph Bittman
Microsoft Certified Solution Developer

Web Site: http://71.39.42.23/
Static IP

> Does anyone know the technique used by System.Guid.NewGuid() to create the
> Guid ?
>
> C# code would be great !
Joe Kaplan (MVP - ADSI) - 08 Oct 2005 04:01 GMT
Do you mean the call that actually generates a Guid randomly?  It is a
p/invoke call down into the Windows API CoCreateGuid or perhaps directly
down to UuidCreate.

Joe K.

> Does anyone know the technique used by System.Guid.NewGuid() to create the
> Guid ?
>
> C# code would be great !
Richard Grimes - 19 Oct 2005 17:22 GMT
> Do you mean the call that actually generates a Guid randomly?  It is a
> p/invoke call down into the Windows API CoCreateGuid or perhaps
> directly down to UuidCreate.

Rotor says it uses CoCreateGuid

Richard
Signature

http://www.grimes.demon.co.uk/workshops/fusionWS.htm
http://www.grimes.demon.co.uk/workshops/securityWS.htm

Sahil Malik [MVP] - 09 Oct 2005 07:41 GMT
John,

GUID is a pseudo-random number, it may repeat - but the probability of it's
repetition is so low that you can safely assume that it will never repeat.

The actualy GUID generation algorithm has changed over the years. GUID is
Microsoft's implemetnation of UUID, which is the real standard. GUID at one
point of time contained the network card MAC address info - which meant the
exact machine the GUID came from can be traced back - which sucks, and which
is what was exploited in the mellisa worm.

There exist other algorithms to create UUIDs. If you are interested in
reading a sample, it's right here
http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
----------------------------------------------------------------------------

The hardware info used is the unique chip #, network card info, and
something else that I forget. About 40 bits are assigned to that
> Does anyone know the technique used by System.Guid.NewGuid() to create the
> Guid ?
>
> C# code would be great !

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.