extended-tea 0.1.1

XTEA (eXtended TEA), a block cipher designed to correct weaknesses in TEA.
Documentation
  • Coverage
  • 100%
    10 out of 10 items documented2 out of 9 items with examples
  • Size
  • Source code size: 15.88 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.5 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • osrs-rs/xtea
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Jakobzs

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);