GenerateSymmetricKey
randomly generates a SymmetricKey object suitable for use with cryptographic functions.
GenerateSymmetricKey["password"]
derives a SymmetricKey object from the password string given.
GenerateSymmetricKey[bytes]
generates a SymmetricKey object using the byte array or list of bytes directly as the key.
GenerateSymmetricKey[DerivedKey[…]]
generates a symmetric key object with a key given by the DerivedKey object.
GenerateSymmetricKey[opts]
randomly generates a symmetric key using the specified options.
Details and Options
- GenerateSymmetricKey[] uses a system-specific, high-entropy randomness source.
- GenerateSymmetricKey has a Method option that specifies the cryptography method to use.
- With Method->"cipher", default settings for the specified cipher are used.
- If Method option is not provided, the default cipher is used. The current default cipher is "AES256".
- Particular settings can be specified using Method->assoc, where the entries in the association assoc are:
-
"Cipher" "AES256" cipher to use "KeySize" Automatic size of key in bits - Supported ciphers, together with the default key size, include:
-
"Blowfish" 256 bits "CAST5" 256 bits "DES" 64 bits "RC4" 256 bits "IDEA" 128 bits "AES128" 128 bits "AES192" 192 bits "AES256" 256 bits - The following ciphers can use any key size that is a multiple of 8:
-
"RC4" "Blowfish" "CAST5" - GenerateSymmetricKey["password"] effectively uses GenerateDerivedKey to generate a key.
- In GenerateSymmetricKey[bytes], bytes can be a ByteArray object or a list of integers between 0 and 255. The length of bytes must match the key size of the cipher used.
Examples
open allclose allScope (3)
Text
Wolfram Research (2015), GenerateSymmetricKey, Wolfram Language function, https://reference.wolfram.com/language/ref/GenerateSymmetricKey.html (updated 2019).
CMS
Wolfram Language. 2015. "GenerateSymmetricKey." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2019. https://reference.wolfram.com/language/ref/GenerateSymmetricKey.html.
APA
Wolfram Language. (2015). GenerateSymmetricKey. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GenerateSymmetricKey.html