Free Support Forum - aspose.com

RC4- Microsoft Enhanced Cryptographic Provider 1.0 128-bit

Hi,

We have a client who was previously receiving Excel statements encrypted by another application using “RC4,
Microsoft Enhanced Cryptographic Provider 1.0 128-bit encryption.” They have an automated process which decrypts the file expecting this algorithm.

We are now using Apose.Cells to encrypt the files using the following call:

workbook.setEncryptionOption(EncryptionType.STONG_CRYPTOGRAPHIC_PROVIDER, 128);


It appears that this uses (RC4,Microsoft Strong Cryptographic Provider), and this is only encryption option available.

Question: Is “RC4, Microsoft Enhanced Cryptographic Provider 1.0 128-bit” encryption supported in Aspose.Cells?


Hi,

Based on this following article. I can say, Aspose.Cells for Java supports the encryption with the desired algorithm for xls files.

Setting Strong Encryption Type

Below is a code to open any password protected file. I have tested it, it works with xls files but not xlsx files. It seems encryption is not supported for xlsx files. I have attached the sample xls file and the you can see the output below. The password is 007.

Java


String filePath = “F:\Shak-Data-RW\Downloads\source.xls”;


LoadOptions opts =new LoadOptions();

opts.setPassword(“007”);


Workbook workbook = new Workbook(filePath, opts);


Worksheet worksheet = workbook.getWorksheets().get(0);


Cell cell = worksheet.getCells().get(“A1”);


System.out.println(cell.getStringValue());

Output:
WELCOME TO ASPOSE!

Shakeel,

Please read my post again carefully. The article mentions only

RC4,Microsoft Strong Cryptographic Provider

What I am interested in is

RC4, Microsoft Enhanced Cryptographic Provider

Can you please tell me if this is supported, and if so, how to select it? I see that EncryptionType class seems to only support
Strong , as mentioned in the article.

Hi,

Will you please provide me your sample file so that I could check it if it is supported.

Shakeel,

I don’t believe you need a sample file. Please take any xls file (93-2007) and try and encrypt it using RC4 Microsoft Enhanced Cryptographic Provider algorithm. It this is possible, please provide me with the API to use.

Thanks.

Hi,

Yes, it is supported as I found, Aspose.Cells for Java was able to open it. I am attaching the source xls file which ran successful with the above code.


I am not trying to decrypt/open the file using Aspose.

I am trying to encrypt it using it RC4, Microsoft Enhanced Cryptographic Provider 1.0 128-bit.

Can you please show me how to do the following using Aspose API:

1. Take a sample unprotected XLS like your source1.xls
2. Show me the Aspose API used to encrypt this file using: RC4, Microsoft Enhanced Cryptographic Provider 1.0 128-bit.
3. Check in Excel that in fact the cryptographic provider used to encrypt the file is
RC4, Microsoft Enhanced Cryptographic Provider 1.0 128-bit.

Thanks.

Hi,

I am afraid, this feature is not available. So I have added a new feature request for this issue in our database.

Once, we will get some update regarding it, we will let you know asap.

This issue has been logged as CELLSJAVA-31192.

The issues you have found earlier (filed as 31192) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.