What is a gpg subkey?

206    Asked by Anil Mer in Cyber Security , Asked on Mar 16, 2022

 I fairly understand the maths behind RSA, Elgamal, AES, SHA but not how things are used in practice. How are subkeys different from master keys? I understand its purpose from various websites but How is it internally implemented? How is it bound to the master key? Is it an OpenPGP terminology?

Answered by Amit jaisawal

Subkeys

Subkey packets are defined in RFC 4880, OpenPGP, 5.5 Key Material Packet. They're only distinguished by another packet ID, and require a binding signature to be actually useful (see below). A Public-Subkey packet (tag 14) has exactly the same format as a Public-Key packet, but denotes a subkey. Subkey Usag OpenPGP subkeys are used for different purposes: Being able to store the primary key offline or a more secure device. If a machine with a subkey is harmed, you can easily revoke the subkey without all the hassles of revoking your primary key (sharing a new key, getting new signatures, ...).

Having different subkeys on different machines, for example a signing subkey on a build server. Again, revoking single keys is easy.Using a larger primary key for a long lifetime, and shorter, but faster subkeys for day-to-day usage. Some algorithms do not support both encrypting and signing. For example, a DSA primary key requires another key for encryption, typically paired with ElGamal. Binding Signatures There are special signature subtypes to bind subkeys to primary keys (and vice versa), listed in RFC 4880, OpenPGP, 5.2.1 Signature Types: 0x18: Subkey Binding Signature

This signature is a statement by the top-level signing key that indicates that it owns the subkey. This signature is calculated directly on the primary key and subkey, and not on any User ID or other packets. A signature that binds a signing gpg subkey MUST have an Embedded Signature subpacket in this binding signature that contains a 0x19 signature made by the signing subkey on the primary key and subkey. 0x19: Primary Key Binding Signature This signature is a statement by a signing subkey, indicating that it is owned by the primary key and subkey. This signature is calculated the same way as a 0x18 signature: directly on the primary key and subkey, and not on any User ID or other packets.



Your Answer

Interviews

Parent Categories