WOLFRAM

Decrypt["password",enc]

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

Decrypt[keyspec,enc]

attempts to decrypt using the cryptographic key specification keyspec.

Decrypt[obj]

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

Details

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

Encrypt a message with a password:

Out[1]=1

Decrypt with the same password to get back the message:

Out[2]=2

Generate a secret key:

Out[1]=1

Encrypt using the key:

Out[2]=2

Decrypt using the key:

Out[3]=3

Generate public and private keys:

Out[1]=1

Encrypt using the public key:

Out[2]=2

Decrypt using the private key:

Out[3]=3

Alternatively, encrypt using the private key:

Out[4]=4

Now decrypt using the public key:

Out[5]=5

Scope  (3)Survey of the scope of standard use cases

Encrypt any expression:

Out[1]=1

Decrypt to get back the exact expression:

Out[2]=2

To decrypt byte array encrypted data, Decrypt needs to know details of the encryption algorithm used:

Create an EncryptedObject to specify the cipher, padding mode and format of the plaintext message:

Out[2]=2

Decrypt using the correct password or key:

Out[3]=3

Symmetric ciphers usually require an initialization vector for decryption:

Create an EncryptedObject to specify the cipher, block mode, initialization vector and format of the plaintext message:

Out[2]=2

Decrypt using the correct password or key:

Out[3]=3

Applications  (1)Sample problems that can be solved with this function

Write simple cryptographic signing and verification functions:

Generate a pair of public and private keys:

Out[3]=3

Define an expression to sign:

Out[4]=4

Generate a signature:

Out[5]=5

Verify that the signature is authentic:

Out[6]=6

Verifying with another expression will fail:

Out[7]=7

Possible Issues  (1)Common pitfalls and unexpected behavior

Decrypting using the wrong key will yield a message:

Out[1]=1
Out[2]=2
Wolfram Research (2015), Decrypt, Wolfram Language function, https://reference.wolfram.com/language/ref/Decrypt.html (updated 2019).
Wolfram Research (2015), Decrypt, Wolfram Language function, https://reference.wolfram.com/language/ref/Decrypt.html (updated 2019).

Text

Wolfram Research (2015), Decrypt, Wolfram Language function, https://reference.wolfram.com/language/ref/Decrypt.html (updated 2019).

Wolfram Research (2015), Decrypt, Wolfram Language function, https://reference.wolfram.com/language/ref/Decrypt.html (updated 2019).

CMS

Wolfram Language. 2015. "Decrypt." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/Decrypt.html.

Wolfram Language. 2015. "Decrypt." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/Decrypt.html.

APA

Wolfram Language. (2015). Decrypt. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Decrypt.html

Wolfram Language. (2015). Decrypt. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Decrypt.html

BibTeX

@misc{reference.wolfram_2025_decrypt, author="Wolfram Research", title="{Decrypt}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/Decrypt.html}", note=[Accessed: 01-June-2025 ]}

@misc{reference.wolfram_2025_decrypt, author="Wolfram Research", title="{Decrypt}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/Decrypt.html}", note=[Accessed: 01-June-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_decrypt, organization={Wolfram Research}, title={Decrypt}, year={2019}, url={https://reference.wolfram.com/language/ref/Decrypt.html}, note=[Accessed: 01-June-2025 ]}

@online{reference.wolfram_2025_decrypt, organization={Wolfram Research}, title={Decrypt}, year={2019}, url={https://reference.wolfram.com/language/ref/Decrypt.html}, note=[Accessed: 01-June-2025 ]}