#cipher #tea #extended #wikipedia #information #block-cipher #xtea

extended-tea

XTEA (eXtended TEA), a block cipher designed to correct weaknesses in TEA

3 unstable releases

0.1.1 Dec 30, 2021
0.1.0 Dec 30, 2021
0.0.0 Dec 27, 2021

#1353 in Cryptography

Download history 33/week @ 2024-01-01 29/week @ 2024-01-08 24/week @ 2024-01-15 13/week @ 2024-01-22 26/week @ 2024-01-29 3/week @ 2024-02-05 17/week @ 2024-02-12 26/week @ 2024-02-19 39/week @ 2024-02-26 26/week @ 2024-03-04 30/week @ 2024-03-11 26/week @ 2024-03-18 8/week @ 2024-03-25

91 downloads per month

MIT license

15KB
179 lines

extended-tea

Build API Crate dependency status

This crate provides a Rusty implementation of the XTEA cipher, written in Rust.

This crate also provides convenience methods for ciphering and deciphering u8 slices and Read streams.

See Wikipedia for more information on the XTEA cipher.

Note

This crate should only be used if you're working on an existing application that uses XTEA. If you're wanting to implement an encryption or a cipher system in your project DO NOT USE THIS.

Installation

To use this crate, add the following to your Cargo.toml:

[dependencies]
extended-tea = "0.1.1"

Example

use extended_tea::XTEA;
use byteorder::BE;

let input: Box<[u8]> = vec![10u8; 16].into_boxed_slice();

let xtea = XTEA::new([0x1380C5B5, 0x28037DF9, 0x26E314A2, 0xC57684E4]);

let encrypted = {
    let mut output = vec![0u8; input.len()].into_boxed_slice();
    xtea.encipher_u8slice::<BE>(&input, &mut output);
    output
};

let decrypted = {
    let mut output = vec![0u8; input.len()].into_boxed_slice();
    xtea.decipher_u8slice::<BE>(&encrypted, &mut output);
    output
};
assert_eq!(input, decrypted);

Dependencies

~120KB