Re: Sequences/defaults and pg_dump

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: nikolay(at)samokhvalov(dot)com
Cc: PostgreSQL-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Sequences/defaults and pg_dump
Date: 2006-02-10 06:28:00
Message-ID: 20060210062800.GB26002@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Tue, Feb 07, 2006 at 15:28:31 +0300,
Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com> wrote:
> The real situation would be as the following.
> I want to use some algorithm to hide real number of registered users
> in my table user. So, I don't want to use simple sequence, when every
> new registered user in my system can guess what is the number of
> registered users simply observing his ID. So, I use following
> algorithm:
> (nextval('...name of the sequnence...') * N) mod % M,
> where N and M are quite big numbers that have no common multiples
> besides 1 (sorry, do not remember the English term for those numbers
> ;-) ).

(N and M are said to be "relatively prime".)

The above method isn't very secure. You might be better off using a block
cipher in counter mode, depending on how badly you want to keep the number
of users secret. Even that won't be foolproof as the users might cooperate
with each other to estimate how many of them there are.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rick Gigger 2006-02-10 07:08:40 Re: Database Comparison tool?
Previous Message Michael Fuhr 2006-02-10 04:40:34 Re: Is there a way to limit CPU usage per user

Browse pgsql-hackers by date

  From Date Subject
Next Message Dave Page 2006-02-10 08:24:22 FW: PGBuildfarm member snake Branch HEAD Status changed from OK to ContribCheck failure
Previous Message Marko Kreen 2006-02-10 06:06:04 Re: streamlined standby procedure