Home > Linux, Unix > How to crypt/decrypt a file with vi?

How to crypt/decrypt a file with vi?


Crypt

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.

==================================================================================

Decrypt

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

Categories: Linux, Unix
  1. Kako
    30 October 2011 at 15:50

    Very Usefull

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: