Lightweight, fast, interactive PowerShell wrapper for Windows cipher.exe - Easy file and folder encryption/decryption using EFS (Encrypting File System).
Script file: cipher-enhance.ps1
# Interactive mode (easiest)
cipher
# Quick file encryption
cipher-encrypt C:\Documents\secret.txt
# Quick file decryption
cipher-decrypt C:\Documents\secret.txt
# Encrypt entire folder
cipher-encrypt-folder C:\PrivateData
# Check encryption status
cipher-status C:\Documents
# Show help
cipher-help
| Option | Feature | What it does |
|---|---|---|
| 1 | Encrypt | Encrypts files/folders using EFS |
| 2 | Decrypt | Removes encryption from files/folders |
| 3 | Show Status | Displays encryption status |
| 4 | Secure Delete | Wipes free space (3-pass overwrite) |
| 5 | Remove Encryption | Decrypts and removes protection |
| 6 | Create Encrypted Archive | ZIP with password protection |
EFS (Encrypting File System) is a Windows feature that provides filesystem-level encryption:
โ
Protects against: Physical theft, unauthorized access, data recovery tools
โ
Transparent: Access files normally, encryption is automatic
โ
Fast: Hardware-accelerated encryption
โ
Built-in: No third-party software needed
โ
Free: Included with Windows
# Method 1: Interactive
cipher
# Select file, choose encrypt
# Method 2: Quick command
cipher-encrypt C:\Documents\passwords.txt
# Recursive encryption
cipher-encrypt-folder C:\PrivateDocuments
# Or interactive
cipher
# Select folder, choose recursive option
# Single file
cipher-decrypt C:\Documents\secret.txt
# Entire folder
cipher-decrypt-folder C:\PrivateDocuments
# List all encrypted files in current directory
cipher-list-encrypted
# Show statistics
cipher-stats C:\Users\YourName\Documents
# Interactive
cipher
# Select option 4
# Quick command
cipher-wipe C:\
# WARNING: This wipes ALL recoverable deleted files!
cipher
# Select option 6
# Enter password
# Archive saved to Desktop
Requirements:
CRITICAL: Always backup your EFS certificates!
# Interactive backup assistant
cipher-backup-keys
# Manual backup (recommended):
1. Run: certmgr.msc
2. Navigate to: Personal > Certificates
3. Find: Certificate with "Encrypting File System"
4. Right-click > All Tasks > Export
5. Export WITH private key
6. Use STRONG password
7. Store backup SAFELY (external drive, cloud)
# Current directory
cipher-stats
# Specific path
cipher-stats C:\Users\YourName
# Output example:
# Total Files: 1,542
# Encrypted Files: 387
# Encrypted Size: 2.34 GB
# Percentage: 25.10%
cipher-list-encrypted
# Shows:
# [ENCRYPTED] C:\Docs\secret.txt
# [ENCRYPTED] C:\Docs\passwords.xlsx
# [ENCRYPTED] C:\Private\keys.pem
cipher-encrypt <path> # Encrypt file/folder
cipher-decrypt <path> # Decrypt file/folder
cipher-status <path> # Show encryption status
cipher-wipe <path> # Secure delete free space
cipher-encrypt-folder <path> # Encrypt folder + subfolders
cipher-decrypt-folder <path> # Decrypt folder + subfolders
cipher-secure-encrypt <path> # Encrypt + wipe original
cipher-list-encrypted # List encrypted files
cipher-stats [path] # Show statistics
cipher-backup-keys # Backup EFS certificates
cipher-reset-settings # Clear saved settings
cipher-help # Show help
โ
Backup your EFS certificate - Store in multiple safe locations
โ
Use strong Windows password - Your encryption depends on it
โ
Enable BitLocker - For full-disk encryption layer
โ
Test decryption - Verify you can decrypt before relying on it
โ
Keep Windows updated - Security patches are important
โ Donโt lose your certificate - Encrypted data will be unrecoverable
โ Donโt share your Windows account - Others can access encrypted files
โ Donโt encrypt system files - Can cause boot issues
โ Donโt rely only on EFS - Use multiple security layers
โ Donโt forget your password - No password = No encryption keys
โ
NTFS - Full support (Windows NT File System)
โ
Local drives - C:\, D:\, etc.
โ
External NTFS drives - USB drives formatted as NTFS
โ FAT32 - No encryption support
โ exFAT - No encryption support
โ Network drives - Limited support
โ Non-Windows systems - EFS is Windows-only
Solution:
# Run PowerShell as Administrator
# Right-click > Run as Administrator
Solution:
# cipher.exe is built into Windows
# Check: C:\Windows\System32\cipher.exe
# Add to PATH or use full path:
C:\Windows\System32\cipher.exe /E "C:\file.txt"
Solution:
chkdsk C: /FSolution:
# Generate new EFS certificate:
cipher /R
# Or encrypt a file to auto-generate:
cipher /E C:\test.txt
Solution:
Explanation:
# Add to startup script
cipher-encrypt-folder "C:\Users\$env:USERNAME\Documents\Private"
encrypt.ps1(Get-Item "C:\file.txt").Attributes -band [System.IO.FileAttributes]::Encrypted
Get-ChildItem -Recurse -Filter *.pdf | ForEach-Object {
cipher-encrypt $_.FullName
}
# Show daily stats
cipher-stats C:\Users\$env:USERNAME
# Create encrypted folder
New-Item -ItemType Directory -Path "C:\SecureDocs"
cipher-encrypt-folder "C:\SecureDocs"
# Verify
cipher-stats "C:\SecureDocs"
# Encrypt first
cipher-encrypt "C:\sensitive.doc"
# Then secure wipe original
cipher-wipe "C:\sensitive.doc"
# Create encrypted ZIP
cipher
# Select option 6
# Choose files/folders
# Set strong password
# Copy ZIP to USB drive
# Check all user directories
$users = Get-ChildItem C:\Users -Directory
foreach ($user in $users) {
Write-Host "`nUser: $($user.Name)" -ForegroundColor Cyan
cipher-stats $user.FullName
}
Speeds vary based on: CPU, disk speed, file count, file types
Part of TheSecretJuice ๐ by mini-page
Need help? Open an issue