Skip to content

v0.3.1

Latest

Choose a tag to compare

@GianIac GianIac released this 17 May 16:03
4299d6b

v0.3.1

Hi. This release is the most complete version of Rustfuscator to date. It expands obfuscation coverage significantly across macros, the derive system, the CLI, and the crypto layer.


New Macros

Introduced obfuscate_num!() for lightweight compile-time integer literal obfuscation. Supports all Rust integer primitives (u8u128, i8isize), including negative literals.

Introduced obfuscate_dummy_branch!() which injects an opaque dead branch seeded from source location metadata to disrupt static CFG analysis.

Expanded #[derive(Obfuscate)]

Previously limited to String and u32. Now supports all integer scalar types and bool. Qualified paths (std::string::String, alloc::string::String) are also recognized. Generic crypto helpers encrypt_display and decrypt_parse replace the narrow encrypt_u32 / decrypt_u32.

Hardened Key Derivation (#41)

The AES-256 key is no longer embedded as a single static hex sequence. It is now split into three masked XOR shares + a random salt at build time and reconstructed at runtime, making static extraction significantly harder.

Logging Macro Obfuscation

The CLI can now rewrite string literals inside println!, eprintln!, log::*, and tracing::*. Configurable via the new [logging_macros] section in .obfuscate.toml.

Identifier Rename Strategies

The [identifiers] section now supports a strategy field:

  • suffix (default) appends _obf_<random> / _x<random>
  • hash hides original names completely with a deterministic base-36 hash
  • confuse underscore-prefixed hash names

Renamed identifiers are now tracked consistently so all references are updated in the same pass.

CLI & Config Improvements

  • control_flow_files - glob patterns to restrict flow injection to specific files
  • dummy_branches - opt-in flag to inject obfuscate_dummy_branch!() alongside obfuscate_flow!()
  • obfuscate_logging - opt-in flag to enable logging macro rewriting
  • --verbose now shows skip reasons per file (matched skip_files, not in include patterns, excluded by pattern)
  • File filtering extracted into a dedicated module shared between single-file and project modes

Optional Feature Flags

  • secure_zeroize - zeroizes decrypted clear values and temporary buffers after use
  • verify_literals - enables debug-only round-trip assertions inside string literal macros
[dependencies]
rust_code_obfuscator = { version = "0.3.1", features = ["secure_zeroize", "verify_literals"] }

Benchmarks & Examples

Added benches/macro_overhead.rs with Criterion covering control-flow, string, and numeric literal overhead.
Added examples/advanced_macro_usage.rs and integration tests for derive scalars and obfuscate_num!.

cargo bench --bench macro_overhead
cargo run --example advanced_macro_usage

A Personal Note

Rustfuscator is a niche project and maintaining it takes considerable time. This is likely one of the last active feature releases. The project is in a good and complete state, if issues are reported or real needs arise, I will address them, but I do not plan to continue adding features indefinitely.

I am proud of what this project has become and I hope it is useful to whoever needs it.

Thanks for using Rustfuscator.
GianIac