Crates.io | encryption-macros |
lib.rs | encryption-macros |
version | 0.1.1 |
source | src |
created_at | 2022-04-08 17:28:56.000902 |
updated_at | 2022-04-08 18:35:09.483014 |
description | This crate provides macros to xor strings decaritive or automaticly at compiletime and atomaticly decode the at run time. |
homepage | |
repository | https://github.com/michaelvanstraten/encryption-macros |
max_upload_size | |
id | 564358 |
size | 8,138 |
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.
use encryption_macros::encrypt_strings;
encrypt_strings!{
fn main() {
println!("everything in this scope gets encrypted, {}", "even this")
}
}
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.