Encrypt data using a public key

How can I make a user enter a key or password to get access to .tar files in Unix? For example, I have a program and all my scripts are in A.tar archive. I want users to enter a password or key to extract A.tar. This need to work on Linux, Solairs, HP-UX, AIX and maybe on Uss systems.
Why don't you look into GPG, which is the GNU version of PGP (Pretty Good Privacy)? This will allow you to encrypt data easily using a public key. There are several steps, including creating a key, exporting it to your textfile, encrypting the data, and later the decryption process.

The encryption syntax would be something like this.

gpg --recipient "RECIPIENT" --encrypt-files "yourfilename"

Here's an FAQ that will be helpful to you.

This was first published in May 2005

Dig Deeper on Linux system security best practices

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.



Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: