Skip to content

Protect your PDF file using Python is a project aimed at securing sensitive information contained in PDF files by adding password protection. The program uses the PyPDF2 module to encrypt and password-protect the PDF files. This Python script allows users to enter the password and the path to the PDF file, and then creates a new PDF file

License

Notifications You must be signed in to change notification settings

problemsolvewithridoy/protect-your-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Protect your file using python

Protect your PDF file using Python is a project aimed at securing sensitive information contained in PDF files by adding password protection. The program uses the PyPDF2 module to encrypt and password-protect the PDF files. This Python script allows users to enter the password and the path to the PDF file, and then creates a new PDF file with the same name and path, but with password protection.

The program uses the RC4 encryption algorithm, which is a stream cipher encryption algorithm known for its simplicity and speed. The password is first hashed using the MD5 hash function, and then used as the key to encrypt the PDF file.

This project is useful for individuals and organizations that need to secure their confidential PDF files, such as financial reports, legal documents, or personal information. With this Python script, users can easily add password protection to their PDF files and prevent unauthorized access.

let's start...............

To make this project you need to follow this step:-

Installation

Install package with pip

  pip install pikepdf

Deployment

To deploy this project run

import pikepdf

old_PDF = pikepdf.Pdf.open("yourOldPDFname.pdf")

allow_key = pikepdf.Permissions(extract=False)

old_PDF.save("yourNewPDFname.pdf", encryption = pikepdf.Encryption(user= "yourPassword", owner= "Problem solve with Ridoy", allow= allow_key ))

print("new PDF created successfuly with password")

Output

protect your file

You can follow me

Facebook:- https://www.facebook.com/problemsolvewithridoy/

Linkedin:- https://www.linkedin.com/in/ridoyhossain/

YouTube:- https://www.youtube.com/@problemsolvewithridoy

Gmail:- entridoy2@gmail.com

If you have any confusion, please feel free to contact me. Thank you

About

Protect your PDF file using Python is a project aimed at securing sensitive information contained in PDF files by adding password protection. The program uses the PyPDF2 module to encrypt and password-protect the PDF files. This Python script allows users to enter the password and the path to the PDF file, and then creates a new PDF file

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages