How to crypt/decrypt a file with vi?
Open the file using vi, type “:X“, enter the key (this key will be the password to see the crypted file) and then save and exit by “:wq“.
The file will be crypted.
You can use:
vi -x yourfile
to do the same thing.
To decrypt just the way you encrypted the file.
Open the file using vi, type “:X“, enter the key and after that the file will be visible and writable. If you close and save your file by “:wq” the file will be still crypted.
To descript forever the crypted file
Open the file using vi, type “:X“, push two times the “enter” button and then save and exit by “:wq“.
The file will be decrypted