how to write a program that encrypts files