Skip to main content

Decrypt

Decrypt a value produced by Encrypt, returning the original.

The encryption context has to match the one used to encrypt. Without with role, the context is your own user account; with it, the role. A value encrypted under a role cannot be decrypted without naming that role, and a value encrypted under one user cannot be decrypted by another.

A mismatch fails with Unable to decrypt value. The message suggests the context it expected, but cannot distinguish a wrong context from a corrupted value.

Syntax

decrypt "<value>" [with role <role reference>]

Parameters

value

String — The ciphertext to decrypt, as returned by Encrypt.

role reference

String — Name of the role the value was encrypted under. Omit it if it was encrypted under your own user account.

Security

You must hold the role you name. Naming a role you do not hold fails with You are not authorized to use role "…".