Password protection broken

We have been using the password protection on sheets and workbooks for some time now (both for generating and opening spreadsheets) and we have “all of a sudden” started running into issues. Without any changes to the application, we are no longer able to open spreadsheets that are generated and protected by aspose.cells.

Our test is to generate the spreadsheet and email it back in. Both the generation and opening code use the exact same password and they both use the same file format (we have tried both Default and 2003). I thought it may have been been related to Windows Server 2008, but I installed on 2003 and am still having the same problem.

Can anyone shed any light on this? This is, unfortunately, impacting one of our customers in production.

Well, it turns out that at some point, the Workbook.Open method stopped using or checking the password. Removing the password parameter results in the spreadsheet opening correctly with all data accessible. However, when opened in Excel, the workbook is still password-protected. Very, very strange behavior and one that I could not find any documentation on.

Hi,

Please create a sample application (with all your template files) and post it here to reproduce the issue with all the details. We will check it soon.

Thank you.

I’m sorry, but there is no way that I have the time to separate all of my code and generate a sample.

Can you tell me when and why the Workbook.Open method was changed to no longer require the Password parameter opening a Workbook that is protected?

If there is a different sequence of actions that need to be taken when opening a protected Workbook (other than calling Open using the password parameter), can you please either point me in the direction of the related documentation or, if it is not documented, provide it in this forum?

Hi,

Well, if your template file is encrypted with a password, then Aspose.Cells for .NET would require encrypted password (you will provide the password as a parameter) using one of its overloaded method e.g

public void Open(
string fileName,
FileFormatType type,
string password
);

"Can you tell me when and why the Workbook.Open method was changed to
no longer require the Password parameter opening a Workbook that is
protected?"

Well, it never stops to authenticate the encrypted file with password when MS Excel requires the password to open/modify the file. If you excel file is encrypted with a password, Aspose.Cells would require that password to open the file and it should do it too.

I have attached the latest version/fix here, kindly try it and if you still find the issue, I am afraid, we surely require a sample application to reproduce the issue here, so, that we can figure it out.
We appreciate your work/efforts for the issue.

Thank you.



Evidently I misunderstood what the password parameter is for: we don’t encrypt the files, only protect them. The code used to work in past versions of Cells, but it could be that the Open method just ignored the password if the file was not encrytped rather than throwing an Invalid Password exception.

At any rate, knowing that the password parameter is for encryption rather than protection has resolved our issue.

Thank you for your help.