Encrypting File with passphrase

David Shaw dshaw at jabberwocky.com
Thu Mar 13 13:08:11 CET 2014


On Mar 12, 2014, at 9:07 AM, Kumar, Vikash X <Vikash.X.Kumar at in.tesco.com> wrote:

> Hi Team,
>  
> Could you please help me to understand the following query.
>  
> We are using gpg encryption method for encryption and decryption in our application. We have generated the keypairs on server A and public key is imported on server B also a passphrase say “Strange” was provided while generating the key.
>  
> Now I am trying to encrypt the file on server B using this public key, I am able to do so without any matter I pass the passphrase or not.
>  
> So my ask is, if a key pair is generated with passphrase it won’t restrict the encryption incase incorrect passphrase or no passphrase is passed? Also I was able to encrypt the file on server B by providing any random passphrase, but decryption is possible with correct passphrase only.

In short, yes (though you don't need to provide a passphrase at all to encrypt to a public key - the passphrase has no meaning there).  Encrypting to a public key does not use a passphrase at all.  Only decrypting with the private key uses a passphrase.

David




More information about the Gnupg-users mailing list