linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Håkon Hallingstad" <hakon@ion.no>
To: linux-c-programming@vger.kernel.org
Subject: Re: Order preserving encryption of numeric data
Date: Tue, 17 May 2005 13:47:20 +0200	[thread overview]
Message-ID: <20050517114720.GA19119@hydrogen.ion.no> (raw)
In-Reply-To: <4e829fd30505170235691da664@mail.gmail.com>

The ordering breaks the strength of any cipher.

Let us assume we know crypt(a), and want to find 'a'. Then we could do
a binary search for 'a' starting with a = M/2., where M :=
max(crypt(a)). And so we could find 'a' after lg(M) iterations.

If this cipher would have comparable strength to today's ciphers, this
would mean lg(M) ~ 2^90., or M ~ 10^(3 10^26), unrepresentable by
todays computers.

Regards,
Håkon Hallingstad

On Tue, May 17, 2005 at 03:05:52PM +0530, Anindya Mozumdar wrote:
> Hi,
>     Dont know whether this is an appropriate question to ask in this
> list, but someone experienced in dealing with such a situation could
> help.
> 
>     I would like an algorithm which will encrypt/decrypt numeric data
> using a key, such that after encryption their orders will be
> preserved,i.e, if crypt(a) denotes the encrypted form of a, and a < b,
> then crypt(a) < crypt(b). ( Note that this assumes that the algorithm
> will produce crypted data which can actually be ordered ). Of course,
> something like a -> ma + n, where m and n are constants would work,
> but I would like something more nontrivial.
> 
>     The order preserving property is necessary as the crypted data
> will be stored in a database, and I would like to issue database
> queries on them. ( The other solution is to retrieve all values from
> the database, decrypt them, and find the appropriate subset, but that
> would be too expensive ).
> 
> Thanks.
> Anindya.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2005-05-17 11:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-17  9:35 Order preserving encryption of numeric data Anindya Mozumdar
2005-05-17 11:47 ` Håkon Hallingstad [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050517114720.GA19119@hydrogen.ion.no \
    --to=hakon@ion.no \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).