str_crypter

Crates.iostr_crypter
lib.rsstr_crypter
version
sourcesrc
created_at2024-05-26 10:44:35.021644
updated_at2024-10-16 21:31:55.682014
descriptionA macro library for XOR encryption and decryption of strings at compile time, meaning no cleartext strings will be in your release binary (when using the macro). The encrypted strings will be decoded at runtime.
homepage
repositoryhttps://github.com/0xflux/str_crypter
max_upload_size
id1252498
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
F L U X (0xflux)

documentation

https://docs.rs/str_crypter

README

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.

Version info

This was originally turned into a 2.0 crate, however after additional testing the crate was not working as intended, so I have yanked those versions and reverted it to an older working copy under v1. The changes made in 2.0 weren't particularly groundbreaking nor did it add extra functionality, so I have no issues yanking it and working on it again when I have some more time.

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.3"

Or use the command cargo add str_crypter

Commit count: 11

cargo fmt