Hello, I've got a project where i have to implement the TripleDES encryption algoritm. I have found the following crate: https://github.com/RustCrypto/block-ciphers/tree/master/des, and have started implementing it, however I'm not completly sure how to use it, the docs aren't really to much help. I've got this code, that compiles, yet throws a runtime error:
let message = "Test string".to_string();
let slice_key = [0 as u8; 24];
let key: Key<TdesEee3> = GenericArray::clone_from_slice(&slice_key);
let encryptor = TdesEee3::new(&key);
let tranformed_message = message.as_bytes();
let mut block: Block<TdesEee3> = GenericArray::clone_from_slice(tranformed_message);
encryptor.encrypt_block(&mut block);
Here is the error it throws:
thread '<unnamed>' panicked at 'Slice must be the same length as the array'
Any help / suggestions are much appreciated thank you!