Skip to main content

encrypt

Function encrypt 

Source
pub fn encrypt(data: &[u8]) -> Vec<u8> 
Expand description

Encrypts data by XORing each byte with 0xAA.

§Examples

use core_api::encrypt;

let data = vec![1, 2, 3];
let encrypted = encrypt(&data);
assert_eq!(encrypted[0], 1 ^ 0xAA);
assert_eq!(encrypted[1], 2 ^ 0xAA);
assert_eq!(encrypted[2], 3 ^ 0xAA);