Skip to content

A command-line utility for creating and expanding custom, encrypted, and text-encoded archives. It securely packages specified files and directories into a format designed to be highly portable and capable of bypassing strict email attachment filters.

License

Notifications You must be signed in to change notification settings

belnytheraseiche/fmarchive

Repository files navigation

FM Archive

FM Archive is a command-line utility for creating and expanding custom, encrypted, and text-encoded archives.

It securely packages specified files and directories into a format designed to be highly portable and capable of bypassing strict email attachment filters (like Gmail's).

The internal workflow is as follows:

  1. Package files into a TAR archive.
  2. Split the archive into manageable chunks.
  3. For each chunk: a. Apply a text-based encoding (e.g., Base64, z85). b. Compress the text using FM-Index. c. Encrypt the result with AES-GCM (using your key). d. Apply text-encoding again to the final encrypted binary.
  4. Store all resulting .txt chunks in a standard ZIP file.

Key Advantage: Bypassing E-Mail Filters

The primary advantage of FM Archive is its ability to bypass aggressive attachment filters, such as those used by Gmail.

This is achieved through two key features:

  1. Standard ZIP Format: The resulting archive is a standard, non-password-protected .zip file. This format is recognized as safe by almost all systems.
  2. Text File Contents: All data chunks (which are encrypted and disguised) are stored as harmless .txt files within the archive.

Because the archive itself and its contents are treated as "text," it can be attached and sent via email without being flagged by filters.


Trade-off: File Size

This "disguise work" (encryption + text encoding) comes at a cost.

Compared to a standard ZIP compression of the same files, the final .zip file generated by FM Archive may be approximately 20% larger.

This is the trade-off for achieving both security (unreadable by third parties) and portability (ease of emailing).


Setup: The config.json File

Before using FM Archive, you must create a config.json file in the same directory as the executable. This file controls the core operation of the tool.

Example config.json:

{
  "default_name": "my_archive",
  "cryptography_key": "Your-Super-Secret-Key-String",
  "compression_level": 0,
  "text_encoder": "base64"
}

How to Use (Command-Line)

FM Archive is operated via the command line.

Show Info

Displays version information.

fmarchive -i

Show Help

Displays help information.

fmarchive -h

Create an Archive

Packages one or more files or directories into a new .zip archive.

# Explicit 'create' command
fmarchive c path/to/file.txt path/to/folder

# Default action (if paths are not .zip)
fmarchive path/to/file.txt path/to/folder

Expand an Archive

Extracts the contents of one or more FM Archive .zip files.

# Explicit 'expand' command
fmarchive x my_archive.zip

# Default action (if path is a .zip)
fmarchive my_archive.zip

Configuration Details

The config.json file has the following properties:

  • default_name (string): The default filename (without extension) to use when creating a new archive.

  • cryptography_key (string): This is your secret password. It is used to generate the encryption key. Keep this safe!

  • compression_level (number): The compression level for the final ZIP archive that holds the text files.

    • 0: Optimal (Default)
    • 1: Fastest
    • 2: NoCompression
    • 3: SmallestSize
  • text_encoder (string): The text encoding used to disguise the binary chunks. (Note: base64 is recommended as it interacts best with the FM-Index compression stage).

    • "base32": (Case-insensitive)
    • "base64": (Recommended for compression)
    • "base122": (Experimental)
    • "z85": (Space-efficient, safe text)

Included Encoders

I've also included the C# implementations for Base32, Base122, and z85 (used by this tool) in the repository. Feel free to use them in your own projects.


Copyright

https://github.com/belnytheraseiche/fmarchive

About

A command-line utility for creating and expanding custom, encrypted, and text-encoded archives. It securely packages specified files and directories into a format designed to be highly portable and capable of bypassing strict email attachment filters.

Topics

Resources

License

Stars

Watchers

Forks

Languages