I'm not even sure where to begin on this, but I'll give it a shot:
Code:
fread(file, 1000, 150, fp);
Where did you come up with 1000 and 150? Doing 1 and sizeof(file) would make a lot more sense. You're also using way more stack space than you need to. You could read the file in in chunks until you reach EOF. encrypt and decrypt could be dynamically allocated so it only takes up as much space as it really needs to.
Code:
if(fp == NULL)
{
puts("No such file or directory.");
}
else{
fread(file, 1000, 150, fp);
}
So...if the file can't be opened you print an error message and don't try to read the file (which is good), but then you go on to to process file as though something had been read into it (which is bad). For this program, it would probably be best to just print the error message and exit the program if the file can't be opened.
Code:
//checks for total number of characters in document
If you use my above suggestion for fread(), fread() will return the number of characters in the file! If you use the tools at hand correctly, things tend to be a lot easier.
Code:
for(x = 0; x < count; x++){
encrypt[x] = file[x] ^ key[x];
}
printf("%s", encrypt);
Are you sure encrypt[x] is being set to a printable character? If not, you're going to have an awfully hard time printing it that way.