Re: Sequence on a char(6) column - Mailing list pgsql-novice

From Roland Giesler
Subject Re: Sequence on a char(6) column
Date
Msg-id TAXNET01WupM4SEwD9m000000c8@frontdoor.taxpoint.co.za
Whole thread Raw
In response to Re: Sequence on a char(6) column  (Bruno Wolff III <bruno@wolff.to>)
Responses Re: Sequence on a char(6) column  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-novice
Bruno Wolff III wrote:
>> One option is to use a cipher (such as AES) in counter mode (you need
>> to keep the key secret, but that shouldn't be a significant
>> additional risk as you are keeping the ids in the database) and use
>> the encrypted string to generate the string. The counter can be a
>> sequence. You won't get duplicates as longer as the counter isn't
>> reset and you don't change the key.
>
> I forgot something important. For there not to be duplicates
> the function from the encrypted string to the member id needs
> to be 1-1 (injective).
> Your member code has just over 24 bits of information, so you
> want to find a cipher that works on blocks of 24 bits. You
> might have trouble finding strong ciphers that work on 24 bit blocks.

I'm sorry, Bruno, I'm not following.  I will probably understand what you
mean if fill in a little more detail.  The pgsql terminology is still a bit
foreign to me, would you mind just elaborating a little on what you are
proposing?  (Maybe I'm just a bit thick-heading about this.  It may dawn on
me soon)

Thanks in anticipation,

Roland



pgsql-novice by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Sequence on a char(6) column
Next
From: Bruno Wolff III
Date:
Subject: Re: Sequence on a char(6) column