I made a program in C which encrypted a text message
the output is in the attached file could you please crack it.

also im putting my prog below so if you could play devils advocate with it
(and sorry but posting ruined my indentation)

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#define BUFF_SIZE 512

int encrypt(void);
int decrypt(void);

int main()
{
int choice,was_error=0,for_pause;
printf("encryption program menu\n");
printf("1. encryption\n");
printf("2. decryption\n");
printf("enter yor choice:- ");
scanf("%d",&choice);
printf("\n");
switch(choice)
{
case 1:
fflush(stdin);
was_error=encrypt();
break;

case 2:
fflush(stdin);
was_error=decrypt();
break;

default:
printf("you entered an invalid choice\n");
break;
}
if (was_error==-1)
printf("\nan error occured task unsucessfull\n");
else
printf("\ntask completed sucessfully\n");
scanf("%d",&for_pause);
return(0);
}

int encrypt(void)
{
int i;
FILE *fencrypt;
char string[BUFF_SIZE],first_half,second_half,second_encrypt;
char first_encrypt,first_bluff;
fencrypt =fopen("encrypt.txt","wa");
if(fencrypt!=NULL)
{
printf("enter the text\n");
i=0;
gets(string);
while((string[i]!=NULL)||(string[i]!='\0'))
{
first_half=(string[i]&240);
second_half=(string[i]&15);
first_encrypt=(first_half^i);
second_encrypt=(second_half^(BUFF_SIZE-i));
if(rand()%2==0)
first_bluff=65+(rand()%65);
else
first_bluff= 97+(rand()%97);
fprintf(fencrypt,"%c%c%c",first_encrypt,first_bluff,second_encrypt);
printf("%c%c%c",first_encrypt,first_bluff,second_encrypt);
i++;
}
fprintf(fencrypt,"\n");
fclose(fencrypt);
return(0);
}
else
return(-1);
}

int decrypt(void)
{
char fname[32],first_half,trash,first_encrypt,second_encrypt;
char second_half,letter;
FILE *fencrypted,*fdone;
int i=0,words_scanned=0;
printf("enter the file name of the file to be decrypted: ");
scanf("%s",&fname);
fencrypted = fopen(fname,"r");
if(fencrypted!=NULL)
{
fdone=fopen("decrypted.txt","w");
if(fdone!=NULL)
{
while(!feof(fencrypted))
{
switch(i)
{
case 0:
first_encrypt=fgetc(fencrypted);
first_half=(first_encrypt^words_scanned);
i=1;
break;
case 1:
trash=fgetc(fencrypted);
i=2;
break;
case 2:
second_encrypt=fgetc(fencrypted);
i=0;
second_half=(second_encrypt^(BUFF_SIZE-words_scanned));
letter=(first_half|second_half);
fputc(letter,fdone);
printf("%c",letter);
words_scanned++;
break;
}
}
fclose(fdone);
fclose(fencrypted);
return(0);
}
else
return(-1);
}
else
return(-1);
}