Ask the Expert

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.

    Requires Free Membership to View

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

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

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: