From daff11e236038de6fd3940da31eb4e75855a19ef Mon Sep 17 00:00:00 2001 From: Pranav Dronavalli Date: Tue, 9 Jan 2024 16:13:25 -0600 Subject: [PATCH] continue documentation, prepare labyrinth for publish --- labyrinth/Cargo.toml | 4 +++ labyrinth/README.md | 73 ++++++++++++++++++++++++++++++++++++++ labyrinth_macros/README.md | 5 ++- 3 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 labyrinth/README.md diff --git a/labyrinth/Cargo.toml b/labyrinth/Cargo.toml index d5c3300..c0cbaa3 100644 --- a/labyrinth/Cargo.toml +++ b/labyrinth/Cargo.toml @@ -2,6 +2,10 @@ name = "labyrinth" version = "0.1.0" edition = "2021" +authors = ["Pranav Dronavalli "] +description = "A procedural macro library to obfuscate Rust code. Provides compile-time string encryption and random flow obfuscation." +license = "MIT" +repository = "https://github.com/dronavallipranav/rust-obfuscator/tree/main/labyrinth_macros" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/labyrinth/README.md b/labyrinth/README.md new file mode 100644 index 0000000..48285ed --- /dev/null +++ b/labyrinth/README.md @@ -0,0 +1,73 @@ +# labyrinth + +`labyrinth` is a procedural macro crate for compile-time rust obfuscation. It provides the user with string encryption and compile-time determined flow obfuscation and random variables which survive compile-time optimization. + + +[rust-obfuscator](https://github.com/dronavallipranav/rust-obfuscator) - Check out this auto obfuscator tool for easier usage and integration +## Features + +- **String Obfuscation**: Automatically encrypts string literals in your code at compile time, making them harder to read and understand. +- **Flow Obfuscation**: Introduces dummy loops and random variables into control flows, enhancing the overall obfuscation of the logic. + +# Installation + +Add `labyrinth` to your `Cargo.toml` as a dependency: + +```toml +[dependencies] +labyrinth = "0.1.0" +``` + +# Usage + +## Bring macro into scope +``` +use labyrinth; + +fn main(){ + println!(labyrinth::encrypt_string("Hello, World!")); +} +``` +## Output +``` +Hello World! +``` +## Example of expanded Flow_Stmt! + +``` + { + let _is_dummy_145 = true; + let _dummy_upper_bound = 100; + let _dummy_increment = 1i32; + let mut _dummy_counter = 10i32; + let _extra_dummy_var = 2i32; + loop { + if _dummy_counter > _dummy_upper_bound { + break; + } + unsafe { + std::ptr::write_volatile( + &mut _dummy_counter, + _dummy_counter + _dummy_increment, + ); + } + } + }; + match (&1, &1) { + (left_val, right_val) => { + if !(*left_val == *right_val) { + let kind = ::core::panicking::AssertKind::Eq; + ::core::panicking::assert_failed( + kind, + &*left_val, + &*right_val, + ::core::option::Option::None, + ); + } + } + }; + +``` + +# License +labyrinth is licensed under the MIT License - see the [LICENSE](https://github.com/dronavallipranav/rust-obfuscator/blob/main/LICENSE) file for details. diff --git a/labyrinth_macros/README.md b/labyrinth_macros/README.md index 2f11c22..7bb981d 100644 --- a/labyrinth_macros/README.md +++ b/labyrinth_macros/README.md @@ -1,4 +1,4 @@ -# Labyrinth Macros +# labyrinth_macros `labyrinth_macros` is a procedural macro crate designed to complement the `labyrinth` super crate. It provides powerful compile-time string and control flow obfuscation capabilities, aimed at enhancing the security and complexity of Rust code. Not meant to be used standalone, necessary obfuscation features are in the super crate `labyrinth` @@ -6,3 +6,6 @@ - **String Obfuscation**: Automatically encrypts string literals in your code at compile time, making them harder to read and understand. - **Flow Obfuscation**: Introduces dummy loops and random variables into control flows, enhancing the overall obfuscation of the logic. + +# License +labyrinth_macros is licensed under the MIT License - see the [LICENSE](https://github.com/dronavallipranav/rust-obfuscator/blob/main/LICENSE) file for details. \ No newline at end of file