rainier-crypt
Reversible encryption and message signing — Laravel's Crypt, plus the
signing half that Laravel spreads across signed URLs and cookie
integrity.
use ;
#
Encrypt or sign?
| Hidden | Tamper-evident | Use for | |
|---|---|---|---|
encrypt |
yes | yes | anything the client must not read |
sign |
no | yes | anything the client may read but not change |
Reach for signing when the value is not a secret. An unsubscribe link, a reset token, a "remember this choice" cookie — encrypting those makes them opaque in your own logs for no gain.
This is not password hashing
Passwords are hashed, never encrypted, and that lives in rainier-auth's
Hasher. If you can get the value back out, it is the wrong tool for a
password — see the hashing docs.
Rotation is designed in
Every payload records which key produced it, and a [KeyRing] holds one
current key plus any number of retired ones. Rotating is a deploy:
# use ;
#
Retrofitting that is painful, which is why it is here from the first release rather than deferred until a key is known to have leaked.