pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Owen Jacobson <ojacobson@osl.com>
To: pgsql-sql@postgresql.org
Subject: Re: What libraries need to be included in C program for encrypt and decrypt functions?
Date: Tue, 16 Aug 2005 09:25:53 -0700
Message-ID: <000101c5a27f$2d35e420$9b00015a@osl.com> (raw)
In-Reply-To: <20050816135940.80368.qmail@web33902.mail.mud.yahoo.com>

As I mentioned in email, the function "encrypt" exposed by libcrypt
(the -lcrypt part of your command line) has nothing to do with the "encrypt"
function available in pgcrypto.sql, which You Cannot Call From C.  You have
to embed calls to it inside an SQL query like

INSERT INTO some_table (some_col) VALUES (ENCRYPT ('Hello', 'AAAA0000',
'aes'));
  -----Original Message-----
  From: pgsql-sql-owner@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org]On Behalf Of The One
  Sent: Tuesday, August 16, 2005 7:00 AM
  To: pgsql-sql@postgresql.org
  Subject: [SQL] What libraries need to be included in C program for encrypt
and decrypt functions?


  Hi,

  Can some body tell me what I need to include in the makefile for my C
program so it will call the correct encrypt/decrypt functions.

  This is what I have in the makefile
  testcrypto:
    ${CC} -o ${BIN}/testcrypto.exe
testcrypto.c -I/usr/include/postgresql/server/libpq -L/lib/postgresql -lpq -
lcrypt

  I'm calling the function like this
  printf("test encryption: %s", encrypt("hello", "0000BBBB", "aes");

  But I'm getting too many arguments in function encrypt.

  Thank you




----------------------------------------------------------------------------
--
  Start your day with Yahoo! - make it your home page

view thread (2+ messages)

Message-ID: <000101c5a27f$2d35e420$9b00015a@osl.com>
Permalink:  ../000101c5a27f$2d35e420$9b00015a@osl.com/
Also on:    postgresql.org/message-id/000101c5a27f$2d35e420$9b00015a@osl.com

 · 

reply

Reply instructions:

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

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ojacobson@osl.com
  Subject: Re: What libraries need to be included in C program for encrypt and decrypt functions?
  In-Reply-To: <000101c5a27f$2d35e420$9b00015a@osl.com>

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

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox