A lightweight graphical frontend for Apache PDFBox that allows you to encrypt or decrypt PDF files without using the command line.
The application is written in Java and uses the standard PDF security features provided by Apache PDFBox (AES-128 encryption).
Library PDFBox version 3.0.8 :
https://www.apache.org/dyn/closer.lua/pdfbox/3.0.8/pdfbox-app-3.0.8.jar
or
https://archive.apache.org/dist/pdfbox/3.0.8/pdfbox-app-3.0.8.jar
Author: Eric Normandin (2026)
PDFCrypt is a small Java Swing application demonstrating how to use Apache PDFBox to encrypt and decrypt PDF documents through a simple graphical user interface. It is intended as both a practical utility and a concise example of PDFBox integration.
- Graphical user interface (Swing)
- Encrypt PDF files with AES-128
- Decrypt password-protected PDF files
- Batch processing of multiple files
- Drag & Drop support
- Optional destination directory (for example, a USB drive)
- Optional deletion of source files after successful processing
- Optional overwrite of existing files
- Multilingual interface (depending on available resource files)
- PDFBox pack into the "fat" JAR
- Java Runtime Environment (JRE) 8 or later
- Apache PDFBox library (a lightweight version included - with only needed classes).
Unzip the package included on thebindirectory.
- Enter the password.
- Add one or more PDF files using Open or by Drag & Drop.
- (Optional) Select another destination directory.
- Click Encrypt or Decrypt.
Encrypted files are saved with the extension:
filename.crypt.pdf
After decryption, the original filename is restored.
PDFCrypt/
|-- META-INF/
| \-- MANIFEST.MF
|-- bin/
| \-- org/
| \-- apache/
| |-- commons/
| | \-- logging/
| | \-- ...
| \-- pdfbox/
| \-- ...
|-- resources/
| |-- PDFCrypt.png
| |-- messages.properties
| |-- messages_en_US.properties
| \-- messages_fr_FR.properties
|-- PDFCrypt.java
|-- README.md
\-- main_window.png
PDFCrypt accepts up to two optional command-line arguments.
| Argument | Description |
|---|---|
source_directory |
Initial directory displayed when selecting PDF files. |
destination_directory |
Default destination directory for encrypted or decrypted files. |
java -jar PDFCrypt.jar [source_directory] [destination_directory]
Start PDFCrypt with the default working directory:
java -jar PDFCrypt.jar
Open the application with a predefined source directory:
java -jar PDFCrypt.jar "C:\Documents\PDF"
Specify both the source and destination directories:
java -jar PDFCrypt.jar "C:\Documents\PDF" "E:\SecurePDF"
Both arguments are optional. If omitted, PDFCrypt uses the system default directory. If a specified directory does not exist, the corresponding argument is ignored.
javac -Xlint:unchecked -cp "bin/" -d bin ./PDFCrypt.javajava -cp "bin/:resources/" PDFCrypt|
| Note: On Windows, replace : with ; in the classpath.
|
jar -cvfm PDFCrypt.jar META-INF/MANIFEST.MF -C bin/ . -C resources/ .PDFCrypt relies entirely on the encryption implementation provided by Apache PDFBox.
Encryption uses the standard PDF security mechanism with a 128-bit AES key, ensuring compatibility with PDF readers supporting the PDF encryption specification.
This project is distributed under the terms of the Apache-2.0 License.
