From owner-freebsd-questions Sun Dec 19 20:49: 7 1999 Delivered-To: freebsd-questions@freebsd.org Received: from guppy.pond.net (guppy.pond.net [205.240.25.2]) by hub.freebsd.org (Postfix) with ESMTP id 7814515266; Sun, 19 Dec 1999 20:49:03 -0800 (PST) (envelope-from ptacek@dashmail.net) Received: from Ptacek (rc1s7p8.dashmail.net [216.36.33.80]) by guppy.pond.net (8.9.3/8.9.3) with SMTP id UAA22312; Sun, 19 Dec 1999 20:42:25 -0800 (PST) Message-ID: <001501bf4aa5$45e29640$502124d8@Ptacek> From: "Ptacek" To: , Subject: DES routines? Date: Sun, 19 Dec 1999 20:47:07 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I am looking for some routines to perform DES encryption in electronic code book mode. I have found the ecb_cyrpt function, however when I try and use it the buffer is not encrypted. Am I missing something, do these functions not work, and is there a better way of doing this? Below I have included a basic test program I am using to try and get the encryption working. Thanks for any help, - Chris ---------------------------------------------------- #include #include #include int main() { char testbuf[16] = {0x00,0x01,0x02,0x03,0x04, 0x05,0x06,0x07,0x08,0x09, 0x0a,0x0b,0x0c,0x0d,0x0e, 0x0f} ; char testkey[8] = {0x01,0x02,0x03,0x04, 0x05,0x06,0x07,0x08} ; int status ; int i ; des_setparity(testkey) ; status = ecb_crypt(testkey, testbuf, 16, DES_HW | DES_ENCRYPT) ; printf("status=%d\n", status) ; for(i=0; i<16; i++) { printf("%02x ", (unsigned char)testbuf[i]) ; } exit(0) ; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message