Generic API to check if document is encrypted / password protected

Hi Team,

Is there any generic method to tell if given document is encrypted or password protected , that can be used for any extension ?

Thanks,
Saurabh

@saurabh.arora,

1). For Aspose.Words, you can use FileFormatInfo.isEncrypted for the task.

2). For Aspose.Cells, you can also detect if the Excel workbook is password protected or not without loading it. You can use FileFormatInfo.isEncrypted property to detect if the file is encrypted or not.
Please see the following documentation article that illustrates how to detect the format of the file and check if the file is encrypted or not.
How to Detect a File Format and Check if the File is Encrypted

3). Regarding Aspose.PDF, see the document on how to detect if a document is password protected.

Hope, this helps a bit.