https://github.com/michaelvanstraten/encryption-macros
Macros for compile time String obfuscations
https://github.com/michaelvanstraten/encryption-macros
macros obfuscate-strings rust string-obfuscation xor-cipher
Last synced: 11 months ago
JSON representation
Macros for compile time String obfuscations
- Host: GitHub
- URL: https://github.com/michaelvanstraten/encryption-macros
- Owner: michaelvanstraten
- License: mit
- Created: 2022-04-07T11:58:36.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-07T06:15:24.000Z (almost 4 years ago)
- Last Synced: 2024-11-29T04:13:52.069Z (over 1 year ago)
- Topics: macros, obfuscate-strings, rust, string-obfuscation, xor-cipher
- Language: Rust
- Homepage: https://docs.rs/encryption-macros/
- Size: 11.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# encryption-marcos
This crate provides macros to XOR strings declarative or automatically at compile time and automatically decode them at run time.
The XOR key is automatically generated via a macro expansion in the utils sub-crate.
To generate a new key just run cargo clean and recompiled the target to re-expand this macro.
## Example
```rust
use encryption_macros::encrypt_strings;
encrypt_strings!{
fn main() {
println!("everything in this scope gets encrypted, {}", "even this")
}
}
```
## Warning
`format_args!` cannot capture variables when the format string is expanded from a macro.
So something like this: ```println!("{variable_a}")``` sadly doesn't work when inside an encrypted scope.