From i51359@yahoo.com Tue Aug 16 13:59:42 2005 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4F83E52952 for ; Tue, 16 Aug 2005 10:59:42 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 89455-06 for ; Tue, 16 Aug 2005 13:59:39 +0000 (GMT) Received: from web33902.mail.mud.yahoo.com (web33902.mail.mud.yahoo.com [66.163.178.66]) by svr1.postgresql.org (Postfix) with SMTP id D1820528B4 for ; Tue, 16 Aug 2005 10:59:37 -0300 (ADT) Received: (qmail 80370 invoked by uid 60001); 16 Aug 2005 13:59:40 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=V6UrvGOh61gDkIfz65P+yeq2fpXvZjuzibmZ9rxKEmKFuEOeoSUZ2IyFebxaemJ+CErGWq9tq7Cp8BXZwU6ReTNy5VVgis5N8BlFDzY6z93LAZSdUMcEjMuAxVQPUHk7pL6squy6lHKQQQcRoOFXMySXFKD7wabMNIdOxZNLMT4= ; Message-ID: <20050816135940.80368.qmail@web33902.mail.mud.yahoo.com> Received: from [68.209.250.7] by web33902.mail.mud.yahoo.com via HTTP; Tue, 16 Aug 2005 06:59:40 PDT Date: Tue, 16 Aug 2005 06:59:40 -0700 (PDT) From: The One Subject: What libraries need to be included in C program for encrypt and decrypt functions? To: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-619883052-1124200780=:80334" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.078 required=5 tests=[AWL=0.131, DNS_FROM_RFC_ABUSE=0.374, FROM_ENDS_IN_NUMS=0.516, HTML_30_40=0.056, HTML_MESSAGE=0.001] X-Spam-Level: * X-Archive-Number: 200508/113 X-Sequence-Number: 22341 --0-619883052-1124200780=:80334 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 --0-619883052-1124200780=:80334 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
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 --0-619883052-1124200780=:80334-- From ojacobson@osl.com Tue Aug 16 16:26:09 2005 X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C41575288E for ; Tue, 16 Aug 2005 13:26:09 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 28851-03 for ; Tue, 16 Aug 2005 16:26:06 +0000 (GMT) Received: from svr2.postgresql.org (svr2.postgresql.org [65.19.161.25]) by svr1.postgresql.org (Postfix) with ESMTP id 68E5252888 for ; Tue, 16 Aug 2005 13:26:06 -0300 (ADT) Received: from mail.osl.com (216-21-133-98.ip.van.radiant.net [216.21.133.98]) by svr2.postgresql.org (Postfix) with ESMTP id D4EE1F0C14 for ; Tue, 16 Aug 2005 17:21:46 +0100 (BST) Received: from scottpj ([90.1.0.155]) (authenticated) by mail.osl.com (8.11.6/8.11.2) with ESMTP id j7GGQ5c08771 for ; Tue, 16 Aug 2005 09:26:05 -0700 From: "Owen Jacobson" To: 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> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0002_01C5A244.80D97D20" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Importance: Normal In-Reply-To: <20050816135940.80368.qmail@web33902.mail.mud.yahoo.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.093 required=5 tests=[AWL=-0.044, FORGED_RCVD_HELO=0.05, HTML_40_50=0.086, HTML_MESSAGE=0.001] X-Spam-Level: X-Archive-Number: 200508/115 X-Sequence-Number: 22343 This is a multi-part message in MIME format. ------=_NextPart_000_0002_01C5A244.80D97D20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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 ------=_NextPart_000_0002_01C5A244.80D97D20 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
As I=20 mentioned in email, the function "encrypt" exposed by libcrypt (the = -lcrypt part=20 of your command line) has nothing to do with the "encrypt" function = available in=20 pgcrypto.sql, which You Cannot Call From C.  You have to embed = calls to it=20 inside an SQL query like
 
INSERT=20 INTO some_table (some_col) VALUES (ENCRYPT ('Hello', 'AAAA0000',=20 'aes'));
-----Original Message-----
From:=20 pgsql-sql-owner@postgresql.org = [mailto:pgsql-sql-owner@postgresql.org]On=20 Behalf Of The One
Sent: Tuesday, August 16, 2005 7:00=20 AM
To: pgsql-sql@postgresql.org
Subject: [SQL] = What=20 libraries need to be included in C program for encrypt and decrypt=20 functions?

Hi,
 
Can some body tell me what I need to include in the makefile for = my C=20 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=20 -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
 
 


St= art=20 your day with Yahoo! - make it your home page = ------=_NextPart_000_0002_01C5A244.80D97D20--