You can password protect a file using VIM – it’s built right in. To do this either edit a current file or create a new file e.g. testdata.txt and press :X
You can also create a file with encryption turned on by including the -x switch e.g.
vim -x test2.txt
man vim for more details.