Cryptographically secure generation • up to 10,000 passwords
Recommended: 16–32 chars
Generate up to 10,000 passwords (large batches use summary view).
Active Character Pool Size
...
Logarithmic Entropy (Bits)
0.00 bits
Estimated Strength Rating
N/A
Click "Generate Passwords" to begin.
CRITICAL: Secure Storage Required
Use a reputable password manager (KeePass, Bitwarden). Enable Full Disk Encryption (BitLocker, FileVault, LUKS) on your device.
Interactive Bash script using OpenSSL (AES-256-CBC) + PBKDF2 for strong file encryption.
#!/bin/bash
# -----------------------------------------------------------------------------
# Interactive File Protector Script (Encryption/Decryption)
# Dependencies: openssl (with PBKDF2 support), shred (optional secure delete)
# -----------------------------------------------------------------------------
ENCRYPT_EXT=".enc"
CIPHER_METHOD="aes-256-cbc"
error_message() { echo -e "\n\033[31m[ERROR]\033[0m $1"; }
get_password() { read -rsp "Enter password: " PASSWORD; echo ""; }
encrypt_file() {
echo -e "\n--- File Encryption ---"
read -rp "Filename to encrypt: " INPUT_FILE
[ ! -f "$INPUT_FILE" ] && error_message "File not found." && return 1
OUTPUT_FILE="${INPUT_FILE}${ENCRYPT_EXT}"
get_password
if openssl enc -"$CIPHER_METHOD" -salt -pbkdf2 -in "$INPUT_FILE" -out "$OUTPUT_FILE" -k "$PASSWORD"; then
echo -e "\033[32m[SUCCESS]\033[0m Encrypted to $OUTPUT_FILE"
read -rp "Securely delete original? (y/N): " del
[[ "$del" =~ ^[Yy]$ ]] && command -v shred &>/dev/null && shred -u "$INPUT_FILE" || rm -f "$INPUT_FILE"
else
error_message "Encryption failed."
fi
}
decrypt_file() {
echo -e "\n--- File Decryption ---"
read -rp "Encrypted filename: " INPUT_FILE
[ ! -f "$INPUT_FILE" ] && error_message "File not found." && return 1
OUTPUT_FILE="${INPUT_FILE%$ENCRYPT_EXT}"
[ "$OUTPUT_FILE" == "$INPUT_FILE" ] && read -rp "Output filename: " OUTPUT_FILE
[ -f "$OUTPUT_FILE" ] && error_message "Output exists. Abort." && return 1
get_password
openssl enc -d -"$CIPHER_METHOD" -pbkdf2 -in "$INPUT_FILE" -out "$OUTPUT_FILE" -k "$PASSWORD" && \
echo -e "\033[32m[SUCCESS]\033[0m Decrypted to $OUTPUT_FILE" || error_message "Wrong password or corrupt file."
}
main_menu() {
echo "========================================="
echo " File Protection Utility "
echo "========================================="
echo "1. Encrypt a File"
echo "2. Decrypt a File"
echo "3. Exit"
read -rp "Choice (1-3): " CHOICE
case "$CHOICE" in
1) encrypt_file ; main_menu ;;
2) decrypt_file ; main_menu ;;
3) echo "Goodbye." ; exit 0 ;;
*) error_message "Invalid option." ; main_menu ;;
esac
}
main_menu
file_protector.shchmod +x file_protector.sh./file_protector.shRequires openssl (with PBKDF2). shred recommended for secure deletion.