Giter VIP home page Giter VIP logo

ice-crypt's Introduction

ICE-Crypt

Ice-Crypt is a Rust implementation of the ICE (Information Concealment Engine) encryption algorithm.

ICE

[ICE] is a 64-bit private key block cipher, in the tradition of DES. However, unlike DES, it was designed to be secure against differential and linear cryptanalysis, and has no key complementation weaknesses or weak keys. In addition, its key size can be any multiple of 64 bits, whereas the DES key is limited to 56 bits.
-- Matthew Kwan, Author of the ICE encryption algorithm

Usage

Add this to your Cargo.toml:

[dependencies]
ice-crypt = "1.0.0"

To encrypt a simple message, you can use the following code:

src/main.rs:

use ice_crypt::IceKey;

fn main() {
    let key: Vec<u8> = vec![67, 83, 71, 79, 16, 54, 0, 0, 132, 13, 0, 0, 97, 3, 0, 0];

    let message: &str = "My secret message";

    // Create a new IceKey instance
    let mut icekey = IceKey::new(2);

    // Set Private Key
    icekey.set(key);

    let encrypted_message: Vec<u8> = icekey.encrypt_all(message.as_bytes().to_vec());

    let decrypted_message: Vec<u8> = icekey.decrypt_all(encrypted_message);

    // Convert to string and remove 0 padding
    let mut output = std::str::from_utf8(&decrypted_message).unwrap();
    output = output.trim_end_matches('\0');

    assert_eq!(message, output);
}

Documentation

TODO

Original

The ICE encryption algorithm was designed and written by Matthew Kwan, checkout his C/C++ implementations of the algorithm on his website.

License

Ice-Crypt is distributed under the terms of the GNU GENERAL PUBLIC LICENSE (Version 3).

See LICENSE for more details.

ice-crypt's People

Contributors

groruk avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.