1

Say, for example, I generate a time based UUID with the following program.

import uuid
uuid = uuid.uuid1()
print uuid
print uuid.time

I get the following:

47702997-155d-11ea-92d3-6030d48747ec
137946228962896279

Can I get back the original UUID, that is 47702997-155d-11ea-92d3-6030d48747ec, if I know the timestamp (137946228962896279)?

I am reading about UUID version 1 and found a few programs that "kind" of tries to reverses it, but, every time, I am getting a different UUID.

The part that is always changing are the timestamp part (last 4 digits of the first block - 47702997) and the clock_sequence (92d3).

If it is possible to get back the original UUID, what would I need?

Any help/direction is greatly appreciated.

I also made a post in Security Stackexchange but later realized that this question should have been posted here.

The more I look into it, I can see that this is not at all possible since the timestamp does not contain information on the clock_sequence unless I am wrong, in which case, please correct me.

Peter O.
  • 32,158
  • 14
  • 82
  • 96
Haunted
  • 345
  • 1
  • 2
  • 11
  • Would be helpful to see the answers to your mentioned "post in Security Stackexchange", can you add the link here? – hc_dev Mar 16 '21 at 05:55

1 Answers1

2

A UUIDv1 contains two main pieces: a temporally unique part (aka timestamp) and a spatially unique part. By design, the two are completely independent, so if you throw one of the pieces away, there is no way to recover it later from the other one.

More generally, notice how the entire UUID is 32 hexadecimal digits, or 128 bits of information, but the timestamp is 18 decimal digits, or only about 60 bits of information. Even without knowing much about UUIDs you could guess that some of the bits are redundant or fixed (and a few are fixed, or at least guessable), but over half of them? Not likely, which means this translation is not reversible.

StephenS
  • 1,813
  • 13
  • 19