2
$\begingroup$

While signing a test-file, gpg2 creates a file test.sig which contains this:

$ gpg2 --list-packets --verbose < test.sig
# off=0 ctb=89 tag=2 hlen=3 plen=540
:signature packet: algo 1, keyid C109A1FD84E2C2E5
    version 4, created 1510595093, md5len 0, sigclass 0x00
    digest algo 8, begin of digest cd 94
    hashed subpkt 2 len 4 (sig created 2017-11-13)
    subpkt 16 len 8 (issuer key ID C109A1FD84E2C2E5)
    data: 6198169E372BE3023D812F6E7AB24E600C326D77D6F8E690CDE45027F402F20325DEA9FEE9D2E32E04F798F5DB8700F734D65972C150DDF2B8ADD823D00190A5C9722E39C699D45D237343C741D991B78476270D5C5FBD996F032671BCA20890B0B994B4997A500D3AFC8B7446EAE3FF4F66A32DF8ED8E0B7741E4DD17B15D265D19C13D7349CC09E1094381C2BAE20375454A3825C842CC1E968428ABB451AA1B26555F081CE9D3C3A4F0222F86BAD0597A61B2B2FC4846FF400F52D3C58C7E29B2379E6022FBF0FC4C539421F4445EA7C905ABD98380D1218D82EB1ABCB9756B4A5F45AC668499E1405C72BEB5D2BF4F732EF0129B4EFE90C4F4308C4C6B6883A1A44A4A03C355A1D50F8E6172BCEC5F3A0D95696A1481F02D98D68A4CB52DD70E24C3535E2BCEE1DCD4D39DCFD0185DB06CE7BDE45DF5A723FB309819C79F27FBE602C26443D5E68F73911233E71C62D03099CCEF94431B37E17197E45475849938BDD6486E91204D17FE2E56C20F2B083FF44F6B1F63E747B73AAC9E21AFB2C15BD345D3F79AAA6F058D6D1288136727390879509928D874DEA5E285C6952F74137173AC2454FAAC06AEE90F94EC812E449C8E5F09F3419A8BE6981CBF9FB5D4E2DD6424AC316A7EDAB3AE98B9BD8979BB85E97328E882803C8AA522630C4E19B583682BA9F0575DDE642BA2BA3B7FECBCFFEF99C95B2D322B7FFDC30D2D

I assume that algo 1 means RSA, but how can that be used to create data (which I suppose should be the signature) ? What is algo 8?

$\endgroup$
3
$\begingroup$

I assume that algo 1 means RSA

Correct. From RFC 4880:

9.1.  Public-Key Algorithms

      ID           Algorithm
      --           ---------
      1          - RSA (Encrypt or Sign) [HAC]
      2          - RSA Encrypt-Only [HAC]
      3          - RSA Sign-Only [HAC]
      16         - Elgamal (Encrypt-Only) [ELGAMAL] [HAC]
      17         - DSA (Digital Signature Algorithm) [FIPS186] [HAC]
      18         - Reserved for Elliptic Curve
      19         - Reserved for ECDSA
      20         - Reserved (formerly Elgamal Encrypt or Sign)
      21         - Reserved for Diffie-Hellman (X9.42,
                   as defined for IETF-S/MIME)
      100 to 110 - Private/Experimental algorithm

What is algo 8?

It indicates that SHA-256 was used for computing the hash. Again, from the RFC:

9.4.  Hash Algorithms

      ID           Algorithm                             Text Name
      --           ---------                             ---------
      1          - MD5 [HAC]                             "MD5"
      2          - SHA-1 [FIPS180]                       "SHA1"
      3          - RIPE-MD/160 [HAC]                     "RIPEMD160"
      4          - Reserved
      5          - Reserved
      6          - Reserved
      7          - Reserved
      8          - SHA256 [FIPS180]                      "SHA256"
      9          - SHA384 [FIPS180]                      "SHA384"
      10         - SHA512 [FIPS180]                      "SHA512"
      11         - SHA224 [FIPS180]                      "SHA224"
      100 to 110 - Private/Experimental algorithm

You might want to try to get some practice in reading RFCs. It can be a bit overwhelming at first, but the information is all there - especially for the OpenPGP standard which is extensively documented.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.