RigoOnRails / encrypted-message

Safely encrypt & store serializable data using XChaCha20Poly1305.
MIT License
3 stars 0 forks source link
diesel encryption rust xchacha20poly1305

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.

[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.