Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to encrypt a file in coldfusion?

New Here ,
May 23, 2018 May 23, 2018

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

1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 23, 2018 May 23, 2018

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

HTH,

^ _ ^

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 23, 2018 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)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 23, 2018 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 08, 2019 Aug 08, 2019
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources