Try opening the encrypted file in binary mode when you're reading and writing to it.

Also try
Code:
char encrypt(char letter, int pass, int i)
{
     return letter;
}
to make sure your basic file handling is OK. If the output isn't a copy of the input, you need to address that problem first.