-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Feature Requests
Expose new API: encrypt_private(&str) -> String and decrypt_private(&str) -> Result<String> or something like it, that would use the same scheme as private cookies do.
Why you believe this feature is necessary.
It's not necessary, but it would be useful to be able to use the same encryption that private cookies use on arbitrary data/strings. This way encrypted values can be embedded eg. in rendered forms to pass authenticated, unforgeable data.
A convincing use-case for this feature.
I'd like to embed an URL and some control data in one of my forms, to control some flow after form submission, and not have to worry about all the possible attack vectors. It would greatly simplify everything if I could trust that data was not tampered with. I can't put it in cookies since it's page, and not session, related.
Why this feature can't or shouldn't exist outside of Rocket.
Obviously, it can be done manually / through another library, but since Rocket already takes care of managing the encryption key, it would be much easier to just reuse it.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status