# OpenPGP Public-Key algorithm

What means when pgpdump shows this kind of algorithm in the Public-Key Encrypted Session Key Packet?

New: Public-Key Encrypted Session Key Packet(tag 1)(126 bytes)
New version(3)
Key ID - 0xEC661A345473
Pub alg - Reserved for Elliptic Curve(pub 18)
unknown(pub 18)
-> m = sym alg(1 byte) + checksum(2 bytes) + PKCS-1 block type 02


What means m = sym alg(1 byte) + checksum(2 bytes) + PKCS-1 block type 02?

Which Elliptic-Curve-based operation was made from the sender software?

Pub alg - Reserved for Elliptic Curve(pub 18)
unknown(pub 18)


The output explains pgpdump knows this is an elliptic curve algorithm (which has ID 18), but does not understand the exact details (which curve was used, ...). Try gpg --list-packets instead which has full support for ECC (requires GnuPG 2.1, binary might also be called gpg2 on Debian and derivatives).

    -> m = sym alg(1 byte) + checksum(2 bytes) + PKCS-1 block type 02


These are details of the session key used for the symmetrically encrypted packet that will follow: the symmetric algorithm, a checksum and finally the PKCS-1 encoded session key. From RFC 4880, OpenPGP, 5.1. Public-Key Encrypted Session Key Packets (Tag 1):

The value "m" in the above formulas is derived from the session key as follows. First, the session key is prefixed with a one-octet algorithm identifier that specifies the symmetric encryption algorithm used to encrypt the following Symmetrically Encrypted Data Packet. Then a two-octet checksum is appended, which is equal to the sum of the preceding session key octets, not including the algorithm identifier, modulo 65536. This value is then encoded as described in PKCS#1 block encoding EME-PKCS1-v1_5 in Section 7.2.1 of [RFC3447] to form the "m" value used in the formulas above. See Section 13.1 of this document for notes on OpenPGP's use of PKCS#1.

• and what means m**e mod n ? in the RFC-4880 you linked me? thank you – Alexander.It Sep 6 '15 at 12:50
• @Alexander.It, m**e mod n should be $m^e\bmod n$. – SEJPM Sep 6 '15 at 13:18
• The formula describes the encryption using RSA, for ECC look into RFC 6637. – Jens Erat Sep 6 '15 at 13:26
• I also think the same but why not write m^e ? :@ – Alexander.It Sep 6 '15 at 13:26