Encrypt and Decrypt PDF files with cURL

Share on FacebookTweet about this on TwitterShare on LinkedIn

PDF Document is the defacto file type to present documents, including text formatting and images, in a manner independent of application software, hardware, and operating systems. Aspose.PDF Cloud provides a number of operations that work seamlessly with your existing PDF Documents, allowing you to convert to and from PDF Format, extract document information, and perform operation like Encrypting and Decrypting PDF Documents.

Encrypting a PDF Document

Aspose.PDF Cloud allows you to easily encrypt a PDF document. Encrypting a PDF makes it unreadable to anyone without the password. This helps you protect sensitive information in a PDF file. You can similarly encrypt a file using the ubiquitous Adobe PPF Reader

The below example demonstrates applying the AESx256 encryption algorithm to a PDF document hosted on Aspose Cloud Storage. The output is then stored back onto the Cloud

Valid API Parameters

ParameterValues
userPasswordBase 64 Encoded String Value
ownerPasswordBase 64 Encoded String Value
cryptoAlgorithmPlease see below

The cryptoAlgorithm takes the following possible values. This represents the type of cryptographic algorithm used in Encryption / Decryption routines.

RC4x40RC4 with key length 40.
RC4x128RC4 with key length 128.
AESx128AES with key length 128.
AESx256AES with key length 256.

When you try to open an encrypted PDF file, you get asked for a password

Decrypting a PDF Document

Aspose.PDF Cloud allows you to easily decrypt a PDF document. Any PDF decrypted by the above encryption process needs to be decrypted before it can be used. Please remember the password has to be a Base 64 Encoded string value.

Have any Question

Feel free to drop us a comment below sharing your thoughts about Aspose.PDF Cloud REST API. Or let’s know if you have any suggestions or if you need any particular features which you expect our REST API to have.

Try It Out

And if you’ve not already had a chance to try our REST API, simply start a free trial today. All you need is to sign up with the aspose.cloud. Once you’ve signed up, you’re ready to try the powerful file processing features offered by aspose.cloud.