encrypts expr using the specified password, to give an encrypted object.
encrypts expr using the cryptographic key specification keyspec.
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 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