LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   PGP encryption (https://www.linuxquestions.org/questions/programming-9/pgp-encryption-582533/)

JenniJenni 09-05-2007 09:34 PM

PGP encryption
 
I am trying to understand the PGP Encryption along with Digital Signature.

CASE 1

When I send an encrypted File to my Business Partner
-----------------------------------------
gpg -e "Publickey1" "PrivateKey1" .

Note
Publickey1 is to encrypt the file (Its provided by my business partner)

here Privatekey1 is used to do the Digital signature (Created by our company)

CASE 2

When I receive an Encrypted file from my Business Partner
---------------------------------------------------------
While doing the DECRYPTION

GPG -d "Privatekey1" "PublicKey2"

Privatekey1 : used to decrypt the file(in case 1 it was used to create the digital signature)

PublicKey2 : Used to verify the digital signature (Provided by our business partner)

Now my question here whether the Same key(PrivateKey1) is used for Digital Signature (while sending the file - Case 1) and also to do the Decryption (Case 2) ?

Whether my understanding is correct?

lostnhell 09-05-2007 10:42 PM

http://en.wikipedia.org/wiki/Pretty_...n.2Fdecryption will give you the answer you are seeking.

JenniJenni 09-05-2007 10:54 PM

Thanks a lot.

But still I am not clear. Whether the pseduocode above what I have placed and my understanding is correct or wrong/

lostnhell 09-05-2007 11:03 PM

Quote:

Originally Posted by JenniJenni (Post 2882761)
Thanks a lot.

But still I am not clear. Whether the pseduocode above what I have placed and my understanding is correct or wrong/


If you and the recipient have exchanged keys then the message is encrypted using the recipient's public key and appends the digital signature from your public key to verify that the package and or message was originally from you.

The file is decrypted using the recipient's private key and their system uses the signature from your public key to confirm the sending user.

JenniJenni 09-05-2007 11:21 PM

Thanks LostnHell for your help.

Would you kindly say whether my Pseudocode is correct?

I understand completely while doing the Encryption we need the Public Key(Supplied by our Business Partner)

While Decrypting we need the Private Key.

Now when its comes to Digital Signature , when we encrypt the file we use the Public key (given by our bUsiness partner) Plus the Private KEY

This is where I got confused, the Private Key to sign the document what it is? The Private key what we use in sign the File during the encryption process and the Private key what we use to decrypt the file are same?

Sorry , I was totally confused with this simple logic. Please help me

lostnhell 09-05-2007 11:48 PM

The syntax is incorrect.

ENCRYPT
gpg -o OutPut_File.gpg -e -r Recipient_Name File_to_encrypt.ext


DECYRPT

gpg -o Output_FIle.ext --decrypt Encrypted_Archive.gpg

http://www.penguin-soft.com/penguin/man/1/gpg.html Contains the GNUpg man page which will give you all options and some syntax.


All times are GMT -5. The time now is 05:28 AM.