Skip to content

Commit

Permalink
continue documentation, prepare labyrinth for publish
Browse files Browse the repository at this point in the history
  • Loading branch information
dronavallipranav committed Jan 9, 2024
1 parent 285dd91 commit daff11e
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
4 changes: 4 additions & 0 deletions labyrinth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
name = "labyrinth"
version = "0.1.0"
edition = "2021"
authors = ["Pranav Dronavalli <[email protected]>"]
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

Expand Down
73 changes: 73 additions & 0 deletions labyrinth/README.md
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 4 additions & 1 deletion labyrinth_macros/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# 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`

## 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.

# License
labyrinth_macros is licensed under the MIT License - see the [LICENSE](https://github.com/dronavallipranav/rust-obfuscator/blob/main/LICENSE) file for details.

0 comments on commit daff11e

Please sign in to comment.