Video Screencast Help

pgp key size

Created: 02 Jan 2013 • Updated: 07 Jan 2013 | 15 comments
This issue has been solved. See solution.

Hi

 I have a main key that is 1024. This is being used by many clients. There is a new client that emphasizes on the main key being 2048 bits.

- Can I change the main key? Is that possible?

- If I change it, I will have to export it and send it across to ALL the clients that have my 1024 public key. Is this right?

- I can generate a subkey with 2048. But they want the main key to be 2048. what are my options?

Thanks

 

Comments 15 CommentsJump to latest comment

Tom Mc's picture

By "main key" I believe that you are referring to the signing key.  With recent versions of PGP, you can right click on your key in All Keys of PGP Desktop, select Key Properties, click Add in the Subkeys area, click to set the new subkey as a signing key, set the desired key size, and click on OK.  This should take care of the new client's concern. 

When you consider your issue resolved, please click Mark As Solution on the most helpful response.

Search the Knowledge Base &

Mylapore's picture

Hi Tom,  I am using PGP command line 10.0.

Keydetails:  tscmad@mysite.com
KeyID: 0x6988846D (0xC64582AB6988846D)
Type: RSA (v4) key pair
       Size: 1024
   Validity: Complete
      Trust: Implicit (Axiomatic)
    Created: 2010-10-26
    Expires: Never

Subkey ID: 0x0DF91564 (0x6BF832DC0DF91564)
       Type: RSA (v4) subkey pair
       Size: 2048
    Created: 2012-12-31
    Expires: 2015-01-10
     Status: Active

-- They arent happy with the Subkey. they want the primary key 0x6988846D to be changed to 2048 and set with an expiry date.

- How can I change the keysize for 0x6988846D - which is my primary key?

- If I change it, There are other clients that use this key. Would it continue to work for them? They will have the 1024 bit key that was exported. If I make ANY change to the main key (size or Expiry date), I will have to send my key over to all the other clients as well . right?

Thanks

 

Tom Mc's picture

I'm sorry that I failed to see which forum this was posted in!  Although you should still be able to add a signing subkey to take care of this problem, I'll have to let a command line user help you with the specifics of doing so.  If you happen to have PGP Desktop available on another machine, you could follow my suggestion above.

If you do the needed subkey addition, it will not affect people with your now existing key in their encryption to you, or in your encryption to them.  But you will be making future digital signatures with the new subkey, so those not having the new subkey will not be able to verify your newer signatures. 

Another option for you, would be to just generate a new key for that new user to use with you - you can still continue to use your now existing key for everyone else.

Whether you make alterations to your current key or generate a new key, no one without the new or updated key will be otherwise effected by your change.

 

When you consider your issue resolved, please click Mark As Solution on the most helpful response.

Search the Knowledge Base &

dfinkelstein's picture

You cannot change the size of the key 0x6988846D.

You can generate new subkeys (for signing and encryption) of larger sizes, but the top key ("main" key, that certifies your subkeys) cannot be changed.

If that is a problem for your partner, you will need to generate an entirely new key.

There is no reason you can't generate a new key, and have your existing customers continue to use your old key.  Both can even have the same UserID, though you may have to refer to them by KeyID in order to differentiate between them.

 

--------

David Finkelstein

Symantec R&D

Mylapore's picture

Thanks.

if I generate a new key

pgp --gen-key ForNewClient --key-type [key type] --bits 2048 --passphrase [passphrase]

1. Will it add this to the Private Keyring by itself? There is  a secring.skr file. Will this gen-key update it?

2. I can verify and import which would import it to the existing public key ring pubring.pkr file. Is this right?

3. How do I enforce decrypt with this ID? I dont see an option in decrypt that passes a KEYID

pgp --decrypt <input> [<input2> ...] [<inputd>...]

[options] where options are 'annotate','archive','decryptwith for KMS','email' , 'output'

Thank you for your time.

 

dfinkelstein's picture

Hi,

1.  Yes, when you generate a new key, it will be added to your secret keyring automatically.

2.  If you generate it, you don't need to do any additional steps of verifying it or importing it.

3.  Decryption is done using whatever key is appropriate.  You don't have to specify the KeyID of the decrypting key.  In general an OpenPGP message contains the KeyIDs of the recipients; PGP Command Line will match up the recipient KeyIDs with your keys, and use the appropriate one.  (It might even be encrypted to more than one of your keys, in which case it will use a key that is already unlocked, or the one that is unlocked with the supplied passphrase.)

Regards,

 

--------

David Finkelstein

Symantec R&D

Mylapore's picture

Does the * in the list-keys imply that it is unlocked?

[.pgp]$ pgp --list-keys
 Alg  Type Size/Type Flags   Key ID     User ID
----- ---- --------- ------- ---------- -------
 RSA4 pair 2048/1024 [VI---] 0x6988846D  netmad@mysite.com

*RSA4 pair 2048/2048 [VI---] 0xF3B9877B netmad2@mysite.com -- The * here ? What does it mean?

What about different pass phrase provided during key-gen? Is it better to provide the same passphrase? Otherwise, we need to know which is the passphrase that was used during encryption. If I dont pass on the passphrase, decrypt file returns " no passphrase provided. "

what is the best practice? to provide different passphrase & then decrypt knowing who encrypted it?  or providing the same passphrase for all keys generated?

Thanks

dfinkelstein's picture

The best practice is to use a strong passphrase.  The danger of using the same passphrase for different keys is if you have different people who are responsible for the different keys -- you don't want people to know the passphrase for keys unless they need to actually use those keys.  If that is not a concern then you can use the same passphrase, and to your point, it makes decryption simpler (since you can provide the same passphrase always).  But it does have some risk; you may decide later to have different key owners, but forget that the keys use the same passphrase.

You can tell to which key a file is encrypted by running "pgp --verify input-file".   You don't have to know who the file came from.  The output of "pgp --verify" can even be parsed programmatically so you can create a script that provides the correct passphrase depending on to whom the file was encrypted.

The '*' means that this is the "default" key, this key will be used to sign files if you do not explicitly specify a signer, and when you specify "--encrypt-to-self" this is the key that will be encrypted to.

Regards,

 

--------

David Finkelstein

Symantec R&D

Mylapore's picture

Can I change the default?  This would pose an issue. Since it shows the newly generated key as the default,

when we encrypt files, it will use this new key to sign instead of the old one . 

:-(

This is PROD. Can you kindly reply back soon?

This is command we use to encrypt

 pgp --encrypt "$TARGET_DIR/$INFILE" --sign --passphrase $PASS --recipient $CLIENT_KEYNAME --overwrite remove --output "$TARGET_DIR/$OUT_FILE.pgp"
 

Thanks

Mylapore's picture

I see that I can specify the default key in

 pgp --encrypt "$TARGET_DIR/$INFILE" --sign --passphrase $PASS --default-key KEYID --recipient $CLIENT_KEYNAME --overwrite remove --output "$TARGET_DIR/$OUT_FILE.pgp"
 

If I do not speficy the default, it is going to sign with my new KEY. Would it then fail when the OTHER CLIENTS who do not have my new public key try to decrypt the file?

Thanks

Tom Mc's picture

If I do not speficy the default, it is going to sign with my new KEY. Would it then fail when the OTHER CLIENTS who do not have my new public key try to decrypt the file?

You encrypt to their public key, so they will still be able to use their private key for the decryption.  However, if they do not have the public portion of the key you signed with, they will not be able to verify your signature.

 

 

When you consider your issue resolved, please click Mark As Solution on the most helpful response.

Search the Knowledge Base &

Mylapore's picture

Thank you. I would have completely missed this part. Thanks Tom & David. I enforced the sign using

--default-key KEYID 

Is there a way to make a key default ?

[.pgp]$ pgp --list-keys
 Alg  Type Size/Type Flags   Key ID     User ID
----- ---- --------- ------- ---------- -------
 RSA4 pair 2048/1024 [VI---] 0x6988846D  netmad@mysite.com

*RSA4 pair 2048/2048 [VI---] 0xF3B9877B netmad2@mysite.com

In the above - Can i CHANGE 0x6988846D  to be the default? Is that possible?

or PGP takes the last key generated as the default?

Thanks

dfinkelstein's picture

The "default" key will be the "newest" one, typically the last one generated.

You can specify a different default key by adding a setting for CLDefaultKey in the PGPPrefs.xml configuration file.  The value should be the KeyID of the key you want, e.g.

<key>CLdefaultKey</key>
 
<string>0x6988846D</string>
 

Regards,

 

 

--------

David Finkelstein

Symantec R&D

SOLUTION
dfinkelstein's picture

You can also explicity specify a signing key by using the "--signer" option, e.g.

pgp -er recipient input-file --sign --signer 0x6988846D

 

--------

David Finkelstein

Symantec R&D

Mylapore's picture

Thank you for all the help David and Tom.