How can I create an ASCII file (via cffile etc.) and encrypt it when writing it to disk and decrypt it when opening it for viewing\chaning it on an HTML\ColdFusion form?
easiest thing to do is use the encryption functions in cf when creating the text file (not after) then use the same key to decrypt the variable (text) that comes out of the file.
We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
To be honest, what you are trying to do is likely to be pretty useless in the long run. Doing this, the only people you are hiding the scripts from are really the people with access to the server as nobody else could see them anyway.
However, for you to decrypt a file you need to have the decryption code on the server, so anyone with access to the server would be able to decrypt it if they wanted.
I should have mentioned, I was assuming this would be pulled in and automatically decrypted. If this is not the case, just have a field where you enter the decryption key when you want to pull the file in, then you don't need to store it anywhere on the server.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.