Actually, I don't know how may ways it can be done.
In my project, I have a ".txt" file that is including data. So, I don't want the user to see or view them. That's why I would like to encryption. Some parts of project will need to read them again and then I need to do the decryption.
Can you show me which way will be better and secure?
You can write ascii codes instead of strings later you can eazy convert them to data you need, or use any other function that will mask your input in file and use same function to get data back or you can transfer number into different numbering system and do it on different level.
a is 61 in decimal you can convert it to binary 00111101 now you can mask it to add few bits in front word and after word for example i will add 1010(00111101)0101 now if you write that to file in decimal system you will get 41941.