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

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

    if key.len() == 0 {
        return Ok(common::format_output(cipher_text));
    }

    let mut deciphered = Vec::new();

    for (i , &cipher_char) in cipher_text.iter().enumerate() {
        let plain_char = cipher_char - key[i];

        deciphered.push(plain_char);

        key.push(plain_char);
    }

    Ok(common::format_output(deciphered))
}
/// Deciphers `cipher_text` with `priming_key` using the Vigenere autokey system
Deciphers `cipher_text` with `priming_key` using the Vigenere autokey system
Deciphers ` cipher_text ` with ` priming_key ` using the Vigenere autokey system
pub fn decipher(priming_key: &[u8], cipher_text: &[u8]) -> Result<String, Error> {
    let mut key = common::sanitize_text(priming_key)?;
    let cipher_text = common::sanitize_text(cipher_text)?;
    if key.len() == 0 {
        return Ok(common::format_output(cipher_text));
    }
    let mut deciphered = Vec::new();
    for (i , &cipher_char) in cipher_text.iter().enumerate() {
        let plain_char = cipher_char - key[i];
        deciphered.push(plain_char);
        key.push(plain_char);
    }
    Ok(common::format_output(deciphered))
}
pub fn decipher ( priming_key : & [ u8 ] , cipher_text : & [ u8 ] ) -> Result < String , Error > { let mut key = common :: sanitize_text ( priming_key ) ? ; let cipher_text = common :: sanitize_text ( cipher_text ) ? ; if key . len ( ) == 0 { return Ok ( common :: format_output ( cipher_text ) ) ; } let mut deciphered = Vec :: new ( ) ; for ( i , & cipher_char ) in cipher_text . iter ( ) . enumerate ( ) { let plain_char = cipher_char - key [ i ] ; deciphered . push ( plain_char ) ; key . push ( plain_char ) ; } Ok ( common :: format_output ( deciphered ) ) }
Deciphers `cipher_text` with `priming_key` using the Vigenere autokey system
Deciphers ` cipher_text ` with ` priming_key ` using the Vigenere autokey system
priming_key
&[u8]
cipher_text
&[u8]
priming_key
&[u8]
cipher_text
&[u8]