Skip to content

Latest commit

 

History

History
47 lines (33 loc) · 2.28 KB

README.md

File metadata and controls

47 lines (33 loc) · 2.28 KB

encrypted-message

crates.io docs.rs "Lint & run tests" workflow License

Safely encrypt & store serializable data using XChaCha20Poly1305.

Install

[dependencies]
encrypted-message = "0.3"

Integration with Diesel

EncryptedMessage implements FromSql & ToSql, allowing you to use EncryptedMessage as a field type in your models.

  • MySQL: Enable the diesel & diesel-mysql features. Supports the Json type.
  • PostgreSQL: Enable the diesel & diesel-postgres features. Supports the Json & Jsonb types.
[dependencies]
encrypted-message = { version = "0.3", features = ["diesel", "diesel-<mysql|postgres>"] }

Examples

Security

This crate uses trusted, pure-Rust encryption using the chacha20poly1305 crate from the Rust Crypto organization.

Keys are handled safely using the secrecy crate, which internally uses the zeroize crate (also from Rust Crypto) to zero-out the keys in memory when no longer used.