#encryption-decryption #decryption #character-set #high-performance #customcharset #base64alternative #binaryencryption

bin-encrypt-decrypt

A high-performance binary encryption and decryption library that supports customizable character sets beyond Base64

5 releases (stable)

1.3.0 Oct 27, 2024
1.2.0 Oct 27, 2024
1.1.0 Oct 27, 2024
1.0.0 Oct 27, 2024
0.1.0 Oct 27, 2024

#711 in Parser implementations

Download history 202/week @ 2024-10-26 32/week @ 2024-11-02

234 downloads per month

MIT license

17KB
273 lines

bin-encrypt-decrypt

Official Documentation

A high-performance binary encryption and decryption library that supports customizable character sets beyond Base64.

Features

  • Custom Character Sets: Define your own character set for encoding and decoding, allowing for flexible data representation.
  • High Performance: Optimized for speed, making it suitable for applications requiring efficient cryptographic operations.
  • Simple API: Intuitive and easy-to-use interface for both encryption and decryption processes.
  • Robust Error Handling: Provides clear and descriptive error messages to facilitate debugging.
  • Extensive Documentation: Comprehensive guides and examples to help you get started quickly.

Installation

To install bin-encrypt-decrypt run cmd:

cargo add bin-encrypt-decrypt

Usage

Encrypt

Use Struct

use bin_encrypt_decrypt::*;
let mut crypt_decrypt: CryptDecrypt<'_> = CryptDecrypt::new();
let test_str: &str = "test";
let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=");
crypt_decrypt.set_charset(&charset);
let encode: Result<String, CryptError> = crypt_decrypt.encrypt(test_str);

Use Function

use bin_encrypt_decrypt::*;
let test_str: &str = "test";
let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=");
let encode: Result<String, CryptError> = encrypt(&charset, test_str);

Decrypt

Use Struct

use bin_encrypt_decrypt::*;
let mut crypt_decrypt: CryptDecrypt<'_> = CryptDecrypt::new();
let test_str: &str = "aab0aabLaabZaab0";
let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=");
crypt_decrypt.set_charset(&charset);
let decode: Result<String, DecryptError> = crypt_decrypt.decrypt(test_str);

Use Function

use bin_encrypt_decrypt::*;
let test_str: &str = "aab0aabLaabZaab0";
let mut charset: String = String::from("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_=");
let decode: Result<String, DecryptError> = decrypt(&charset, test_str);

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Contact

For any inquiries, please reach out to the author at ltpp-universe root@ltpp.vip.

Dependencies

~89KB