Skip to content

CIPHER Windows Command Guide

The Windows cipher command is a built-in tool that allows users to encrypt and decrypt files or folders on a NTFS-formatted drive. This command provides a secure way to protect sensitive data by using different encryption algorithms such as AES. Users can choose to encrypt individual files or entire directories, as well as remove encryption from previously encrypted files. The cipher command also offers options to generate new encryption keys, display information about encrypted files, and securely delete data beyond recovery. By understanding how to use the cipher command effectively, users can enhance the privacy and security of their data on Windows systems.

CIPHER Syntax:

Terminal window
cipher [option] [parameter]

Options:

OptionDescription
/eEncrypt the specified directory
/dDecrypt the specified directory
/cDisplay the encryption status of the current directory
/sProcess the matching files in the current directory and all subdirectories
/hDisplay a list of commands
/kCreate a new file encryption key
/uUpdate the user’s file encryption key

Parameters:

ParameterDescription
DirectorySpecifies the directory to be encrypted or decrypted
/nUnprotect the existing encrypted file
/w:Path Specifies the directory path to work within when performing the encryption operation
/rGenerate an EFS recovery agent

CIPHER Command Samples:

Encrypt a Folder

Terminal window
cipher /E /S:C:\MyFolder

Encrypts the contents of the folder “MyFolder” located on the C drive.

Decrypt a Folder

Terminal window
cipher /D /S:C:\MyFolder

Decrypts the contents of the folder “MyFolder” located on the C drive.

Display Encryption Status of Files on Drive C:

Terminal window
cipher /S:C: /U

Displays the encryption status of files on the C drive.

Wipe Empty Space on Drive D:

Terminal window
cipher /W:D

Overwrites unused space on the D drive to prevent data recovery.

Display Help Information for Cipher

Terminal window
cipher /?

Shows detailed help information regarding the usage of the cipher command.

CIPHER FAQ:

How do I use cipher in CMD?

To use the cipher command in CMD, execute the following command:

Terminal window
cipher /e /s:C:\Folder

What is the purpose of the cipher /e parameter?

The cipher /e parameter is used to encrypt the specified directory. To encrypt a folder named “Confidential” located in C:\Users\JohnDoe, use the following command:

Terminal window
cipher /e C:\Users\JohnDoe\Confidential

How can I decrypt a folder using cipher in CMD?

To decrypt a folder named “Sensitive” located in D:\Data, use the following command:

Terminal window
cipher /d D:\Data\Sensitive

How do I list encrypted files and folders with cipher in CMD?

To display a list of encrypted files and folders in the current directory, use the following command:

Terminal window
cipher /s:C:\Folder /u

How can I remove encryption from a file using cipher in CMD?

To remove encryption from a file named “Report.docx” located in E:\Documents, use the following command:

Terminal window
cipher /d E:\Documents\Report.docx

What is the syntax for updating the encryption key using cipher in CMD?

To update the encryption key for a folder named “Confidential” located in F:\Data, use the following command:

Terminal window
cipher /R:1 F:\Data\Confidential

Applications of the CIPHER Command

  • Encrypt files and folders
  • Decrypt encrypted files and folders
  • Display encryption status of files and folders
  • Wipe free space on a drive
  • Wipe all data on a drive
  • Backup and restore EFS certificates and keys