pgp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. #------------------------------------------------------------------------------
  2. # $File: pgp,v 1.27 2025/12/18 18:33:33 christos Exp $
  3. # pgp: file(1) magic for Pretty Good Privacy
  4. # Reference: https://www.iana.org/assignments/openpgp/openpgp.xhtml
  5. # PGP compressed data packet (RFC 4880, section 5.6)
  6. 0 beshort 0xa301 PGP compressed data (ZIP)
  7. 0 beshort 0xa302 PGP compressed data (ZLIB)
  8. 0 beshort 0xa303 PGP compressed data (BZIP2)
  9. # Handling of binary PGP keys is in pgp-binary-keys.
  10. # see https://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
  11. #
  12. 0 beshort 0xa600 PGP encrypted data
  13. #!:mime application/pgp-encrypted
  14. #0 string -----BEGIN\040PGP text/PGP armored data
  15. !:mime text/PGP # encoding: armored data
  16. #>15 string PUBLIC\040KEY\040BLOCK- public key block
  17. #>15 string MESSAGE- message
  18. #>15 string SIGNED\040MESSAGE- signed message
  19. #>15 string PGP\040SIGNATURE- signature
  20. # Update: Joerg Jenderek
  21. # URL: http://en.wikipedia.org/wiki/Pretty_Good_Privacy
  22. # Reference: https://reposcope.com/mimetype/application/pgp-keys
  23. 2 string ---BEGIN\040PGP\040PRIVATE\040KEY\040BLOCK- PGP private key block
  24. #!:mime text/PGP
  25. !:mime application/pgp-keys
  26. !:ext asc
  27. 2 string ---BEGIN\040PGP\040PUBLIC\040KEY\040BLOCK- PGP public key block
  28. !:mime application/pgp-keys
  29. !:ext asc
  30. >10 search/100 \n\n
  31. >>&0 use pgp
  32. 0 string -----BEGIN\040PGP\040MESSAGE- PGP message
  33. # https://reposcope.com/mimetype/application/pgp-encrypted
  34. #!:mime application/pgp
  35. !:mime application/pgp-encrypted
  36. !:ext asc
  37. #!:ext asc/pgp/gpg
  38. >10 search/100 \n\n
  39. >>&0 use pgp
  40. # Reference: https://www.gnupg.org/gph/en/manual/x135.html
  41. 0 string -----BEGIN\040PGP\040SIGNED\040MESSAGE- PGP signed message
  42. #!:mime text/plain
  43. !:mime text/PGP
  44. #!:mime application/pgp
  45. !:ext asc
  46. 0 string -----BEGIN\040PGP\040SIGNATURE- PGP signature
  47. # https://reposcope.com/mimetype/application/pgp-signature
  48. !:mime application/pgp-signature
  49. !:ext asc
  50. >10 search/100 \n\n
  51. >>&0 use pgp
  52. # Decode the type of the packet based on it's base64 encoding.
  53. # Idea from Mark Martinec
  54. # The specification is in RFC 4880, section 4.2 and 4.3:
  55. # https://tools.ietf.org/html/rfc4880#section-4.2
  56. 0 name pgp
  57. >0 byte 0x67 Reserved (old)
  58. >0 byte 0x68 Public-Key Encrypted Session Key (old)
  59. >0 byte 0x69 Signature (old)
  60. >0 byte 0x6a Symmetric-Key Encrypted Session Key (old)
  61. >0 byte 0x6b One-Pass Signature (old)
  62. >0 byte 0x6c Secret-Key (old)
  63. >0 byte 0x6d Public-Key (old)
  64. >0 byte 0x6e Secret-Subkey (old)
  65. >0 byte 0x6f Compressed Data (old)
  66. >0 byte 0x70 Symmetrically Encrypted Data (old)
  67. >0 byte 0x71 Marker (old)
  68. >0 byte 0x72 Literal Data (old)
  69. >0 byte 0x73 Trust (old)
  70. >0 byte 0x74 User ID (old)
  71. >0 byte 0x75 Public-Subkey (old)
  72. >0 byte 0x76 Unused (old)
  73. >0 byte 0x77
  74. >>1 byte&0xc0 0x00 Reserved
  75. >>1 byte&0xc0 0x40 Public-Key Encrypted Session Key
  76. >>1 byte&0xc0 0x80 Signature
  77. >>1 byte&0xc0 0xc0 Symmetric-Key Encrypted Session Key
  78. >0 byte 0x78
  79. >>1 byte&0xc0 0x00 One-Pass Signature
  80. >>1 byte&0xc0 0x40 Secret-Key
  81. >>1 byte&0xc0 0x80 Public-Key
  82. >>1 byte&0xc0 0xc0 Secret-Subkey
  83. >0 byte 0x79
  84. >>1 byte&0xc0 0x00 Compressed Data
  85. >>1 byte&0xc0 0x40 Symmetrically Encrypted Data
  86. >>1 byte&0xc0 0x80 Marker
  87. >>1 byte&0xc0 0xc0 Literal Data
  88. >0 byte 0x7a
  89. >>1 byte&0xc0 0x00 Trust
  90. >>1 byte&0xc0 0x40 User ID
  91. >>1 byte&0xc0 0x80 Public-Subkey
  92. >>1 byte&0xc0 0xc0 Unused [z%x]
  93. >0 byte 0x30
  94. >>1 byte&0xc0 0x00 Unused [0%x]
  95. >>1 byte&0xc0 0x40 User Attribute
  96. >>1 byte&0xc0 0x80 Sym. Encrypted and Integrity Protected Data
  97. >>1 byte&0xc0 0xc0 Modification Detection Code
  98. # magic signatures to detect PGP crypto material (from stef)
  99. # detects and extracts metadata from:
  100. # - symmetric encrypted packet header
  101. # - RSA (e=65537) secret (sub-)keys
  102. # PGP ECC encrypted data
  103. 0 byte 0x84
  104. >2 byte 3
  105. >>11 byte 18 PGP ECDH Public-Key Encrypted Session Key -
  106. >>>3 belong x keyid: %08X
  107. >>>7 belong x %08X
  108. >>11 byte 19 PGP ECDSA Public-Key Encrypted Session Key -
  109. >>>3 belong x keyid: %08X
  110. >>>7 belong x %08X
  111. >>11 byte 22 PGP EdDSALegacy Public-Key Encrypted Session Key -
  112. >>>3 belong x keyid: %08X
  113. >>>7 belong x %08X
  114. >>11 byte 25 PGP X25519 Public-Key Encrypted Session Key -
  115. >>>3 belong x keyid: %08X
  116. >>>7 belong x %08X
  117. >>11 byte 26 PGP X448 Public-Key Encrypted Session Key -
  118. >>>3 belong x keyid: %08X
  119. >>>7 belong x %08X
  120. >>11 byte 27 PGP Ed25519 Public-Key Encrypted Session Key -
  121. >>>3 belong x keyid: %08X
  122. >>>7 belong x %08X
  123. >>11 byte 28 PGP Ed448 Public-Key Encrypted Session Key -
  124. >>>3 belong x keyid: %08X
  125. >>>7 belong x %08X
  126. 0 byte 0x85
  127. >3 byte 3
  128. >>12 byte 18 PGP ECDH Public-Key Encrypted Session Key -
  129. >>>4 belong x keyid: %08X
  130. >>>8 belong x %08X
  131. >>12 byte 19 PGP ECDSA Public-Key Encrypted Session Key -
  132. >>>4 belong x keyid: %08X
  133. >>>8 belong x %08X
  134. >>12 byte 22 PGP EdDSALegacy Public-Key Encrypted Session Key -
  135. >>>4 belong x keyid: %08X
  136. >>>8 belong x %08X
  137. >>12 byte 25 PGP X25519 Public-Key Encrypted Session Key -
  138. >>>4 belong x keyid: %08X
  139. >>>8 belong x %08X
  140. >>12 byte 26 PGP X448 Public-Key Encrypted Session Key -
  141. >>>4 belong x keyid: %08X
  142. >>>8 belong x %08X
  143. >>12 byte 27 PGP Ed25519 Public-Key Encrypted Session Key -
  144. >>>4 belong x keyid: %08X
  145. >>>8 belong x %08X
  146. >>12 byte 28 PGP Ed448 Public-Key Encrypted Session Key -
  147. >>>4 belong x keyid: %08X
  148. >>>8 belong x %08X
  149. # 1024b RSA encrypted data
  150. 0 string \x84\x8c\x03 PGP RSA encrypted session key -
  151. >3 belong x keyid: %08X
  152. >7 belong x %08X
  153. >11 byte 0x01 RSA (Encrypt or Sign) 1024b
  154. >11 byte 0x02 RSA Encrypt-Only 1024b
  155. #>12 string \x04\x00
  156. #>12 string \x03\xff
  157. #>12 string \x03\xfe
  158. #>12 string \x03\xfd
  159. #>12 string \x03\xfc
  160. #>12 string \x03\xfb
  161. #>12 string \x03\xfa
  162. #>12 string \x03\xf9
  163. #>142 byte 0xd2 .
  164. # 2048b RSA encrypted data
  165. 0 string \x85\x01\x0c\x03 PGP RSA encrypted session key -
  166. >4 belong x keyid: %08X
  167. >8 belong x %08X
  168. >12 byte 0x01 RSA (Encrypt or Sign) 2048b
  169. >12 byte 0x02 RSA Encrypt-Only 2048b
  170. #>13 string \x08\x00
  171. #>13 string \x07\xff
  172. #>13 string \x07\xfe
  173. #>13 string \x07\xfd
  174. #>13 string \x07\xfc
  175. #>13 string \x07\xfb
  176. #>13 string \x07\xfa
  177. #>13 string \x07\xf9
  178. #>271 byte 0xd2 .
  179. # 3072b RSA encrypted data
  180. 0 string \x85\x01\x8c\x03 PGP RSA encrypted session key -
  181. >4 belong x keyid: %08X
  182. >8 belong x %08X
  183. >12 byte 0x01 RSA (Encrypt or Sign) 3072b
  184. >12 byte 0x02 RSA Encrypt-Only 3072b
  185. #>13 string \x0c\x00
  186. #>13 string \x0b\xff
  187. #>13 string \x0b\xfe
  188. #>13 string \x0b\xfd
  189. #>13 string \x0b\xfc
  190. #>13 string \x0b\xfb
  191. #>13 string \x0b\xfa
  192. #>13 string \x0b\xf9
  193. #>399 byte 0xd2 .
  194. # 4096b RSA encrypted data
  195. 0 string \x85\x02\x0c\x03 PGP RSA encrypted session key -
  196. >4 belong x keyid: %08X
  197. >8 belong x %08X
  198. >12 byte 0x01 RSA (Encrypt or Sign) 4096b
  199. >12 byte 0x02 RSA Encrypt-Only 4096b
  200. #>13 string \x10\x00
  201. #>13 string \x0f\xff
  202. #>13 string \x0f\xfe
  203. #>13 string \x0f\xfd
  204. #>13 string \x0f\xfc
  205. #>13 string \x0f\xfb
  206. #>13 string \x0f\xfa
  207. #>13 string \x0f\xf9
  208. #>527 byte 0xd2 .
  209. # 8192b RSA encrypted data
  210. 0 string \x85\x04\x0c\x03 PGP RSA encrypted session key -
  211. >4 belong x keyid: %08X
  212. >8 belong x %08X
  213. >12 byte 0x01 RSA (Encrypt or Sign) 8192b
  214. >12 byte 0x02 RSA Encrypt-Only 8192b
  215. #>13 string \x20\x00
  216. #>13 string \x1f\xff
  217. #>13 string \x1f\xfe
  218. #>13 string \x1f\xfd
  219. #>13 string \x1f\xfc
  220. #>13 string \x1f\xfb
  221. #>13 string \x1f\xfa
  222. #>13 string \x1f\xf9
  223. #>1039 byte 0xd2 .
  224. # 1024b Elgamal encrypted data
  225. 0 string \x85\x01\x0e\x03 PGP Elgamal encrypted session key -
  226. >4 belong x keyid: %08X
  227. >8 belong x %08X
  228. >12 byte 0x10 Elgamal Encrypt-Only 1024b.
  229. #>13 string \x04\x00
  230. #>13 string \x03\xff
  231. #>13 string \x03\xfe
  232. #>13 string \x03\xfd
  233. #>13 string \x03\xfc
  234. #>13 string \x03\xfb
  235. #>13 string \x03\xfa
  236. #>13 string \x03\xf9
  237. # 2048b Elgamal encrypted data
  238. 0 string \x85\x02\x0e\x03 PGP Elgamal encrypted session key -
  239. >4 belong x keyid: %08X
  240. >8 belong x %08X
  241. >12 byte 0x10 Elgamal Encrypt-Only 2048b.
  242. #>13 string \x08\x00
  243. #>13 string \x07\xff
  244. #>13 string \x07\xfe
  245. #>13 string \x07\xfd
  246. #>13 string \x07\xfc
  247. #>13 string \x07\xfb
  248. #>13 string \x07\xfa
  249. #>13 string \x07\xf9
  250. # 3072b Elgamal encrypted data
  251. 0 string \x85\x03\x0e\x03 PGP Elgamal encrypted session key -
  252. >4 belong x keyid: %08X
  253. >8 belong x %08X
  254. >12 byte 0x10 Elgamal Encrypt-Only 3072b.
  255. #>13 string \x0c\x00
  256. #>13 string \x0b\xff
  257. #>13 string \x0b\xfe
  258. #>13 string \x0b\xfd
  259. #>13 string \x0b\xfc
  260. #>13 string \x0b\xfb
  261. #>13 string \x0b\xfa
  262. #>13 string \x0b\xf9
  263. # crypto algo mapper
  264. 0 name crypto
  265. >0 byte 0x00 Plaintext or unencrypted data
  266. >0 byte 0x01 IDEA
  267. >0 byte 0x02 TripleDES
  268. >0 byte 0x03 CAST5 (128 bit key)
  269. >0 byte 0x04 Blowfish (128 bit key, 16 rounds)
  270. >0 byte 0x07 AES with 128-bit key
  271. >0 byte 0x08 AES with 192-bit key
  272. >0 byte 0x09 AES with 256-bit key
  273. >0 byte 0x0a Twofish with 256-bit key
  274. >0 byte 0x0b Camellia with 128-bit key
  275. >0 byte 0x0c Camellia with 192-bit key
  276. >0 byte 0x0d Camellia with 256-bit key
  277. # hash algo mapper
  278. 0 name hash
  279. >0 byte 0x01 MD5
  280. >0 byte 0x02 SHA-1
  281. >0 byte 0x03 RIPE-MD/160
  282. >0 byte 0x08 SHA256
  283. >0 byte 0x09 SHA384
  284. >0 byte 0x0a SHA512
  285. >0 byte 0x0b SHA224
  286. >0 byte 0x0c SHA3-256
  287. >0 byte 0x0e SHA3-512
  288. # display public key algorithms as human readable text
  289. 0 name key_algo
  290. >0 byte 0x01 RSA (Encrypt or Sign)
  291. # keep old look of version 5.28 without parentheses
  292. >0 byte 0x02 RSA Encrypt-Only
  293. >0 byte 0x03 RSA (Sign-Only)
  294. >0 byte 16 ElGamal (Encrypt-Only)
  295. >0 byte 17 DSA
  296. >0 byte 18 ECDH
  297. >0 byte 19 ECDSA
  298. >0 byte 20 ElGamal (Encrypt or Sign)
  299. >0 byte 21 Diffie-Hellman
  300. >0 byte 22 EdDSALegacy
  301. >0 byte 25 X25519
  302. >0 byte 26 X448
  303. >0 byte 27 Ed25519
  304. >0 byte 28 Ed448
  305. >0 default x
  306. >>0 ubyte <29 unknown (pub %d)
  307. # this should never happen
  308. >>0 ubyte >28 invalid (%d)
  309. # pgp symmetric encrypted data
  310. 0 byte 0x8c PGP symmetric key encrypted data -
  311. >1 byte 0x0d
  312. >1 byte 0x0c
  313. >2 byte 0x04
  314. >3 use crypto
  315. >4 byte 0x01 salted -
  316. >>5 use hash
  317. >>14 byte 0xd2 .
  318. >>14 byte 0xc9 .
  319. >4 byte 0x03 salted & iterated -
  320. >>5 use hash
  321. >>15 byte 0xd2 .
  322. >>15 byte 0xc9 .
  323. # encrypted keymaterial needs s2k & can be checksummed/hashed
  324. 0 name chkcrypto
  325. >0 use crypto
  326. >1 byte 0x00 Simple S2K
  327. >1 byte 0x01 Salted S2K
  328. >1 byte 0x03 Salted&Iterated S2K
  329. >2 use hash
  330. # all PGP keys start with this prolog
  331. # containing version, creation date, and purpose
  332. 0 name keyprolog
  333. >0 byte 0x04
  334. >1 beldate x created on %s -
  335. >5 byte 0x01 RSA (Encrypt or Sign)
  336. >5 byte 0x02 RSA Encrypt-Only
  337. # end of secret keys known signature
  338. # contains e=65537 and the prolog to
  339. # the encrypted parameters
  340. 0 name keyend
  341. >0 string \x00\x11\x01\x00\x01 e=65537
  342. >5 use crypto
  343. >5 byte 0xff checksummed
  344. >>6 use chkcrypto
  345. >5 byte 0xfe hashed
  346. >>6 use chkcrypto
  347. # PGP secret keys contain also the public parts
  348. # these vary by bitsize of the key
  349. 0 name x1024
  350. >0 use keyprolog
  351. >6 string \x03\xfe
  352. >6 string \x03\xff
  353. >6 string \x04\x00
  354. >136 use keyend
  355. 0 name x2048
  356. >0 use keyprolog
  357. >6 string \x80\x00
  358. >6 string \x07\xfe
  359. >6 string \x07\xff
  360. >264 use keyend
  361. 0 name x3072
  362. >0 use keyprolog
  363. >6 string \x0b\xfe
  364. >6 string \x0b\xff
  365. >6 string \x0c\x00
  366. >392 use keyend
  367. 0 name x4096
  368. >0 use keyprolog
  369. >6 string \x10\x00
  370. >6 string \x0f\xfe
  371. >6 string \x0f\xff
  372. >520 use keyend
  373. # \x00|\x1f[\xfe\xff]).{1024})'
  374. 0 name x8192
  375. >0 use keyprolog
  376. >6 string \x20\x00
  377. >6 string \x1f\xfe
  378. >6 string \x1f\xff
  379. >1032 use keyend
  380. # depending on the size of the pkt
  381. # we branch into the proper key size
  382. # signatures defined as x{keysize}
  383. 0 name pgpkey
  384. >0 string \x01\xd8 1024b
  385. >>2 use x1024
  386. >0 string \x01\xeb 1024b
  387. >>2 use x1024
  388. >0 string \x01\xfb 1024b
  389. >>2 use x1024
  390. >0 string \x01\xfd 1024b
  391. >>2 use x1024
  392. >0 string \x01\xf3 1024b
  393. >>2 use x1024
  394. >0 string \x01\xee 1024b
  395. >>2 use x1024
  396. >0 string \x01\xfe 1024b
  397. >>2 use x1024
  398. >0 string \x01\xf4 1024b
  399. >>2 use x1024
  400. >0 string \x02\x0d 1024b
  401. >>2 use x1024
  402. >0 string \x02\x03 1024b
  403. >>2 use x1024
  404. >0 string \x02\x05 1024b
  405. >>2 use x1024
  406. >0 string \x02\x15 1024b
  407. >>2 use x1024
  408. >0 string \x02\x00 1024b
  409. >>2 use x1024
  410. >0 string \x02\x10 1024b
  411. >>2 use x1024
  412. >0 string \x02\x04 1024b
  413. >>2 use x1024
  414. >0 string \x02\x06 1024b
  415. >>2 use x1024
  416. >0 string \x02\x16 1024b
  417. >>2 use x1024
  418. >0 string \x03\x98 2048b
  419. >>2 use x2048
  420. >0 string \x03\xab 2048b
  421. >>2 use x2048
  422. >0 string \x03\xbb 2048b
  423. >>2 use x2048
  424. >0 string \x03\xbd 2048b
  425. >>2 use x2048
  426. >0 string \x03\xcd 2048b
  427. >>2 use x2048
  428. >0 string \x03\xb3 2048b
  429. >>2 use x2048
  430. >0 string \x03\xc3 2048b
  431. >>2 use x2048
  432. >0 string \x03\xc5 2048b
  433. >>2 use x2048
  434. >0 string \x03\xd5 2048b
  435. >>2 use x2048
  436. >0 string \x03\xae 2048b
  437. >>2 use x2048
  438. >0 string \x03\xbe 2048b
  439. >>2 use x2048
  440. >0 string \x03\xc0 2048b
  441. >>2 use x2048
  442. >0 string \x03\xd0 2048b
  443. >>2 use x2048
  444. >0 string \x03\xb4 2048b
  445. >>2 use x2048
  446. >0 string \x03\xc4 2048b
  447. >>2 use x2048
  448. >0 string \x03\xc6 2048b
  449. >>2 use x2048
  450. >0 string \x03\xd6 2048b
  451. >>2 use x2048
  452. >0 string \x05X 3072b
  453. >>2 use x3072
  454. >0 string \x05k 3072b
  455. >>2 use x3072
  456. >0 string \x05{ 3072b
  457. >>2 use x3072
  458. >0 string \x05} 3072b
  459. >>2 use x3072
  460. >0 string \x05\x8d 3072b
  461. >>2 use x3072
  462. >0 string \x05s 3072b
  463. >>2 use x3072
  464. >0 string \x05\x83 3072b
  465. >>2 use x3072
  466. >0 string \x05\x85 3072b
  467. >>2 use x3072
  468. >0 string \x05\x95 3072b
  469. >>2 use x3072
  470. >0 string \x05n 3072b
  471. >>2 use x3072
  472. >0 string \x05\x7e 3072b
  473. >>2 use x3072
  474. >0 string \x05\x80 3072b
  475. >>2 use x3072
  476. >0 string \x05\x90 3072b
  477. >>2 use x3072
  478. >0 string \x05t 3072b
  479. >>2 use x3072
  480. >0 string \x05\x84 3072b
  481. >>2 use x3072
  482. >0 string \x05\x86 3072b
  483. >>2 use x3072
  484. >0 string \x05\x96 3072b
  485. >>2 use x3072
  486. >0 string \x07[ 4096b
  487. >>2 use x4096
  488. >0 string \x07\x18 4096b
  489. >>2 use x4096
  490. >0 string \x07+ 4096b
  491. >>2 use x4096
  492. >0 string \x07; 4096b
  493. >>2 use x4096
  494. >0 string \x07= 4096b
  495. >>2 use x4096
  496. >0 string \x07M 4096b
  497. >>2 use x4096
  498. >0 string \x073 4096b
  499. >>2 use x4096
  500. >0 string \x07C 4096b
  501. >>2 use x4096
  502. >0 string \x07E 4096b
  503. >>2 use x4096
  504. >0 string \x07U 4096b
  505. >>2 use x4096
  506. >0 string \x07. 4096b
  507. >>2 use x4096
  508. >0 string \x07> 4096b
  509. >>2 use x4096
  510. >0 string \x07@ 4096b
  511. >>2 use x4096
  512. >0 string \x07P 4096b
  513. >>2 use x4096
  514. >0 string \x074 4096b
  515. >>2 use x4096
  516. >0 string \x07D 4096b
  517. >>2 use x4096
  518. >0 string \x07F 4096b
  519. >>2 use x4096
  520. >0 string \x07V 4096b
  521. >>2 use x4096
  522. >0 string \x0e[ 8192b
  523. >>2 use x8192
  524. >0 string \x0e\x18 8192b
  525. >>2 use x8192
  526. >0 string \x0e+ 8192b
  527. >>2 use x8192
  528. >0 string \x0e; 8192b
  529. >>2 use x8192
  530. >0 string \x0e= 8192b
  531. >>2 use x8192
  532. >0 string \x0eM 8192b
  533. >>2 use x8192
  534. >0 string \x0e3 8192b
  535. >>2 use x8192
  536. >0 string \x0eC 8192b
  537. >>2 use x8192
  538. >0 string \x0eE 8192b
  539. >>2 use x8192
  540. >0 string \x0eU 8192b
  541. >>2 use x8192
  542. >0 string \x0e. 8192b
  543. >>2 use x8192
  544. >0 string \x0e> 8192b
  545. >>2 use x8192
  546. >0 string \x0e@ 8192b
  547. >>2 use x8192
  548. >0 string \x0eP 8192b
  549. >>2 use x8192
  550. >0 string \x0e4 8192b
  551. >>2 use x8192
  552. >0 string \x0eD 8192b
  553. >>2 use x8192
  554. >0 string \x0eF 8192b
  555. >>2 use x8192
  556. >0 string \x0eV 8192b
  557. >>2 use x8192
  558. # PGP RSA (e=65537) secret (sub-)key header
  559. 0 byte 0x97 PGP Secret Sub-key -
  560. >1 use pgpkey
  561. 0 byte 0x9d
  562. # Update: Joerg Jenderek
  563. # secret subkey packet (tag 7) with same structure as secret key packet (tag 5)
  564. # skip Fetus.Sys16 CALIBUS.MAIN OrbFix.Sys16.Ex by looking for positive len
  565. >1 ubeshort >0
  566. #>1 ubeshort x \b, body length %#x
  567. # next packet type often 88h,89h~(tag 2)~Signature Packet
  568. #>>(1.S+3) ubyte x \b, next packet type %#x
  569. # skip Dragon.SHR DEMO.INIT by looking for positive version
  570. >>3 ubyte >0
  571. # skip BUISSON.13 GUITAR1 by looking for low version number
  572. >>>3 ubyte <5 PGP Secret Sub-key
  573. # sub-key are normally part of secret key. So it does not occur as standalone file
  574. #!:ext bin
  575. # version 2,3~old 4~new . Comment following line for version 5.28 look
  576. >>>>3 ubyte x (v%d)
  577. >>>>3 ubyte x -
  578. # old versions 2 or 3 but no real example found
  579. >>>>3 ubyte <4
  580. # 2 byte for key bits in version 5.28 look
  581. >>>>>11 ubeshort x %db
  582. >>>>>4 beldate x created on %s -
  583. # old versions use 2 additional bytes after time stamp
  584. #>>>>>8 ubeshort x %#x
  585. # display key algorithm 1~RSA Encrypt|Sign - 21~Diffie-Hellman
  586. >>>>>10 use key_algo
  587. >>>>>(11.S/8) ubequad x
  588. # look after first key
  589. >>>>>>&5 use keyend
  590. # new version
  591. >>>>3 ubyte >3
  592. >>>>>9 ubeshort x %db
  593. >>>>>4 beldate x created on %s -
  594. # display key algorithm
  595. >>>>>8 use key_algo
  596. >>>>>(9.S/8) ubequad x
  597. # look after first key for something like s2k
  598. >>>>>>&3 use keyend