How to protect file in linux

In Linux you can protect your important file using below steps:

File output

$ cat impfile
Account info: 128940291313
Name: Shahzad Alam

Set password on file

$ vim -x  impfile
Enter encryption key: ******
Enter same key againp: ******

:wq   (save)

Now file is protected
$ vim impfile

Remove Password from File
open file using vim

#vim impfile


:set key=          (user optioin and save)

Now see file is unprotected

#vim impfile