Re: Sequence on a char(6) column

From: "Roland Giesler" <roland(at)giesler(dot)za(dot)net>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Sequence on a char(6) column
Date: 2005-12-15 04:05:17
Message-ID: TAXNET01WupM4SEwD9m000000c8@frontdoor.taxpoint.co.za
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2005-12-15 04:37:42 Re: Sequence on a char(6) column
Previous Message Bruno Wolff III 2005-12-15 03:10:48 Re: Sequence on a char(6) column