Welcome, Guest. Please login or register.

Author Topic: GUID number generator  (Read 3477 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline djrikkiTopic starter

  • Sr. Member
  • ****
  • Join Date: Mar 2010
  • Posts: 346
    • Show only replies by djrikki
GUID number generator
« on: May 05, 2010, 08:12:51 PM »
Hi guys,

I have a software suggestion, I had a quick look around the net couldn't find anything.

Shell program - AGUID - The GUID number generator

Wiki Reference: (http://en.wikipedia.org/wiki/Globally_Unique_Identifier)

Having used AppleScript over the past few months I stumbled on the Mac command line equivalent 'uuidgen' and couldn't find any mention of one on the Amiga platform.

I believe it would be a beneficial shell program to include as standard in OS4.

Argument usage:

AGUID
result: 21EC2020-3AEA-1069-A2DD-08002B30309D / a random guid number is generated

further shell options:

1. AGUID  -c //

eg. AGUID -c DH0:applicationx/?.html

result: shell program generators a random number and checks the directory to see if the file already exists, if the unlikely event it does already exist generator a new number and check again

2. AGUID -f username : password @ ftpsite.example.com/database/

result: same as above but check a remote ftp server directory

3. AGUID -o

result: generated number is written to the given filename or appended

---

Seems like a straightforward program someone could write.  Your thoughts please.:)

Offline BigBenAussie

  • Sr. Member
  • ****
  • Join Date: Feb 2004
  • Posts: 313
    • Show only replies by BigBenAussie
Re: GUID number generator
« Reply #1 on: May 05, 2010, 09:01:31 PM »
Yeah, I remember looking all over for an open source GUID function. One that is standard compliant.

Maybe I don't understand what you are trying to achieve but I doubt it is a good idea to start flooding the filesystem with GUIDs, and it isn't really something that should be promoted.

You might be able to achieve the same effect with a random string creation routine, and there are plenty of those around for various languages. You can achieve similar effects using time stamping down to the millisecond. Combine the two and you'll be fairly sure to have a unique string. Change it to generate a hex string and you might get something like a GUID.
 

Offline Mazze

  • Full Member
  • ***
  • Join Date: Aug 2007
  • Posts: 133
    • Show only replies by Mazze
    • http://mazze-online.de
Re: GUID number generator
« Reply #2 on: May 05, 2010, 09:03:49 PM »
There's source code for a uuid.library in AROS.

Offline djrikkiTopic starter

  • Sr. Member
  • ****
  • Join Date: Mar 2010
  • Posts: 346
    • Show only replies by djrikki
Re: GUID number generator
« Reply #3 on: May 05, 2010, 09:11:00 PM »
@BigBenAssue

I generate a GUID in Applescript to create a unique filename.html for generating online quote and order forms to send on to an ftp server.

I don't use an Amiga atm, but I do hope to purchase the X1000 at some point so I don't have an immediate problem that requires a solution.

I guess it would be a great addition to the standard shell programs as GUID seems like a popular solution to random filename generation.

Offline jorkany

  • Hero Member
  • *****
  • Join Date: Sep 2006
  • Posts: 1009
    • Show only replies by jorkany
    • http://www.amigaos4.com
Re: GUID number generator
« Reply #4 on: May 05, 2010, 09:11:39 PM »
« Last Edit: May 05, 2010, 09:14:35 PM by jorkany »
 

Offline djrikkiTopic starter

  • Sr. Member
  • ****
  • Join Date: Mar 2010
  • Posts: 346
    • Show only replies by djrikki
Re: GUID number generator
« Reply #5 on: May 05, 2010, 09:14:24 PM »
@jorkany

Yeah, but you wouldn't call that from a running application or scripting language.

Offline arnljot

Re: GUID number generator
« Reply #6 on: May 05, 2010, 09:45:53 PM »
The idea is that it´s supposed to be golbally/universally unique.

Baseing the random seed on the system clock isn´t enough. As the seed can then be the same on another computer.

Many GUID generators pick markers from the generating machine that´ll increase the uniqueness of the random seed. The machines MAC address + systen nano time is considered a minimum to achieve a quality seed.
A posting a day keeps the sanity away...
http://www.arnljot.com
 

Offline psxphill

Re: GUID number generator
« Reply #7 on: May 05, 2010, 10:37:00 PM »
Quote from: arnljot;556822
Many GUID generators pick markers from the generating machine that´ll increase the uniqueness of the random seed. The machines MAC address + systen nano time is considered a minimum to achieve a quality seed.

It's uncommon for MAC address to be used. To start with it's not guaranteed to be unique, because some companies re-use the MAC addresses to save on license costs. Also you don't want to give out your MAC address. Lastly with your MAC address taking up so much of the space, it becomes much easier to guess what the next number will be.
 
A good guid generator won't create a predictable sequence http://en.wikipedia.org/wiki/Globally_Unique_Identifier
http://en.wikipedia.org/wiki/Uuid.
 
You really want to be using v5, although Microsoft don't.
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: GUID number generator
« Reply #8 on: May 05, 2010, 10:51:59 PM »
Quote from: psxphill;556830
Also you don't want to give out your MAC address.
Why not?

Quote
Lastly with your MAC address taking up so much of the space, it becomes much easier to guess what the next number will be.
I agree it would be stupid to use mac address as the sole seed for a RNG, but it certainly can be part of it. Certainly I can't see how adding some bits could make it less secure (especially when often the other party cannot predict what the bits are).
 

Offline arnljot

Re: GUID number generator
« Reply #9 on: May 05, 2010, 10:54:59 PM »
Yep, I knew that the GUID wouldn´t be "private" and there is the issue of MAC reuse as you point out. I didn´t know about the difference between UUID and GUID, I thought it was a case of "dear child with many names", and I hadn´t caught the ISO standard. Good links with lots of nice tech reading :)

Especially liked to follow the link to the SHA-1 pseudo code.
A posting a day keeps the sanity away...
http://www.arnljot.com
 

Offline arnljot

Re: GUID number generator
« Reply #10 on: May 05, 2010, 10:59:11 PM »
Quote from: Piru;556831
Why not?


I think the worry comes from virus makers :) LOL, apparently the melissa worm creator was identified as the worm held a GUID from his machine. With the predictable way the GUIDs are created, they were able to tell which machine created it at what time.

Never quite gotten the paranoia with MAC addresses either. Each time you see some screenshot MAC is blurred out :-?

I understand that Playstation3 hackers blur theirs out so that Sony can´t find them. But I can´t see how anyone can do an ID theft using your MAC address.
A posting a day keeps the sanity away...
http://www.arnljot.com
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: GUID number generator
« Reply #11 on: May 05, 2010, 11:03:57 PM »
Quote from: arnljot;556833
I think the worry comes from virus makers :) LOL, apparently the melissa worm creator was identified as the worm held a GUID from his machine. With the predictable way the GUIDs are created, they were able to tell which machine created it at what time.

Never quite gotten the paranoia with MAC addresses either. Each time you see some screenshot MAC is blurred out :-?

I understand that Playstation3 hackers blur theirs out so that Sony can´t find them. But I can´t see how anyone can do an ID theft using your MAC address.

I'd only hide my wireless device mac address, and mostly because of this:
http://samy.pl/mapxss/
 

Offline LoadWB

  • Hero Member
  • *****
  • Join Date: Jul 2006
  • Posts: 2901
  • Country: 00
    • Show only replies by LoadWB
Re: GUID number generator
« Reply #12 on: May 05, 2010, 11:39:01 PM »
For the purposes of generating customer quotes, why not just do something like hashing the current time plus some random salt?

I have a simple "ticketing" system I use which takes the current date and time in full ASCII glory, adds 32 bytes from the system's RNG, then runs that through a simple hash.

This makes a more manageable number, but for the purposes of random directories, invoices, etc., passing the result through MD5 or SHA1 should produce sufficiently long enough randomized quote IDs.

Sure, there is a predictive attack on that, but one would have to be pretty determined and know the exact second (in your system time) you submitted the quote, as well as the predictability of your random number generator.

So then the question becomes, does AmigaOS4 have a date command which outputs the full date and time, or perhaps a timestamp, as well as any hashing commands?

Just a thought.