Re: Unique number generation

From: Unruh (unruh-spam_at_physics.ubc.ca)
Date: 04/29/05


Date: 29 Apr 2005 14:10:27 GMT

paul@atom.sbrk.co.uk writes:

>I'd like to be able to generate some secure unique numbers. A simple
>implementation might be val = encrypt(secret, seq_no), however that
>doesn't ensure that the numbers will be unique. Ok, I could remove

Yes, it does. If secret is the same for all numbers then val is unique if
seq_no is. Encryption is a one-one and onto map.

>duplicates afterwards, but it would be nice if there were an algorithm
>that ensures that f(secret, n) != f(secret, m) for any n!=m. Ok, some
>form of x|(encrypt(secret,x) ensures that but I don't want to reveal
>the sequence number either. Any ideas?

encrypt(secret,x) ensures that. Otherwise how could you decrypt?



Relevant Pages

  • Re: UserNameTokens + Password.SendNone Implimentation
    ... That is the one weakness in this system is that once the secret ... > AES step. ... The idea using the AES encryption of the data is that if they decrypt the ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: Rolling codes and vehicle locks
    ... code, sequence number, and a "secret". ... Unless the car transmits a unique shared secret key to the fob (very ...
    (comp.arch.embedded)
  • Re: Same Inputs, different output = No searching
    ... You can decrypt the copy in DB and then compare, ... I don't to store the SSN plaintext in the ... >, encrypt that, and search on that value. ... > secret always equals the same encrypted value. ...
    (microsoft.public.platformsdk.security)
  • Re: Cocaine in ancient Egypt?
    ... trade. ... >> None this equates to the type of map being discussed by Eric? ... and then the post went on to discuss possible Atlantic crossings for ...
    (sci.archaeology)
  • Re: 300 Mechanics 300 Days
    ... saving and looking at the map. ... What secret information? ... Your game doesn't have secret tricks and easter eggs for the "power ... That's so incredibly lame, man, you have no ide how to be 1337. ...
    (rec.games.roguelike.development)