pub struct Aes256GcmEncryptor { /* private fields */ }Expand description
AES-256-GCM 加密器
使用 AES-256-GCM 算法进行加密,每次加密使用随机生成的 12 字节 nonce 加密后的数据格式: [nonce (12 bytes)][ciphertext]
§安全说明
- 每次加密都会生成新的随机 nonce,确保相同明文产生不同密文
- 密钥必须严格保密,建议使用安全的密钥派生函数(如 PBKDF2)从密码生成
- nonce 会随密文一起存储,解密时需要提取
Implementations§
Trait Implementations§
Source§impl Encryptor for Aes256GcmEncryptor
impl Encryptor for Aes256GcmEncryptor
Auto Trait Implementations§
impl Freeze for Aes256GcmEncryptor
impl RefUnwindSafe for Aes256GcmEncryptor
impl Send for Aes256GcmEncryptor
impl Sync for Aes256GcmEncryptor
impl Unpin for Aes256GcmEncryptor
impl UnsafeUnpin for Aes256GcmEncryptor
impl UnwindSafe for Aes256GcmEncryptor
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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