Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDFCrypt - Version 1.0

Java License

Summary

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)

window_screenshot

About

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.

Features

  • 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

Requirements

  • Java Runtime Environment (JRE) 8 or later
  • Apache PDFBox library (a lightweight version included - with only needed classes).
    Unzip the package included on the bin directory.

Usage

  1. Enter the password.
  2. Add one or more PDF files using Open or by Drag & Drop.
  3. (Optional) Select another destination directory.
  4. Click Encrypt or Decrypt.

Encrypted files are saved with the extension:

filename.crypt.pdf

After decryption, the original filename is restored.

Files source tree

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

Command-line Arguments

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.

Syntax

java -jar PDFCrypt.jar [source_directory] [destination_directory]

Examples

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.

Compiling the source code

javac -Xlint:unchecked -cp "bin/" -d bin ./PDFCrypt.java

How to execute the PDFCrypt.class

java -cp "bin/:resources/" PDFCrypt

| | Note: On Windows, replace : with ; in the classpath. |

Creating the PDFCrypt.jar file

jar -cvfm PDFCrypt.jar META-INF/MANIFEST.MF -C bin/ . -C resources/ .

Security

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.

License

This project is distributed under the terms of the Apache-2.0 License.

About

A simple graphical user interface for Apache PDFBox, the Java PDF library. This example uses PDFBox classes to encrypt or decrypt some PDF files. During the operation, PDF files can be transfert to a destination directory, for example to an USB drive. The encrypt method is totally compatible with the PDF specifications (AES with 128 bits key).

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages