obfustr

Crates.ioobfustr
lib.rsobfustr
version0.1.2
sourcesrc
created_at2024-10-31 12:23:47.515411
updated_at2024-10-31 12:31:29.732265
descriptioncompile-time obfuscation of string literals (also byte and C strings)
homepage
repositoryhttps://github.com/de-vri-es/obfustr-rs
max_upload_size
id1429946
size16,487
Maarten de Vries (de-vri-es)

documentation

https://docs.rs/obfustr

README

obfustr

Compile time obfuscation of string literals.

May be useful to slightly hinder people from reverse engineering your program.

The obfuscated strings are encrypted by XORing with a random bit pattern, and the random bit pattern is stored next to the encrypted data. This means you can not easily find the string in the binary by inspecting it with conventional tools.

However, the decryption key is stored directly next to the data, so this does not effectively protect data that needs to be kept secret.

The library supports obfuscating string literals, byte string literals and C string literals. All of them are processed using the obfuscate!() macro.

Example 1: Obfuscate a string literal

let message = obfuscate!("Hello world!"); // This gives a `&str`.

Example 2: Obfuscate a byte string literal

let message = obfuscate!(b"Hello world!"); // This gives a `&[u8]`.

Example 3: Obfuscate a C string literal

let message = obfuscate!(c"Hello world!"); // This gives a `CStr`.
Commit count: 11

cargo fmt