#encryption #diesel #aes

encrypted-message

Safely encrypt & store serializable data using AES-256-GCM

1 unstable release

0.3.0 Apr 28, 2024
0.2.0 Apr 23, 2024
0.1.0 Apr 11, 2024

#1836 in Cryptography

Download history 6/week @ 2024-07-23 112/week @ 2024-07-30 28/week @ 2024-08-06 1/week @ 2024-08-13 7/week @ 2024-08-20 10/week @ 2024-08-27 8/week @ 2024-09-03 3/week @ 2024-09-10 3/week @ 2024-09-17 21/week @ 2024-09-24

183 downloads per month

MIT license

32KB
394 lines

encrypted-message

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

Safely encrypt & store serializable data using AES-256-GCM.

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

Dependencies

~2.2–4.5MB
~97K SLoC