attempts to decrypt the encrypted object enc using the specified password.


attempts to decrypt using the cryptographic key specification keyspec.


attempts to decrypt the ByteArray object bytes, to give another ByteArray object.


interactively requests a password with which to try to decrypt obj.



open allclose all

Basic Examples  (3)

Encrypt a message with a password:

Decrypt with the same password to get back the message:

Generate a key:

Encrypt using the key:

Decrypt using the key:

Generate public and private keys:

Encrypt using the public key:

Decrypt using the private key:

Alternatively, encrypt using the private key:

Now decrypt using the public key:

Scope  (2)

Encrypt any expression:

Decrypt to get back the exact expression:

Decrypt can be passed a ByteArray:

Applications  (1)

Write simple cryptographic signing and verification functions:

Generate a pair of public and private keys:

Define an expression to sign:

Generate a signature:

Verify that the signature is authentic:

Verifying with another expression will fail:

Possible Issues  (1)

Decrypting using the wrong key will yield a message:

Introduced in 2015
Updated in 2019