Encrypt
Encrypt["password",expr]
encrypts expr using the specified password, to give an encrypted object.
Encrypt[keyspec,expr]
encrypts expr using the cryptographic key specification keyspec.
Encrypt[expr]
interactively requests a password with which to encrypt expr.
Details and Options


- Encrypt yields EncryptedObject[…], suitable for decryption with Decrypt.
- Encrypt[key,"string"] yields an EncryptedObject containing the encrypted version of the contents of the string as encoded in UTF-8.
- Encrypt[key,ByteArray[…]] yields an EncryptedObject containing the encrypted version of the raw bytes in the ByteArray object.
- In a notebook interface, Encrypt[expr] generates a dialog box; in a textual interface it generates a textual prompt.
- Encrypt has the following option:
-
Method Automatic details of encryption method - With the setting Methodassoc, the association assoc gives details of the encryption method to use.
- The "Padding" element in the association assoc specifies the padding method to pad incomplete input blocks.
- Encryption with a public key and decryption with a private key support the following padding methods: "PKCS1", "OAEP", "SSLV23", None.
- Encryption with a private key and decryption with a public key support the following padding methods: "PKCS1", None.
- The "PKCS1" padding method is used as a default for asymmetric encryption.
- For a general expression, Encrypt[key,expr] yields an EncryptedObject essentially containing an encrypted version of Compress[expr].
- For RSA ciphers, the maximum length of data that can be encrypted is determined by the number of bytes
in the modulus, and the padding mode, according to:
-
"PKCS1" < "SSLV23" < "OAEP" < None
Examples
open allclose allBasic Examples (3)
Scope (2)
Applications (2)
Properties & Relations (1)
Possible Issues (4)
Timing (1)
Wolfram Research (2015), Encrypt, Wolfram Language function, https://reference.wolfram.com/language/ref/Encrypt.html (updated 2020).
Text
Wolfram Research (2015), Encrypt, Wolfram Language function, https://reference.wolfram.com/language/ref/Encrypt.html (updated 2020).
BibTeX
BibLaTeX
CMS
Wolfram Language. 2015. "Encrypt." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/Encrypt.html.
APA
Wolfram Language. (2015). Encrypt. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Encrypt.html