Re: What libraries need to be included in C program for encrypt and decrypt functions?

Поиск
Список
Период
Сортировка
От Owen Jacobson
Тема Re: What libraries need to be included in C program for encrypt and decrypt functions?
Дата
Msg-id 000101c5a27f$2d35e420$9b00015a@osl.com
обсуждение исходный текст
Ответ на What libraries need to be included in C program for encrypt and decrypt functions?  (The One <i51359@yahoo.com>)
Список pgsql-sql
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

В списке pgsql-sql по дате отправления:

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: ARRAYs and INDEXes ...
Следующее
От: The One
Дата:
Сообщение: how to do a select * and decrypt a column at the same time?