To encrypt a file with vim, use :X when saving the file.
To remove the encryption, run :set key= in vim,
make some modifications in text,
then save file with :x.
Note that if you didn't make any modifications in text, The encryption will not be removed.