Simple encryption functions in Linux!

Sanjay Darisi plug-devel@lists.PLUG.phoenix.az.us
Mon Nov 8 13:57:02 2004


This is a multi-part message in MIME format.

------_=_NextPart_001_01C4C5E5.62DAA4C2
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable




Is there any simple text encryption functions available to use in a C =
program in Linux. I've found encrypt/decrypt functions that are part of =
libcrypt library. I couldn't figure out how to use them .=20

The manual page has=20

#include <crypt.h>

main() {
  char key[64];      /* bit pattern for key */
  char txt[64];      /* bit pattern for messages */
  setkey(key);
  encrypt(txt, 0);   /* encode */
  encrypt(txt, 1);   /* decode */
}

this example and says that to do useful work the key[] and txt[] array =
must be filled with a useful bit pattern.I have tried with normal =
string, it doesn't do anything. Has anybody used these functions =
before?? Any ideas how to use these functions??=20

Or are there any other encryption/decryption functions that I can use in =
my C program?? All I need to do is read some text from a file and =
encrypt it and may or may not write it back.=20



http://www.TechiesAbode.com/


------_=_NextPart_001_01C4C5E5.62DAA4C2
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7226.0">
<TITLE>Simple encryption functions in Linux!</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>
<BR>
<BR>

<P><FONT SIZE=3D2>Is there any simple text encryption functions =
available to use in a C program in Linux. I've found encrypt/decrypt =
functions that are part of libcrypt library. I couldn't figure out how =
to use them .<BR>
<BR>
The manual page has<BR>
<BR>
#include &lt;crypt.h&gt;<BR>
<BR>
main() {<BR>
&nbsp; char key[64];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* bit pattern for =
key */<BR>
&nbsp; char txt[64];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* bit pattern for =
messages */<BR>
&nbsp; setkey(key);<BR>
&nbsp; encrypt(txt, 0);&nbsp;&nbsp; /* encode */<BR>
&nbsp; encrypt(txt, 1);&nbsp;&nbsp; /* decode */<BR>
}<BR>
<BR>
this example and says that to do useful work the key[] and txt[] array =
must be filled with a useful bit pattern.I have tried with normal =
string, it doesn't do anything. Has anybody used these functions =
before?? Any ideas how to use these functions??<BR>
<BR>
Or are there any other encryption/decryption functions that I can use in =
my C program?? All I need to do is read some text from a file and =
encrypt it and may or may not write it back.<BR>
<BR>
<BR>
<BR>
<A =
HREF=3D"http://www.TechiesAbode.com/">http://www.TechiesAbode.com/</A><BR=
>
<BR>
</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C4C5E5.62DAA4C2--