It looks like you're new here. If you want to get involved, click one of these buttons!
#include <stdio.h>
#define ENCRYPTION (int)Byte + 30
#define DECRYPTION (int)Byte - 30
int Encrypt(char *file, char* newfile)
{
FILE *in, *out;
char Byte, newByte;
in = fopen(file, \"rb\");
out = fopen(newfile, \"w\");
if(in == NULL || out == NULL)
{
printf(\"error in\");
}
else
{
printf(\"File opend, Encrypting...\");
while(1)
{
printf(\".\");
if(Byte != EOF)
{
Byte=fgetc(in);
newByte=Byte+30;
fputc(newByte, out );
}
else
{
printf(\"End of File\");
break;
}
}
fclose(in);
fclose(out);
}
}
int Decrypt(char *file, char *newfile)
{
FILE *in,*out;
char Byte, newByte;
in = fopen(file, \"rb\");
out = fopen(newfile, \"w\");
if(in == NULL || out == NULL)
{
printf(\"Erro\");
}
else
{
printf(\"File Opened, Decrypting\");
while(1)
{
printf(\".\");
if(Byte!=EOF)
{
Byte = fgetc(in);
newByte = Byte-30;
}
else
{
printf(\"End of file\");
break;
}
}
fclose(in);
fclose(out);
}
if(in == NULL || out == NULL)
{
printf(\"Erro\");
}
int Encrypt(char *file, char* newfile)
int Encrypt(char *file, char* newfile)
Same goes for me, I'd really appreciate it if you commented your code so I can follow it a bit better :)