crypto 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #------------------------------------------------------------------------------
  2. # $File: crypto,v 1.4 2023/07/17 16:41:48 christos Exp $
  3. # crypto: file(1) magic for crypto formats
  4. #
  5. # Bitcoin block files
  6. 0 lelong 0xD9B4BEF9 Bitcoin
  7. >(4.l+40) lelong 0xD9B4BEF9 reverse block
  8. >>4 lelong x \b, size %u
  9. # normal block below
  10. >0 default x block
  11. >>4 lelong x \b, size %u
  12. >>8 lelong&0xE0000000 0x20000000
  13. >>>8 lelong x \b, BIP9 0x%x
  14. >>8 lelong&0xE0000000 !0x20000000
  15. >>>8 lelong x \b, version 0x%x
  16. >>76 ledate x \b, %s UTC
  17. # VarInt counter
  18. >>88 ubyte <0xfd \b, txcount %u
  19. >>88 ubyte 0xfd
  20. >>>89 leshort x \b, txcount %u
  21. >>88 ubyte 0xfe
  22. >>>89 lelong x \b, txcount %u
  23. >>88 ubyte 0xff
  24. >>>89 lequad x \b, txcount %llu
  25. !:ext dat
  26. # option to find more blocks in the file
  27. #>>(4.l+8) indirect x ;
  28. # LevelDB
  29. -8 lequad 0xdb4775248b80fb57 LevelDB table data
  30. # http://www.tarsnap.com/scrypt.html
  31. # see scryptenc_setup() in lib/scryptenc/scryptenc.c
  32. 0 string scrypt\0 scrypt encrypted file
  33. >7 byte x \b, N=2**%d
  34. >8 belong x \b, r=%d
  35. >12 belong x \b, p=%d
  36. # https://age-encryption.org/
  37. # Only the first recipient is printed in detail to prevent repetitive output
  38. # in extreme cases ("ssh-rsa, ssh-rsa, ssh-rsa, ...").
  39. 0 string age-encryption.org/v1\n age encrypted file
  40. >25 regex/128 \^[^\040]+ \b, %s recipient
  41. >>25 string scrypt
  42. >>>&0 regex/64 [0-9]+\$ (N=2**%s)
  43. >>&0 search/256 \n->\040 \b, among others
  44. 0 string -----BEGIN\040AGE\040ENCRYPTED\040FILE----- age encrypted file, ASCII armored