2000-10-31 21:11:28 +08:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
2001-01-24 11:46:16 +08:00
|
|
|
Here are various cryptographic and otherwise useful
|
|
|
|
functions for PostgreSQL.
|
|
|
|
|
|
|
|
encode(data, type)
|
|
|
|
encodes binary data into ASCII-only representation.
|
|
|
|
Types supported are 'hex' and 'base64'.
|
|
|
|
|
|
|
|
decode(data, type)
|
|
|
|
decodes the data processed by encode()
|
2000-10-31 21:11:28 +08:00
|
|
|
|
|
|
|
digest(data::text, hash_name::text)
|
2001-01-24 11:46:16 +08:00
|
|
|
which returns cryptographic checksum over data by
|
2000-10-31 21:11:28 +08:00
|
|
|
specified algorithm. eg
|
|
|
|
|
2001-01-24 11:46:16 +08:00
|
|
|
> select encode(digest('blah', 'sha1'), 'hex');
|
2000-10-31 21:11:28 +08:00
|
|
|
5bf1fd927dfb8679496a2e6cf00cbe50c1c87145
|
|
|
|
|
|
|
|
digest_exists(hash_name::text)::bool
|
|
|
|
which reports if particular hash type exists.
|
|
|
|
|
|
|
|
If any of arguments are NULL they return NULL.
|
|
|
|
|
|
|
|
HASHES
|
|
|
|
|
|
|
|
For choosing library you must edit Makefile.
|
|
|
|
|
|
|
|
standalone (default):
|
|
|
|
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
|
|
|
|
|
2001-03-17 01:42:56 +08:00
|
|
|
ENCRYPTION
|
|
|
|
|
|
|
|
There is experimental version out with encryption, HMAC
|
|
|
|
and UN*X crypt() support in
|
|
|
|
|
|
|
|
http://www.l-t.ee/marko/pgsql/
|
|
|
|
|
|
|
|
Current latest release is pgcrypto-0.3.tar.gz.
|
|
|
|
|
2000-10-31 21:11:28 +08:00
|
|
|
|