A Java console application that provides security tools for password management and file encryption, developed using Object-Oriented Programming principles.
- Secure storage of secrets encrypted with PBKDF2-HMAC-SHA256 and AES-256-GCM
- Smart search using the Levenshtein algorithm (typo tolerance)
- Complete CRUD operations (Create, Read, Update, Delete)
- Strong password policy (minimum 8 characters, uppercase letters, numbers, and symbols)
- Master password changes with automatic re-encryption
- Case-insensitive unique names; secret values preserve spaces
- Bounded name/value limits and bounded Levenshtein search prevent excessive resource use
- Encrypts and decrypts individual files using the master password
.lockedextension for encrypted files- Writes the destination atomically and deletes the original only after a successful conversion
- Refuses to overwrite an existing destination (the
.lockedcheck is case-insensitive) - Validates the published output before deleting the source
- Event log recording all operations
- Severity levels: INFO, WARN, ERROR
- Automatic log retention (7 days)
- No sensitive values are logged (only secret names)
- AES-256-GCM with a random IV for every operation
- Versioned
SSV2format with a random PBKDF2 salt and a magic/version/salt header authenticated as AES-GCM AAD - Legacy SHA-256 data remains readable; migration is best-effort, preserves a non-overwritten
.legacy.bak, and never blocks a successful login - Password input hidden in the terminal
- Password cleanup in memory (
char[]) - Authentication attempt limit
- Java 17 or later
- Real terminal (PowerShell, CMD, Bash)
β οΈ Does not work from IDE integrated terminals because it usesSystem.console()to hide passwords.
git clone https://github.com/Esperilla/Suite-de-Seguridad.git
cd Suite-de-Seguridad# Windows (PowerShell)
javac -d out src/models/*.java src/modules/*.java src/main/*.java# Linux/Mac
javac -d out src/models/*.java src/modules/*.java src/main/*.java# Windows (PowerShell)
java -cp out main.MainDependency-free critical tests:
javac --release 17 -d out src\models\*.java src\modules\*.java src\main\*.java tests\CriticalTests.java
java -cp out CriticalTests# Linux/Mac
java -cp out main.MainWhen running the application for the first time, you will be asked to create a master password:
--- SECURITY SUITE (JAVA OOP) ---
--- Initial Setup ---
Welcome. Create a master password.
Password requirements:
β’ Minimum 8 characters
β’ At least one uppercase letter
β’ At least one number
β’ At least one special character (!@#$%^&* etc.)
New password: ********
Confirm password: ********
System configured successfully!
--- Main Menu ---
1. Password Manager
2. File Encryptor
3. Exit
>
--- Password Manager ---
1. Add secret
2. View secret
3. List secrets
4. Delete secret
5. Update secret
6. Change master password
7. Save and Return
>
Smart search: You do not need to remember the exact secret name. The system finds matches even when the search contains typos:
Search secret: gmai
β Secret found: Gmail
Value: my_secure_password
--- File Encryptor ---
1. Encrypt file
2. Decrypt file
3. Return
>
π‘ Tip: Use
/instead of\in file paths:File path: C:/Users/user/document.txt
The project implements a modular architecture based on Object-Oriented Programming:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Main.java β
β (Entry point) β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β
ββββββββββββββββ΄βββββββββββββββ
βΌ βΌ
βββββββββββββββββββββββββ βββββββββββββββββββββββββ
β VaultModule β β FileModule β
β (Password Manager) β β (File Encryptor) β
βββββββββββββ¬ββββββββββββ βββββββββββββ¬ββββββββββββ
β β
ββββββββββββββββ¬βββββββββββββββ
βΌ
βββββββββββββββββββββββββββ
β BaseModule β
β (Abstract class) β
β - Polymorphism β
β - Inheritance β
βββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββ
β EncryptionUtils β
β - AES-GCM 256 bits β
β - Random IV β
βββββββββββββββββββββββββββ
| Concept | Implementation |
|---|---|
| Inheritance | BaseModule β VaultModule, FileModule |
| Polymorphism | execute() method in each module |
| Abstraction | Abstract BaseModule class |
| Encapsulation | Private attributes with getters |
| Composition | Main uses Vault and VaultStorage |
| Serialization | Vault implements Serializable |
The system uses AES-256-GCM (Galois/Counter Mode) for encryption:
| Feature | Description |
|---|---|
| Algorithm | AES-256 |
| Mode | GCM (built-in authentication) |
| IV | 12 random bytes per operation |
| Authentication tag | 128 bits |
Master passwords must meet the following requirements:
- β Minimum 8 characters
- β At least one uppercase letter
- β At least one number
- β At least one special character (`!@#$%^&*()-_=+[]{}|;:'',.<>?/~``)
- Brute force: Three-attempt limit for changing the master password
- Login: Three-attempt limit; an existing legacy vault is backed up and atomically migrated after successful authentication
- Memory: Passwords cleared with
Arrays.fill(arr, '\0') - Replay: A unique IV is generated for every encryption operation
- Audit log: Stored at
logs/audit.log; messages are sanitized to prevent forged log lines - Persistent files are owner-restricted when supported, and the audit log rotates at 1 MiB
New vaults use SSV2: PBKDF2-HMAC-SHA256 (210,000 iterations), a fresh 16-byte salt,
and AES-256-GCM with a fresh 12-byte IV and 128-bit tag. The magic header, version,
and salt are authenticated as AES-GCM AAD; unknown versions and altered metadata are
rejected. Legacy SHA-256 vaults and files remain readable, but legacy .locked files
must be decrypted and encrypted again to use the current format.
On legacy login, decryption and vault validation happen before migration. The original
file is copied to boveda.dat.legacy.bak only if that backup does not already exist.
The new file is written to a temporary file, decrypted, reconstructed, and compared
before publication. A migration failure is logged and shown as a warning, preserves
the legacy vault, and does not deny login; migration can be retried later. The backup
is retained as an explicit recovery copy and is never overwritten automatically.
Vault changes are tracked as pending changes and saved when the user selects
βSave and Returnβ or exits. EOF also attempts a save, and save errors are reported
instead of being treated as a successful clean exit. Secret names are trimmed and
unique without case sensitivity (Locale.ROOT); secret values and passwords are
never trimmed. Names, values, and searches have practical maximum lengths.
Persistence uses a forced temporary write, atomic move when available, validation,
and a best-effort parent-directory synchronization. Large files are read into
memory with readAllBytes(), so file sizes should remain within available memory.
Security-Suite/
βββ π README.md # This file
βββ π Security-Suite.iml # IntelliJ IDEA configuration
βββ π src/
β βββ π main/
β β βββ π Main.java # Application entry point
β βββ π models/
β β βββ π Vault.java # In-memory secret store
β β βββ π VaultStorage.java # Encrypted persistence
β β βββ π EncryptionUtils.java # Cryptographic functions
β β βββ π AuditLog.java # Logging system
β β βββ π FileSecurity.java # Filesystem permissions and synchronization
β βββ π modules/
β βββ π BaseModule.java # Abstract base class
β βββ π VaultModule.java # Password manager
β βββ π FileModule.java # File encryptor
βββ π tests/ # Dependency-free critical tests
βββ π logs/ # Local audit logs (ignored by Git)
βββ π boveda.dat # Encrypted vault (generated at runtime)
- Practical application of OOP in Java
- Implementation of modern cryptography
- Modular software design
- Secure programming best practices
- GitHub: @Esperilla