Xref: utzoo comp.lang.c:8280 sci.crypt:969 Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!ut-sally!ut-emx!auscso!jboede From: jboede@auscso.UUCP (Jon Boede) Newsgroups: comp.lang.c,sci.crypt Subject: crypt(3) DES routines Message-ID: <2615@auscso.UUCP> Date: 18 Mar 88 04:23:51 GMT Organization: Austin Unix Users Group, Austin, TX Lines: 52 Keywords: encrypt, setkey I posted a question on this a while back and it was summarily ignored, perhaps because it's such an easy question... anyhow, I'm still trying to get it to work. What I'm looking for is a function that will encrypt or decrypt a string passed to it using the DES functions in the standard library. I have a v7 manual that documents this and it seems fairly simple yet I continue to have no luck. Assuming that I could attack a while string in 8 character (64 bit) chunks, I've written the following which fails nicely because I immediately encrypt then decrypt the bit array (block of chars) and I don't get back what I put in! Thanks, Jon main() { char blk2[64], text[32], block[64], key[9]; register bit, loop; strcpy(key,"xyzzy678"); /* load and set the key block */ for (loop=0; loop < 8; loop++) { for (bit=0; bit < 8; bit++) block[loop*8+bit] = ((int)key[loop] & (1<