[ANNC][RFC] crypto hashes for PostgreSQL 7.0, 7.1

From: Marko Kreen <marko(at)l-t(dot)ee>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [ANNC][RFC] crypto hashes for PostgreSQL 7.0, 7.1
Date: 2000-10-19 17:22:20
Message-ID: 20001019192219.A23645@l-t.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

http://www.l-t.ee/marko/pgsql/pgcrypto-0.1.tar.gz (11k)

Here is a implementation of crypto hashes for PostgreSQL.
It exports 2 functions to SQL level:

digest(data::text, hash_name::text)
which returns hexadecimal coded hash over data by
specified algorithm. eg

> select digest('blah', 'sha1');
5bf1fd927dfb8679496a2e6cf00cbe50c1c87145

(I see no point returning binary hash.. ??)

digest_exists(hash_name::text)::bool
which reports if particular hash type exists.

It can be linked with various libraries:

standalone:
MD5, SHA1

(the code is from KAME project. Actually I hate code
duplication, but I also want to quarantee that MD5 and
SHA1 exist)

mhash (0.8.1):
MD5, SHA1, CRC32, CRC32B, GOST, TIGER, RIPEMD160,
HAVAL(256,224,192,160,128)

openssl:
MD5, SHA1, RIPEMD160, MD2

kerberos5 (heimdal):
MD5, SHA1

As you can see I am thinking making MD5 and SHA1 standard.

And yes, it could be made 'standalone only' but in case of
OpenSSL and mhash the code is imported very cleanly (my
code has no hard-wired hashes) ???

The code should also be 8-bit clean and TOAST-enabled - but
I am not 100% sure. And if is declared as digest(text,text)
does it work on bytea?

It is packaged at the moment as stand-alone package, because
I am trying to write general autoconf macros for use with outside
packages. At the moment any package author must generate those
himself. Also the contrib stuff should be possible to make use
of this instead of include ../../Makefile.* so they can enjoy
the same (dis)advantages as outside packages.

Status:

C code - stable
autoconf - beta
make install - does not work

If there is interest I can package it as a contrib or even
mainstream diff against CVS ???

--
marko

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Karel Zak 2000-10-19 17:31:28 Re: [ANNC][RFC] crypto hashes for PostgreSQL 7.0, 7.1
Previous Message Tom Lane 2000-10-19 17:17:58 Re: make depend (Re: Coming attractions: VPATH build; make variables issue)