PDF Encryption using Python
1. ABSTRACT
This project demonstrates how to apply password protection to PDF files using Python. By
leveraging the 'pikepdf' library, users can encrypt PDF documents to restrict unauthorized access.
This project highlights the simplicity and effectiveness of Python in handling file encryption tasks.
2. INTRODUCTION
In the digital era, data security and privacy are essential, especially for documents shared
electronically. PDF files are widely used for sharing sensitive information; therefore, encrypting
them adds an extra layer of protection. Python provides libraries like 'pikepdf' that make encryption
tasks simple and efficient.
3. BACKGROUND
PDF encryption involves applying a password to restrict opening or editing the document.
Traditional tools often require manual processes, but using Python automation, this process
becomes faster and more secure. The 'pikepdf' library is built on top of QPDF and provides a
convenient interface for reading, modifying, and encrypting PDF files.
4. METHODOLOGY
The implementation involves the following steps: 1. Import the 'pikepdf' library. 2. Open the existing
PDF file using [Link](). 3. Set the desired permissions and password encryption using
[Link](). 4. Save the new encrypted PDF file.
5. RESULTS AND ANALYSIS
After running the code, a new PDF file named '[Link]' is generated, which is password
protected. The file can only be accessed by entering the correct password. This proves the
successful implementation of PDF encryption using Python and validates the effectiveness of the
'pikepdf' library.
6. CONCLUSION AND FUTURE WORK
The project successfully demonstrates how to apply password protection to PDF files using Python.
Future enhancements can include adding a user interface, batch encrypting multiple PDFs, or
integrating cloud-based encryption options.
7. REFERENCES
1. PikePDF Documentation - [Link] 2. Python Official Documentation -
[Link]
8. SCREENSHOT OF CODE