Can't read a file encrypted in vi on a Solaris machine on a Linux machine



I have a file that I encrypted in vi on a Solaris machine by using the -x option. When I try to read the file on a Linux machine using “vi -x”, it does not decrypt. Any idea how I can get the file decrypted? The Linux machine I have is RHEL 7.6.


Try passing the -R option, the -x will set a new key:

vim -R filename

Also what does the following says on your encrypted file?

file my-file


$ file myfile
myfile: data

It’s still encrypted when I run “vim -R myfile”. According to the man page the -R option is for read-only.


I found the solution here. I decrypted using this command line, after installing the mcrypt package:

mcrypt  -a  enigma  --keymode  scrypt --bare --decrypt myfile

The unencrypted file is written to myfile.dc.


Glad it sorted out and thank you for posting solution too.