This code can encrypt, decrypt any text file, excel file and images through Twofish Encryption Algo. More-over commented section include the code to generate the database for login of users.
After having this code, you can directly call the built in functions like - encrypt(filename) - to encrypt any type of file(.txt, .png, .csv) decrypt_txt(filename) - to decrypt text file. decrypt_csv(filename) - to decrypt csv file. decrypt_img(filename) - to decrypt img file.