-The advantages of VIM's encryption function
1. After encryption, if you do not know the password, you will not see the plaintext, including the root user can not see
-Cons
1. Obviously let others know encryption, it is easy for others to destroy the encrypted files, including content destruction and deletion;
-Encryption Test
```
[Email protected] shell]# vim Jiami.txt
Jaogj
Chy
Jaogaowe
Jaoghwq
Jaog
(The above content is only test content)
: X (note here is the uppercase X) carriage return;
Enter Password: ************ (enter after you can see the need for password)
Please enter again: ************
Then save and exit
[[email protected] shell]# cat Jiami.txt (after viewing is garbled
vimcrypt~01! O_. 4x¤:a
```
= = with cat or more to view the contents of the file, displayed as garbled, with Vim to re-edit the file, will prompt for a password, if the password entered is incorrect, the same will be displayed as garbled!
Note: Do not forget the password after the file is encrypted! ==
-If the password is set, but there is a problem we set the password how to cancel the password? Here's how vim cancels the password
1. First method:: Set key=
```
Johagowhoag
Jaogj
Chy
Jaogaowe
Jaoghwq
Jaog
: Set key=
Use VIM to open the file, such as Jiami.txt, to enter the correct password, and then at the time of editing, set the password to NULL, the command is: set key=
[email protected] shell]# cat Jiami.txt
Johagowhoag
Jaogj
Chy
Jaogaowe
Jaoghwq
Jaog
```
2.
```
Johagowhoag
Jaogj
Chy
Jaogaowe
Jaoghwq
Jaog
: X after the direct return, enter after the direct use of the password can be saved to exit
[email protected] shell]# cat Jiami.txt
Johagowhoag
Jaogj
Chy
Jaogaowe
Jaoghwq
Jaog
```
Warm hint: The configuration file encryption, the program again to call the encrypted file is not possible.
VIM encryption function