Skip to main content
New Participant
May 23, 2018
Question

How to encrypt a file in coldfusion?

  • May 23, 2018
  • 2 replies
  • 1311 views

I have the necessity to encrypt an excel file generated by a web application developed by myself with Coldfusion. Currently my organization is using a third party software for accomplish the encryption piece with a PGP tool . My goal is to accomplish the encryption the excel file directly in the web application.

Any suggestion on how to accomplish this?

Thanks

This topic has been closed for replies.

2 replies

Inspiring
August 8, 2019

Another option is to add the excel file as an attachment to a PDF then password protect the pdf, which basically means encrypting the PDF and its contents.  All of which can be done with CF.

WolfShade
Brainiac
May 23, 2018

ColdFusion has EncryptBinary() and DecryptBinary() functions that might do what you need.

HTH,

^ _ ^

Charlie Arehart
Community Expert
May 23, 2018

I would think that if you mean you want to use the PGP tool, against any file, you would want to consider using the CFEXECUTE tag, which lets you run any process on the server (that you would otherwise run from the command line on the server). It can be tricky to get it to work. See the docs, for sure.

/charlie

/Charlie (troubleshooter, carehart. org)
Inspiring
May 23, 2018

There used to be a CFC that handled this: BonCode PGP for ColdFusion , but I believe it is pretty out of date with current libraries.  I'd suggest using a Java lib within CF.  I know there were some Java wrappers for bouncycastle.org that you might want to look at.

-Nic