Skip to content


Encrypting local files in Solaris

How do I encrypt local file in Solaris ? On Linux I use either OpenSSL or GPG but these are both open source projects not native in Solaris land. For this Solaris has encrypt/decrypt which do what their name say.
And of course we talk here about symmetric encryption. Options for encrypt/decrypt are succinct – list available algorithms, specify input/output file(s), and optional specify file containing the key or otherwise type it on terminal. Few examples are to follow.
– List algos

# encrypt –l
Algorithm Keysize: Min Max (bits)
——————————————
aes 128 256
arcfour 8 2048
des 64 64
3des 192 192

- Now let’s encrypt something (file smtp_send.py ) with AES algo .

# encrypt -a aes -i smtp_send.py -o smtp_send.py.enc
Enter key:
Solaris#
Solaris# file smtp_send.py.enc
smtp_send.py.enc: data

- And what about decrypting ?

# decrypt -a aes -i smtp_send.py.enc -o smtp_send.py.dec
Enter key:

- In case you wish to use key stored in a file (I personally don’t do it as it is too easy to forget to delete the key file).

# encrypt -a aes –k key_in_a_file.txt -i smtp_send.py -o smtp_send.py.enc

Posted in Solaris.

Tagged with .


3 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Level Paying Field says

    What do you do with Enter Key: ?
    if I leave it blank it reads “encrypt: invalid key”

  2. Yuri says

    You enter passphrase you want this file to be encrypted with

  3. thehme says

    In this case you encrypted a *.py file, and supposing this was a readable file or directory, when you decrypt into *.dec, how would you then go and get the readable file or contents of the directory?



Some HTML is OK

or, reply to this post via trackback.