LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   gpg question (https://www.linuxquestions.org/questions/linux-newbie-8/gpg-question-176246/)

gazza 04-30-2004 04:50 AM

gpg question
 
I have generated my keys and mail encryption is fine, my question is though what if I wanted to encrypt a file and have another user unencrypt it with a password i set ?

How would this be done ?

robartes 04-30-2004 05:14 AM

Hi,

what you want to do is symmetric encryption (single key). You can do this with the -c or --symmetric flags to gpg:

Code:

gpg -c my_file
This will ask for a passphrase twice, and the encrypted version of the file will end up in my_file.gpg.

You could also use asymmetric encryption (which solves the key distribution problem and is what gpg is actually built for), by using the recipients public key to encrypt the message. That way, only the recipient can decrypt it, without the need for a shared secret.

Code:

gpg -e my_file
This will ask for the recipient. Specify the recipient by either his id (usually email) or pubkey ID.

gazza 04-30-2004 05:28 AM

Great

Cheers.


All times are GMT -5. The time now is 11:06 AM.