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

vim
security
encryption

#1

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.


#2

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

#3

$ 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.


#4

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.


#5

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