pub fn decipher(key: &[u8], cipher_text: &[u8]) -> Result<String, Error> {
    let key = common::sanitize_text(key)?;

    let cipher_text = common::sanitize_text(cipher_text)?;

    // If no key was passed, we don't decrypt
    if key.len() == 0 {
        return Ok(common::format_output(cipher_text));
    }

    let key = repeat_key(key, cipher_text.len());

    let deciphered = subtract_bytes(&cipher_text, &key);

    Ok(common::format_output(deciphered))
}
/// Decipher `cipher_text` with the Vigenere cipher under the key `key`
Decipher `cipher_text` with the Vigenere cipher under the key `key`
Decipher ` cipher_text ` with the Vigenere cipher under the key ` key `
pub fn decipher(key: &[u8], cipher_text: &[u8]) -> Result<String, Error> {
    let key = common::sanitize_text(key)?;
    let cipher_text = common::sanitize_text(cipher_text)?;
    // If no key was passed, we don't decrypt
    if key.len() == 0 {
        return Ok(common::format_output(cipher_text));
    }
    let key = repeat_key(key, cipher_text.len());
    let deciphered = subtract_bytes(&cipher_text, &key);
    Ok(common::format_output(deciphered))
}
pub fn decipher ( key : & [ u8 ] , cipher_text : & [ u8 ] ) -> Result < String , Error > { let key = common :: sanitize_text ( key ) ? ; let cipher_text = common :: sanitize_text ( cipher_text ) ? ; // If no key was passed, we don't decrypt if key . len ( ) == 0 { return Ok ( common :: format_output ( cipher_text ) ) ; } let key = repeat_key ( key , cipher_text . len ( ) ) ; let deciphered = subtract_bytes ( & cipher_text , & key ) ; Ok ( common :: format_output ( deciphered ) ) }
Decipher `cipher_text` with the Vigenere cipher under the key `key`
Decipher ` cipher_text ` with the Vigenere cipher under the key ` key `
key
&[u8]
cipher_text
&[u8]
key
&[u8]
cipher_text
&[u8]