Skip to content

Str Crypter is a Rust macro to encrypt plaintext strings at compile time, and automatically decrypts them at runtime

License

Notifications You must be signed in to change notification settings

0xflux/str_crypter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

str_crypter

str_crypter is a Rust library for XOR encryption and decryption of strings. It provides a macro to XOR encrypt strings from plaintext at compile time using a single byte key. When building in release mode, any plaintext strings encrypted with the macro sc!() will not be present in the binary. At runtime, the macro expands to decrypt the encrypted string.

Usage

use str_crypter::{decrypt_string, sc};

fn main() {
    let encrypted_str: String = match sc!("Hello world!", 20) {
        Ok(s) => s,
        Err(e) => panic!("Decryption failed: {:?}", e),
    };

    println!("Decrypted string: {}", encrypted_str);
}

Installation

Add str_crypter to your Cargo.toml:

[dependencies]
str_crypter = "1.0.1"

Or use the command cargo add str_crypter

About

Str Crypter is a Rust macro to encrypt plaintext strings at compile time, and automatically decrypts them at runtime

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages