logo
pub trait Encrypter {
    fn encrypt(&self, value: Bytes, secret: Option<String>) -> Bytes;
    fn decrypt(&self, value: Bytes, secret: Option<String>) -> Bytes;
}
Expand description

The Encrypter should be implemented by objects intending to encrypt or decrypt bytes.

Due to decompiling client side applications, encryption should not to be considered secure, merely obfuscated / hidden from plainsite.

Required Methods

Encrypts bytes Encrypted (or obfuscated) version of the original.

Arguments
  • value - The unencrypted data.
  • secret - The secret key to encrypt the data with. Leave blank to use default secret key. (optional, default: empty)

Decrypts bytes. Decrypted (or unobfuscated) version of the encrypted data.

Arguments
  • value - The encrypted data.
  • secret - The secret key to encrypt the data with. Leave blank to use default secret key. (optional, default: empty)

Implementors