Decrypt

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)

Encrypt a message with a password:

Decrypt with the same password to get back the message:

Generate a secret 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  (3)

Encrypt any expression:

Decrypt to get back the exact expression:

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:

Decrypt using the correct password or key:

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:

Decrypt using the correct password or key:

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:

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).

CMS

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

BibTeX

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

BibLaTeX

@online{reference.wolfram_2024_decrypt, organization={Wolfram Research}, title={Decrypt}, year={2019}, url={https://reference.wolfram.com/language/ref/Decrypt.html}, note=[Accessed: 22-December-2024 ]}