pub fn ecb_cut_and_paste(k: &[u8]) -> Vec<u8> {
    // block1: email=zod@gmail. block2: com&uid=10&role= bock3: user\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC
    let my_profile = profile_for("zod@gmail.com");
    let ciphertext = encrypt_profile(&my_profile, k).unwrap();

    let my_profile2 =
        profile_for("xxxxxxxxxxadmin\u{b}\u{b}\u{b}\u{b}\u{b}\u{b}\u{b}\u{b}\u{b}\u{b}\u{b}");
    let ciphertext2 = encrypt_profile(&my_profile2, k).unwrap();

    // take the first two block of ciphertext1 and the second block from ciphertext 2
    let mut new_ciphertext = Vec::from(&ciphertext[..32]);
    new_ciphertext.extend_from_slice(&ciphertext2[16..32]);

    new_ciphertext
}
/// ECB cut-and-paste
///
/// Solution for problem 5 from set 2: <https://cryptopals.com/sets/2/challenges/13>
ECB cut-and-paste
Solution for problem 5 from set 2.
ECB cut - and - paste Solution for problem 5 from set 2 .
pub fn ecb_cut_and_paste(k: &[u8]) -> Vec<u8> {
    // block1: email=zod@gmail. block2: com&uid=10&role= bock3: user\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC
    let my_profile = profile_for("zod@gmail.com");
    let ciphertext = encrypt_profile(&my_profile, k).unwrap();
    let my_profile2 =
        profile_for("xxxxxxxxxxadmin\u{b}\u{b}\u{b}\u{b}\u{b}\u{b}\u{b}\u{b}\u{b}\u{b}\u{b}");
    let ciphertext2 = encrypt_profile(&my_profile2, k).unwrap();
    // take the first two block of ciphertext1 and the second block from ciphertext 2
    let mut new_ciphertext = Vec::from(&ciphertext[..32]);
    new_ciphertext.extend_from_slice(&ciphertext2[16..32]);
    new_ciphertext
}
pub fn ecb_cut_and_paste ( k : & [ u8 ] ) -> Vec < u8 > { // block1: email=zod@gmail. block2: com&uid=10&role= bock3: user\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC\0xC let my_profile = profile_for ( " " ) ; let ciphertext = encrypt_profile ( & my_profile , k ) . unwrap ( ) ; let my_profile2 = profile_for ( " \u{b} \u{b} \u{b} \u{b} \u{b} \u{b} \u{b} \u{b} \u{b} \u{b} \u{b} " ) ; let ciphertext2 = encrypt_profile ( & my_profile2 , k ) . unwrap ( ) ; // take the first two block of ciphertext1 and the second block from ciphertext 2 let mut new_ciphertext = Vec :: from ( & ciphertext [ .. 32 ] ) ; new_ciphertext . extend_from_slice ( & ciphertext2 [ 16 .. 32 ] ) ; new_ciphertext }
ECB cut-and-paste
Solution for problem 5 from set 2: <https://cryptopals.com/sets/2/challenges/13>
ECB cut - and - paste Solution for problem 5 from set 2 : <https : // cryptopals . com / sets / 2 / challenges / 13 >
k
&[u8]