The cipher command in Windows
The cipher command displays or changes the encryption of folders and files on NTFS volumes. If used without parameters, the cipher command displays the encryption status of the current directory and any files that contain it.
For an example of how to use this command, please see the Example below.
Cipher command syntax
cipher [/e | /d | /c] [/s:] [/b] [/h] [PathName [.]] cipher /k cipher /r: [/smartcard] cipher /u [/n] cipher /w: cipher /x[:efsfile] [FileName] cipher /y cipher /adduser [/certhash: | /certfile:] [/s:Directory] [/b] [/h] [PathName [.]] cipher /removeuser /certhash: [/s:] [/b] [/h] [ [.]] cipher /rekey [PathName [.]]
Parameters
Parameter Description / b Remove if an error occurs. By default, the cipher command continues to run even if an error occurs. / c Displays information on the encrypted file. / d Decrypt the specified file or directory. / e Encrypt the specified file or directory. The directory is marked so that the added files are then encrypted. / h Displays files with hidden properties or system. By default, these files are not encrypted or decrypted. / k Create new certificates and keys for use with the Encrypting File System (EFS) files. If the / k parameter is specified, all other parameters will be ignored. / r: [/ smartcard] Create a key and EFS recovery agent certificate, then write them to a .pfx file (containing certificates and private keys) and a .cer file (containing only certificates). If / smartcard is specified, it will write the recovery key and certificate to the smartcard and no .pfx file will be created. / s: Perform the specified operation on all subdirectories in the specified directory. / u [/ n] Find all encrypted files on the local drive (s). If used with the / n parameter , no updates are made. If used without / n, / u compare the user's file encryption key or recovery agent key with the current key and update them if they have changed. This parameter only works with / n. / w: Remove data from unused space across the entire drive. If you use the / w parameter , all other parameters will be ignored. The specified directory can be placed anywhere on a local drive. If it is a mount point or points to a folder in another drive, the data on that drive will be deleted. / x [: efsfile] [] Back up the EFS keys and certificates to the specified file name. If used with : efsfile, / xbacks will back up the user's certificate (s) used to encrypt the file. Otherwise, the EFS certificate and the user's current key will be backed up. / y Displays your current EFS certificate thumbnail on the local computer. / adduser [/ certhash: / certfile:] / rekey Update the encrypted file (s), specify to use the currently configured EFS key. / removeuser / certhash: Delete the user from the specified file (s). The provided hash / certhash must be the SHA1 hash function of the certificate. /? Show help at the command prompt.Note
- If the root directory is not encrypted, an encrypted file can be decrypted when it is modified. Therefore, when you encrypt a file, you should also encrypt the root directory.
- The administrator can add the contents of the .cer file to the EFS recovery policy to create recovery agents for users and then import the .pfx file to restore individual files.
- You can use multiple directory names and wildcards.
- You must set a space between multiple parameters.
For example
To display the encryption status of each file and subdirectory in the current directory, enter:
cipher
Encrypted files and folders are marked with E. Unencrypted files and folders are marked with U. For example, the following output indicates that the current directory and all its content are not currently encrypted:
Listing C:UsersMainUserDocuments New files added to this directory will not be encrypted. U Private U hello.doc U hello.txt
To enable encryption on the Private folder used in the previous example, enter:
cipher /e private
The following output is displayed:
Encrypting files in C:UsersMainUserDocuments Private [OK] 1 file(s) [or directorie(s)] within 1 directorie(s) were encrypted.
The cipher command displays the following results:
Listing C:UsersMainUserDocuments New files added to this directory will not be encrypted. E Private U hello.doc U hello.txt
Note that the Private folder is marked as encrypted.
See more:
- Choice command in Windows
- Cmstp command in Windows
- Cmdkey command in Windows
You should read it
May be interested
- Rem command in Windowsthe rem command helps write comments (comments) in a batch file or config.sys.
- Instructions for using Command Promptdeep in windows is a command-line world that is obscure. in this article, we will show you how to solve errors and make your computer more secure.
- Rd command in Windowsthe rd command helps delete a directory
- Cmd command in Windowsthe cmd command starts a new version of the command interpreter, cmd.exe. if used without parameters, cmd will display copyright information and the version of the operating system.
- How to use the command history function in Command Promptcommand prompt is an extremely familiar command for anyone using windows operating system. besides, a lot of current software also supports the command line to perform actions on the command prompt window, instead of on the screen.
- The sfc command in Windows(applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012)
- Reg command copy in Windowsto copy an entry to the location specified on the local pc or the remote computer we will use the reg copy command. to learn more about how to use the reg copy command, you can track the syntax, explain the command parameters and the example tipsmake.com has compiled below.
- Fc command in Windowsthe fc command compares two files or a collection of files and displays the differences between them.
- The echo command in Windowsthe echo command displays the message or turns on / off the command repeat feature. if used without parameters, the echo command will display the current echo setting.
- Xcopy command in Windowsthe xcopy command is a command prompt command used to copy one or more files or folders from one location to another. with many options and the ability to copy entire directories, the xcopy command is similar to, but much more powerful, than the copy command.