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 antivirus or other endpoint security systems. It would be annoying if our carefully curated data were deleted!
Variants§
AES128(Vec<u8>)
AES-128, to protect from prying eyes.
RC4(Vec<u8>)
RC4, to protect from antivirus
Xor(Vec<u8>)
Exclusive OR, to protect from antivirus with best performance
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
An error occurs if the key isn’t 16 bytes.
Sourcepub fn key_type(&self) -> EncryptionOption
pub fn key_type(&self) -> EncryptionOption
Return the related EncryptionOption type
Trait Implementations§
Source§impl Display for FileEncryption
impl Display for FileEncryption
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.