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

    let plain_text = common::sanitize_text(plain_text)?;
    
    // If no key was passed, we don't encrypt
    if key.len() == 0 {
        return Ok(common::format_output(plain_text));
    }

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

    let enciphered = add_bytes(&plain_text, &key);

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