Skip to content

algo-boyz/opacker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OPacker

a small, self-contained encrypted asset bundler:

  • Recursively packs all files from assets/ into a encrypted .bin using AES-256-GCM
  • Generates and saves a 256-bit encryption key to assets.key
  • Encryption AAD (based on asset item file path) plus package-wide AAD (based on .bin file path)
  • Runtime loader decrypts assets (textures, bytes, etc.) in the package

Features

  • Zero external dependencies
  • AES-256-GCM with random IVs per chunk
  • Simple JSON index encrypted inside the package

Usage

1. Build the packer

odin build demo -out:opacker

2. Pack the assets

./opacker

It will:

  • Scan the assets/ folder
  • Encrypt everything with a random key
  • Write assets.key - don't ship it with the game!
  • Produce assets.bin

Demo:

Packed: assets/cloud.png (12345 bytes)
...
Asset package created: assets.bin (987654 bytes total)
Loaded assets/cloud.png with dimensions 512x512

Security notes

  • Encryption is industry standard AES-256-GCM
  • Package filename is used as AAD for the header and index
  • Each asset uses full path as extra AAD → renaming or moving files inside the package will fail decryption
  • Not military-grade obfus, but will stop the casual ripper
  • Do not ship assets.key with release

TODO

  • Compression before encryption
  • Decompression after decryption
  • Streaming en/decryption for large assets
  • Mem-map package instead of loading all at once

Made with ❤️ under MIT by algoboyz

About

small, self-contained encrypted asset bundler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages