Highlighted

Encrypt data in a created Excel file

Explorer ,
Aug 08, 2018

Copy link to clipboard

Copied

Hi,

Is there away in Cold Fusion2016 to encrypt the contents of a create Excel file, either completely or by cell?

Then allow the user to de-encrypt the Excel file after it has been created?

Using the following to create an excel file.

<cfset TabChar = Chr(9)>
<cfset NewLine = Chr(13) & Chr(10)>
<cfheader name="Content-Disposition" value="attachment; filename=reports.xls">
<CFCONTENT TYPE="application/vnd.ms-excel" RESET="Yes">

Thanks in advance,

Mike

Views

384

Likes

Translate

Translate

Report

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

Encrypt data in a created Excel file

Explorer ,
Aug 08, 2018

Copy link to clipboard

Copied

Hi,

Is there away in Cold Fusion2016 to encrypt the contents of a create Excel file, either completely or by cell?

Then allow the user to de-encrypt the Excel file after it has been created?

Using the following to create an excel file.

<cfset TabChar = Chr(9)>
<cfset NewLine = Chr(13) & Chr(10)>
<cfheader name="Content-Disposition" value="attachment; filename=reports.xls">
<CFCONTENT TYPE="application/vnd.ms-excel" RESET="Yes">

Thanks in advance,

Mike

Views

385

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 08, 2018 0
Adobe Community Professional ,
Aug 12, 2018

Copy link to clipboard

Copied

If you want file encryption and decryption, then the solution is straightforward. I am assuming the user also uses ColdFusion.

Your file encryption

<cffile file="C:\Users\BKBK\Desktop\testDir\test.xls" action="readBinary" variable="myExcelData">

<cfset key=generateSecretKey("AES")>

<cfset encryptedData=encryptBinary(myExcelData, key, "AES")>

<cffile file="C:\Users\BKBK\Desktop\testDir\test1_encrypted.xls" action="write" output="#encryptedData#">

key:<cfoutput>#key#</cfoutput>

Now, give the user the key, SPCX1nM2h+NPzx4j6e24tQ==, say.

User's file decryption

<cffile file="C:\tmp\testDir\test1_encrypted.xls" action="readBinary" variable="encryptedExcelData">

<cfset key="SPCX1nM2h+NPzx4j6e24tQ==">

<cfset decryptedData=decryptBinary(encryptedExcelData, key, "AES")>

<cffile file="C:\tmp\testDir\test1_decrypted.xls" action="write" output="#decryptedData#">

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 12, 2018 0
Explorer ,
Aug 13, 2018

Copy link to clipboard

Copied

Hi,

The user does not have access to Cold Fusion.

The user has access to Microsoft Excel.

Thanks,

Mike

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 13, 2018 0
LEGEND ,
Aug 13, 2018

Copy link to clipboard

Copied

The user must use something that can decrypt the file, using the key you provide.  If not ColdFusion, then something.  If they only have access to the Excel file without any method of decrypting it, then the whole process is pointless.

V/r,

^ _ ^

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 13, 2018 0
BKBK LATEST
Adobe Community Professional ,
Aug 13, 2018

Copy link to clipboard

Copied

userCold9  wrote

The user does not have access to Cold Fusion.

The user has access to Microsoft Excel.

Then there is an easy solution. It doesn't require ColdFusion.

Just assign a password to the sheet. (Google password protect excel)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 13, 2018 0