encrypt and decrypt using encrypt(char block[64], int edflag)
From: rockwell (rockwell_001_at_yahoo.com)
Date: 07/25/04
- Previous message: Ian Hilliard: "Re: How to open a file in share mode"
- Next in thread: Jens.Toerring_at_physik.fu-berlin.de: "Re: encrypt and decrypt using encrypt(char block[64], int edflag)"
- Reply: Jens.Toerring_at_physik.fu-berlin.de: "Re: encrypt and decrypt using encrypt(char block[64], int edflag)"
- Reply: David Schwartz: "Re: encrypt and decrypt using encrypt(char block[64], int edflag)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 25 Jul 2004 01:40:35 -0700
Hi groups i am trying to encrypt and decrypt back a block of data .I
am using the standard encrypt(char block[64], int edflag) function. I
have written a small program which should do this according to the man
page.the program looks like
#include <stdio.h>
#include <unistd.h>
#include <crypt.h>
int main(void)
{
char key[64];
char txt[64]="myblockofdata";
strcat(key, "thisismystring");
printf("Before encrypting");
printf("txt is %s",txt);
printf("\n");
setkey(key);
printf("After encrypting");
encrypt(txt, 0);
printf("txt is %s",txt);
printf("\n");
printf("After decrypting");
encrypt(txt, 1);
printf("txt is %s",txt);
printf("\n");
return 0;
}
but this program does not display any thing except the string before
encrypting.Can u suggest me what to do and how to proceed. According
to the manpage on encrypt it just says if edflag is 0 it encrypts and
if edflag is 1 it decrypts and i even want to know what does this mean
void setkey(const char *key). The key parameter used here is an array
of bytes, having each byte the numerical value 1 or 0. Does this mean
that the key parameter should contain only 0's and 1's.I would be very
thankful if you can answer me. If this is not the proper group can you
please direct me to a proper group.
Thanks in advance.
- Previous message: Ian Hilliard: "Re: How to open a file in share mode"
- Next in thread: Jens.Toerring_at_physik.fu-berlin.de: "Re: encrypt and decrypt using encrypt(char block[64], int edflag)"
- Reply: Jens.Toerring_at_physik.fu-berlin.de: "Re: encrypt and decrypt using encrypt(char block[64], int edflag)"
- Reply: David Schwartz: "Re: encrypt and decrypt using encrypt(char block[64], int edflag)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|