Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encrypt\Decrypt File

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
Hello,

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?

Thanks,

Michael42
 
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.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
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.

Hope this helps

Wullie

Fresh Look - Quality Coldfusion/Windows Hosting

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top