encryption and decryption of files mostly working