pub enum FileEncryption {
AES128(Vec<u8>),
RC4(Vec<u8>),
Xor(Vec<u8>),
}
Expand description
Some of these algorithms are not secure, and that’s fine, since the goal isn’t necessarily data secrecy. The purpose is to store malware on disk without upsetting anti-virus systems. It would be annoying if security software deleted our carefully curated data!
Variants§
AES128(Vec<u8>)
AES-128, to protect from prying eyes.
RC4(Vec<u8>)
RC4 with a 16-byte key, to protect from anti-virus
Xor(Vec<u8>)
Exclusive OR, to protect from anti-virus
Implementations§
Source§impl FileEncryption
impl FileEncryption
Sourcepub fn new(option: EncryptionOption, bytes: Vec<u8>) -> Result<Self>
pub fn new(option: EncryptionOption, bytes: Vec<u8>) -> Result<Self>
Create a key object given the encryption algorithm and key bytes
§Errors
The only error is if the RC4 key isn’t exactly 16 bytes long.
Sourcepub fn key_type(&self) -> EncryptionOption
pub fn key_type(&self) -> EncryptionOption
Return the related EncryptionOption
type
Trait Implementations§
Source§impl Drop for FileEncryption
impl Drop for FileEncryption
Source§impl From<EncryptionOption> for FileEncryption
impl From<EncryptionOption> for FileEncryption
Source§fn from(option: EncryptionOption) -> Self
fn from(option: EncryptionOption) -> Self
Converts to this type from the input type.
Source§impl Hash for FileEncryption
impl Hash for FileEncryption
Source§impl PartialEq for FileEncryption
impl PartialEq for FileEncryption
Source§impl Zeroize for FileEncryption
impl Zeroize for FileEncryption
impl Eq for FileEncryption
impl StructuralPartialEq for FileEncryption
Auto Trait Implementations§
impl Freeze for FileEncryption
impl RefUnwindSafe for FileEncryption
impl Send for FileEncryption
impl Sync for FileEncryption
impl Unpin for FileEncryption
impl UnwindSafe for FileEncryption
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
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.