pub struct Xtea;
Expand description
Implementation of XTEA encryption and decryption methods.
Implementations§
Source§impl Xtea
impl Xtea
Sourcepub const DEFAULT_KEY: [u32; 4]
pub const DEFAULT_KEY: [u32; 4]
Default XTEA key, used in thumbs.dat and packagedefinition.txt
Sourcepub fn is_encrypted_text_file(input_buffer: &[u8]) -> bool
pub fn is_encrypted_text_file(input_buffer: &[u8]) -> bool
Checks if a given buffer represents an encrypted text file. This function will check for the presence of a default header in the text file.
Sourcepub fn decrypt_text_file(input_buffer: &[u8]) -> Result<String, XteaError>
pub fn decrypt_text_file(input_buffer: &[u8]) -> Result<String, XteaError>
Decrypts a text file given its buffer, uses the default xtea key.
Sourcepub fn decrypt_string(
input_buffer: &[u8],
key: &[u32; 4],
) -> Result<String, XteaError>
pub fn decrypt_string( input_buffer: &[u8], key: &[u32; 4], ) -> Result<String, XteaError>
Decrypts a string given its buffer and key.
pub fn encrypt_text_file(input_string: String) -> Result<Vec<u8>, XteaError>
pub fn encrypt_string( input_string: String, key: &[u32; 4], ) -> Result<Vec<u8>, XteaError>
Auto Trait Implementations§
impl Freeze for Xtea
impl RefUnwindSafe for Xtea
impl Send for Xtea
impl Sync for Xtea
impl Unpin for Xtea
impl UnwindSafe for Xtea
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more