Eloquent cast
Encryptable::class in $casts transparently handles reads and writes.
PHP / Field encryption + Rust
Eloquent casts, SQL decrypt fragments and key rotation, with plain PHP support.
Encryptable encrypts attributes on write and decrypts on read; Eloquent casts and the manual API share one OpenSSL path.
For uniqueness and existence checks, DB mode emits MySQL and PostgreSQL SQL decrypt fragments; previous_keys keeps old keys for online rotation.
A friendly padlock: the amber key is the current primary key, and the two grey keys on the ring are previous_keys, still able to decrypt old data.
New primary, old keys stay on the ring.Framework bridges only wire config; the crypto core stays framework-free.
Encryptable::class in $casts transparently handles reads and writes.
Encryption::php() serves CLI, queue and other non-model code paths.
Generate MySQL and PostgreSQL snippets for comparisons against ciphertext.
UniqueEncrypted and ExistsEncrypted compare deterministic ciphertext.
Primary and previous_keys form a decryption ring for gradual re-encryption.
Laravel, Webman, Hyperf and ThinkPHP adapters, plus plain PHP.
The same field encryption semantics, now available in Rust.
Searchable field encryption in Rust
AES-256-GCM for encryption at rest, AES-256-ECB for lookups by original value, HKDF-derived subkeys, SQL fragments and eight framework integrations.
Each release solves one concrete problem instead of piling on features.
Accept base64-prefixed previous_keys, fix how validation rules resolve the encrypter, and automate release notes.
Add a 1280x640 social preview for the GitHub repository and reference it from the README.
Mascot gains expressions() and expression(), shipping 12 expression forms with the package.
Drop the pet SVG background and switch the README to Markdown tables.
Click an image to enlarge.
Install, then run a minimal example.
composer require erikwang2013/encryptableuse Erikwang2013\Encryptable\Encryption;
$plain = 'value to protect';
$cipher = Encryption::php()->encrypt($plain);
$restored = Encryption::php()->decrypt($cipher);cargo add encryptable-rustuse encryptable::config::ArrayConfig;
use encryptable::AeadEncrypter;
let app = AeadEncrypter::new(&ArrayConfig::new("0123456789abcdef0123456789abcdef"))?;
let c = app.encrypt("13800138000")?;
let s = app.decrypt_text(&c)?;Hover and the mood changes.