3

I have encrypted a file on a Solaris server using the encrypt command, with a keyfile generated via pktool (choosing AES-128 as the algorithm). I do not have access to any other encryption utilities on this server. What application(s) could I use to decrypt this file on a more generic Linux server?

EDIT:

Here are the Solaris commands I used:

pktool genkey keystore=file outkey=testkeyfile.dat dir=mydir
keytype=aes keylen=128 encrypt -a aes -k mydir/testkeyfile.dat -i mydir/myfile -v -o mydir/myfile.enc

I also ran the following to check that the file was correctly encrypted:

decrypt -a aes -k mydir/testkeyfile.dat -i mydir/myfile.enc -v -o mydir/myfile2

I suspect mcrypt is probably the way to go here, but can anyone advise on the options that I'd need to use?

user3490
  • 582
  • 5
  • 14

3 Answers3

1

If the system tools are not compatible, you could use other cross-platform encrypters.

Some of the best-known tools are GnuPG and AES Crypt, available and compatible across almost all platforms.

harrymc
  • 455,459
  • 31
  • 526
  • 924
  • I don't think these are installed on the solaris server in question. I don't have superuser privileges, so I don't think I'd be able to install anything, and in this case I can't get anyone else to do it either. – user3490 Jun 23 '13 at 11:56
  • You may not need superuser. See [How can I install an RPM without being root?](http://superuser.com/questions/209808/how-can-i-install-an-rpm-without-being-root). – harrymc Jun 23 '13 at 13:41
  • Thanks for the suggestion - I attempted this with an unrelated rpm but got an error running the make command, presumably because something wasn't in the expected location. – user3490 Jun 24 '13 at 21:33
  • Yes, not all packages can be installed that way. This should work for GnuPG version 1.4.13 which is portable. You might also just compile from source. See for example this [lightweight implementation](http://www.literatecode.com/aes256). – harrymc Jun 25 '13 at 06:56
1

What about using the openssl command? I'm almost positive it comes preinstalled on Solaris, possibly somewhere under /usr/sfw/?

Check the official openssl documentation here:

http://www.openssl.org/docs/apps/enc.html

Or someone else's useful guide:

http://www.madboa.com/geek/openssl/#encrypt-simple

  • Like I said, I don't have access to any other encryption utilities on the server. Unfortunately this includes openssl - there is a man page for it on the system, but it only describes how to use it in a compiled program. I am not able to call it from the command line. – user3490 Jun 23 '13 at 11:51
  • Actually, this is installed and I've got it working (it was in /usr/sfw/bin - whereis only knew about the man page). I still need to successfully decrypt a file on another server. If it works, the bounty is yours. – user3490 Jun 23 '13 at 12:20
  • Confirmed working on Ubuntu 12.10. Thanks! – user3490 Jun 24 '13 at 21:35
0

I have a perl script that will decrypt files encrypted with Solaris' 'encrypt' command and with the arcfour algorithm. It works on linux.