Wondering if someone can help me with they way to use openssl or something similar. In a solaris box normally I'm doing this:

decrypt -a aes -k my.key -i mypasswd.aes.cr > /tmp/tmp.file

then modify some passwords inside the tmp file, and proceed to encrypt it again

encrypt -a aes -k my.key -i /tmp/tmp.file -o mypasswd.aes.cr

But in Linux i dont have that solaris commands, so is there a way to do the same thing on linux with same files? I tried with openssl and seems to have a lot of options and parameters. i tried with few of them, like following command:

bash-4.2$ openssl  aes-128-cbc -d  -pass file:my.key -in mypasswd.aes.cr -out /tmp/tmp.file
bad magic number

I don't know what option i need to use, too many!

NOTE:seems like mypasswd.aes.cr is based on default aes 128bits encryption

thanks in advance!


If you have access to openssl, you can use the OpenSSL enc option to encrypt/decrypt files.

For example:

$ openssl enc -bf -a -in data.txt -out data.enc
enter bf-cbc encryption password:
Verifying - enter bf-cbc encryption password:

will encrypt data.txt using Blowfish CBC and store the encrypted data in data.enc in base-64 encoded format.

You can use a key file with the -kfile option:

$ openssl enc -aes128 -a -in data.txt -out data.enc -kfile my.key

The encrypted data may or may not be compatible with the Solaris encrypt/decrypt commands. You'll have to test compatibility.

You can enter

$ openssl enc ciphers

to get a list of ciphers your version of OpenSSL supports.

Note that storing your key file with the data it's protecting isn't very safe.

| improve this answer | |
  • Thanks for your replay :). I see, seems I will need to migrate from solaris commands to openssl, maybe trying from the scratch with decrypted file on solaris then encrypt it using linux, so in the futures request i can do it from Linux. – harguer Jan 10 '18 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.