encrypting data files

im creating a program that will grab data of a txt file.. but i was wondering is there a module or a function that i can use to encrypt the txt file so it wont be as human readable? maybe convert it in to hex or bin or etc.. or what ever is recommended