This commit is contained in:
@ -28,7 +28,7 @@ impl CryptoWrapper {
|
||||
/// Encrypt some data, returning the result as a base64-encoded string
|
||||
pub fn encrypt<T: Encode + Decode>(&self, data: &T) -> Result<String, Box<dyn Error>> {
|
||||
let aes_key = Aes256Gcm::new(&self.key);
|
||||
let nonce_bytes = rand::thread_rng().gen::<[u8; NONCE_LEN]>();
|
||||
let nonce_bytes = rand::rng().random::<[u8; NONCE_LEN]>();
|
||||
|
||||
let serialized_data = bincode::encode_to_vec(data, bincode::config::standard())?;
|
||||
|
||||
|
Reference in New Issue
Block a user