File Encryption

This interface helps you use symmetric encryption algorithms to encrypt the files you are about to upload.Here is the sample code to encrypt data.

use cess_rust_sdk::core::crypt;

fn main() {
    let data="test user data ...".as_bytes();
    let key="test user aes key".as_bytes();
    let cipher_text=crypt::aes_cbc_encrypt(data, key).unwrap();
    print!("encrypt data sucess,the cipher text is{:?}",cipher_text);


In fact, CESS officially recommends that you preprocess the file before performing encryption operations, such as redundant encoding and file fragmentation, and then encrypt each fragment separately, which will help improve the efficiency of file encryption.

Last updated