pub struct Encryption { /* private fields */ }Expand description
AES-256-GCM encryption with Argon2-derived keys.
Implementations§
Source§impl Encryption
impl Encryption
Sourcepub fn from_password(password: &str, salt: &[u8]) -> Result<Self>
pub fn from_password(password: &str, salt: &[u8]) -> Result<Self>
Derive a 256-bit key from a password and salt using Argon2id.
Salt must be at least 8 bytes.
Sourcepub fn from_raw_key(key: [u8; 32]) -> Self
pub fn from_raw_key(key: [u8; 32]) -> Self
Create encryption from a raw 32-byte key (for testing or pre-derived keys).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Encryption
impl RefUnwindSafe for Encryption
impl Send for Encryption
impl Sync for Encryption
impl Unpin for Encryption
impl UnsafeUnpin for Encryption
impl UnwindSafe for Encryption
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more