Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

2984839

Cancelled
Original poster
Apr 19, 2014
2,114
2,241
I'm writing a shell script that will use OpenSSL's SMIME function to encrypt a file. I'll need a way for the user to pass in the key. Let me know which of these options you think is easier to remember. The script is simply called "aes"

Encrypting "file.txt" with "publickey.pem".
Code:
aes -e file.txt publickey.pem
vs
Code:
aes -e publickey.pem file.txt

Decrypting the resulting encrypted file using "privatekey.pem"

Code:
aes -d file.txt.aes192 privatekey.pem
vs
Code:
aes -d privatekey.pem file.txt.aes192

Right now, this is for my own uses, so syntax doesn't really matter as long as I remember it. However, I might send it to some friends, so I would like it to be easy to use. I'm also planning to add a "-shred" option to shred the plaintext file, so that will have to make its way in there too.
 
I prefer named arguments to positional arguments.

So I would instead have a syntax that looks like

-k key
-f file

With them coming in either order.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.