Commit graph

2 commits

Author SHA1 Message Date
google-labs-jules[bot]
519e5edd68 feat: Implement pre-encryption sigil packing for enhanced security
This commit introduces a more secure sigil workflow by separating the transformation logic from the serialization logic.

- The `Trix` struct now has `Pack()` and `Unpack()` methods to apply sigil transformations directly to the payload.
- The `Encode()` and `Decode()` functions are now solely responsible for serialization, no longer handling sigil logic.
- The recommended workflow is to `Pack()` the data (obfuscating it), then encrypt it, and finally `Encode()` the container. This prevents cleartext from being sent to the CPU's encryption instructions.

This change enhances security by adding a user-defined obfuscation layer before the encryption process begins, true to the spirit of Enchantrix.
2025-10-31 02:37:55 +00:00
google-labs-jules[bot]
36884ecb53 feat: Implement generic .trix file format
This commit introduces a new, generic `.trix` file format, which is decoupled from any specific encryption algorithm.

The format is defined in `docs/trix_format.md` and consists of a magic number, version, a flexible JSON header, and a raw data payload.

A new `trix` Go package is implemented to handle the encoding and decoding of this format. Unit tests are included to verify the implementation.

An example file, `examples/main.go`, is also added to demonstrate how to use the `.trix` container to store data encrypted with the `chachapoly` package, showcasing the intended decoupled design.
2025-10-31 01:06:23 +00:00