Expand description
The cryptostream crate provides a number of stream adapters that provide “transparent”
encryption or
decryption
of the wrapped Read or Write source. Since rust doesn’t
have a generic “stream” type that implements both reads and writes and in order to enforce
correct semantics (and boost security!), you need to pick the cryptostream variant that
correctly matches your needs.
The most common reasons for using this library:
read::Decryptor: You have an encryptedReadsource and you want to transparently decrypt its contents while reading from it (e.g. you have encrypted data at rest and want to decrypt it into memory).write::Encryptor: You have aWriteinstance you want to write the encrypted ciphertext equivalent of some plaintext you have in memory (e.g. you have plaintext data in memory you want to store it encrypted).
Considerably less common use cases:
read::Encryptor: You have aReadsource containing plaintext but you want to pull encrypted contents out of it (e.g. you want to encrypt data stored as plaintext).write::Decryptor: You want to write cyphertext to aWriteinstance and have it pass through the decrypted plaintext to the underlying stream (e.g. you have cryptotext in memory and want to store it decrypted).
Additionally, the bufread module provides the bufread::Encryptor and
bufread::Decryptor types for encrypting/decrypting plaintext/ciphertext on-the-fly from a
BufRead source. (There is no need for a bufwrite variant.)
Modules§
- bufread
- Cryptostream types which operate over
BufReadstreams, providing both encryption and decryption facilities. - read
- Cryptostream types which operate over
Readstreams, providing both encryption and decryption facilities. - write
- Cryptostream types which operate over
Writestreams, providing both encryption and decryption facilities.