-
Notifications
You must be signed in to change notification settings - Fork 0
CBT Format
riomoo edited this page Feb 4, 2026
·
2 revisions
CBT (Comic Book TAR) is a comic book archive format that uses TAR (Tape Archive) as the container format instead of ZIP. Gopherbook supports both unencrypted and AES-256 encrypted CBT files.
A CBT file is simply a TAR archive containing:
- Image files (JPEG, PNG, GIF, AVIF, JXL, WebP, BMP, JP2)
-
ComicInfo.xml(optional metadata)
-
.cbt- Standard CBT file
-
.jpg,.jpeg- JPEG images -
.png- PNG images -
.gif- GIF images -
.avif- AVIF images -
.jxl- JPEG XL images -
.webp- WebP images -
.bmp- Bitmap images -
.jp2- JPEG 2000 images
Gopherbook uses AES-256-CFB (Cipher Feedback mode) for encryption:
- Key Derivation: SHA-256 hash of the password
- IV Generation: Random 16-byte initialization vector
- Encryption: AES-256-CFB on the entire TAR archive
- Storage: IV prepended to ciphertext
[16 bytes IV][Encrypted TAR data...]
The encryption format is compatible with:
- OpenSSL command-line tools
- Gopherbook's Go implementation
- The provided bash script (
cbt.sh)
CBT files can include a ComicInfo.xml file for metadata. Gopherbook extracts:
- Title - Comic title
- Series - Series name
- Number - Issue number
- Writer - Writer name
- Artist / Inker - Artist name
- Publisher - Publisher name
- Genre / Tags - Tags/genres
- StoryArc - Story arc name
- Year - Publication year
- Month - Publication month
- Summary - Description
- PageCount - Number of pages
<?xml version="1.0" encoding="utf-8"?>
<ComicInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Title>The Amazing Adventure</Title>
<Series>Super Comics</Series>
<Number>42</Number>
<Writer>John Doe</Writer>
<Artist>Jane Smith</Artist>
<Publisher>Comic Press</Publisher>
<Genre>Action, Adventure</Genre>
<Tags>superhero, action</Tags>
<StoryArc>The Grand Quest</StoryArc>
<Year>2024</Year>
<Month>1</Month>
<Summary>An epic tale of heroism...</Summary>
<PageCount>24</PageCount>
</ComicInfo>- Simpler Format: TAR is simpler than ZIP
- Better for Streaming: Sequential structure
- Unix-Friendly: Native TAR tools on all Unix systems
- Compression Agnostic: Images already compressed
- More Common: Wider software support
- Per-File Compression: Can compress text metadata
- Random Access: Easier to extract single files
- Unix/Linux environments
- Streaming applications
- Encrypted archives (simpler encryption)
- Archival purposes
- Windows environments
- Maximum compatibility
- Need per-file compression
- Most comic readers
See the Creating CBT Files page for detailed instructions using:
- The
cbt.shbash script - The
cbt.goGo program - Manual TAR commands
Algorithm: AES-256-CFB
Key: SHA256(password) = 32 bytes
IV: Random 16 bytes
Block Size: 16 bytes (128 bits)
Mode: CFB (Cipher Feedback)
- Read first 16 bytes as IV
- Read remaining bytes as ciphertext
- Derive key from password using SHA-256
- Decrypt using AES-256-CFB with IV and key
- Extract TAR archive from plaintext
To check if a CBT is encrypted:
# Try reading as TAR
tar -tf file.cbt
# If it fails, likely encrypted
# If it succeeds, unencryptedGopherbook automatically organizes CBT files:
library/
└── [Artist]/
└── [StoryArc]/
└── comic.cbt
Based on extracted metadata from ComicInfo.xml.
- Always include ComicInfo.xml for proper metadata
- Use consistent naming for images (001.jpg, 002.jpg, etc.)
- Encrypt sensitive content using strong passwords
- Store passwords securely (Gopherbook does this automatically)
- Backup your library regularly
Note: CBT support is a unique feature of Gopherbook. Most comic readers only support CBZ/CBR formats.