TheSecretJuice

๐Ÿ” cipher-enhance

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

๐Ÿ†• Whatโ€™s New

๐Ÿš€ Quick Start

# 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

๐Ÿ“‹ Menu Options

Main Operations

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

Secure Delete Options

  1. Keep original files - Standard encryption
  2. 3-pass wipe - Secure deletion (DOD 5220.22-M)
  3. 7-pass wipe - Maximum security (government standard)

Recursive Options (for folders)

  1. Current folder only - Donโ€™t process subfolders
  2. Include all subfolders - Recursive operation

๐Ÿ” Understanding EFS Encryption

What is EFS?

EFS (Encrypting File System) is a Windows feature that provides filesystem-level encryption:

Why Use EFS?

โœ… 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

Security Level

๐ŸŽฏ Common Usage

Encrypt a Sensitive File

# Method 1: Interactive
cipher
# Select file, choose encrypt

# Method 2: Quick command
cipher-encrypt C:\Documents\passwords.txt

Encrypt Entire Folder

# Recursive encryption
cipher-encrypt-folder C:\PrivateDocuments

# Or interactive
cipher
# Select folder, choose recursive option

Decrypt Files

# Single file
cipher-decrypt C:\Documents\secret.txt

# Entire folder
cipher-decrypt-folder C:\PrivateDocuments

Check Whatโ€™s Encrypted

# List all encrypted files in current directory
cipher-list-encrypted

# Show statistics
cipher-stats C:\Users\YourName\Documents

Secure Delete (Wipe Free Space)

# Interactive
cipher
# Select option 4

# Quick command
cipher-wipe C:\
# WARNING: This wipes ALL recoverable deleted files!

Create Encrypted ZIP Archive

cipher
# Select option 6
# Enter password
# Archive saved to Desktop

Requirements:

๐Ÿ”‘ Backup Your Encryption Keys

CRITICAL: Always backup your EFS certificates!

Why Backup?

How to Backup

# 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)

๐Ÿ“Š Statistics & Monitoring

View Encryption Stats

# 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%

List Encrypted Files

cipher-list-encrypted

# Shows:
# [ENCRYPTED] C:\Docs\secret.txt
# [ENCRYPTED] C:\Docs\passwords.xlsx
# [ENCRYPTED] C:\Private\keys.pem

โšก Quick Command Reference

Basic Operations

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

Folder Operations

cipher-encrypt-folder <path>   # Encrypt folder + subfolders
cipher-decrypt-folder <path>   # Decrypt folder + subfolders
cipher-secure-encrypt <path>   # Encrypt + wipe original

Utilities

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

๐Ÿ›ก๏ธ Security Best Practices

DO:

โœ… 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:

โŒ 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

๐Ÿ“ File System Requirements

Supported

โœ… NTFS - Full support (Windows NT File System)
โœ… Local drives - C:\, D:\, etc.
โœ… External NTFS drives - USB drives formatted as NTFS

Not Supported

โŒ FAT32 - No encryption support
โŒ exFAT - No encryption support
โŒ Network drives - Limited support
โŒ Non-Windows systems - EFS is Windows-only

โ“ Troubleshooting

โ€œAccess Deniedโ€ Error

Solution:

# Run PowerShell as Administrator
# Right-click > Run as Administrator

โ€œcipher.exe not foundโ€

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"

โ€œThe file or directory is corruptedโ€

Solution:

โ€œCertificate not foundโ€

Solution:

# Generate new EFS certificate:
cipher /R

# Or encrypt a file to auto-generate:
cipher /E C:\test.txt

Canโ€™t Decrypt Files After Windows Reinstall

Solution:

Encrypted Files Show as Accessible to Others

Explanation:

๐Ÿ’ก Tips & Tricks

Encrypt Sensitive Folders Automatically

# Add to startup script
cipher-encrypt-folder "C:\Users\$env:USERNAME\Documents\Private"

Quick Encrypt on Right-Click

  1. Create PowerShell script: encrypt.ps1
  2. Add to SendTo folder
  3. Right-click > Send To > Encrypt

Check if File is Encrypted (PowerShell)

(Get-Item "C:\file.txt").Attributes -band [System.IO.FileAttributes]::Encrypted

Bulk Encrypt Files by Extension

Get-ChildItem -Recurse -Filter *.pdf | ForEach-Object {
    cipher-encrypt $_.FullName
}

Monitor Encryption Status

# Show daily stats
cipher-stats C:\Users\$env:USERNAME

๐ŸŽจ Color Guide

๐Ÿ“ Examples

Secure Document Storage

# Create encrypted folder
New-Item -ItemType Directory -Path "C:\SecureDocs"
cipher-encrypt-folder "C:\SecureDocs"

# Verify
cipher-stats "C:\SecureDocs"

Secure Delete Sensitive File

# Encrypt first
cipher-encrypt "C:\sensitive.doc"

# Then secure wipe original
cipher-wipe "C:\sensitive.doc"

Prepare for External Storage

# Create encrypted ZIP
cipher
# Select option 6
# Choose files/folders
# Set strong password
# Copy ZIP to USB drive

Audit Encryption Usage

# 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
}

๐Ÿš€ Performance

Lightweight

Speed Benchmarks (estimates)

Speeds vary based on: CPU, disk speed, file count, file types

๐Ÿ“š Further Reading


Part of TheSecretJuice ๐Ÿ’‰ by mini-page

Need help? Open an issue