# SymmetricKey

SymmetricKey[assoc]

represents all the information needed for encryption, decryption, and other operations in a symmetric cryptographic system.

# Details

• SymmetricKey objects can be used with functions such as Encrypt and Decrypt.
• A single SymmetricKey object can be used for both encryption and decryption.
• In SymmetricKey[assoc], the association assoc contains the following:
•  "Cipher" cipher used "Key" key as a ByteArray "KeySize" size of key in bits "InitializationVector" initialization vector as a ByteArray or None "BlockMode" block chaining mode for block ciphers
• Possible methods are as listed for GenerateSymmetricKey.
• When used in Encrypt, the setting "InitializationVector"->None specifies that Encrypt should generate a new initialization vector whenever it is called.
• SymmetricKey[assoc]["prop"] gives the specified element of assoc. It is equivalent to assoc["prop"].
• SymmetricKey[]["Parameters"] gives all the information contained in the object, as an association.
• SymmetricKey[]["Properties"]
• gives a list of available properties.

# Examples

## Basic Examples(1)

Generate a random symmetric key:

Use the key to encrypt:

Decrypt the message:

You can retrieve keys and values from the associations with the SymmetricKey object:

Extract all the information about the key:

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

#### Text

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

#### BibTeX

@misc{reference.wolfram_2020_symmetrickey, author="Wolfram Research", title="{SymmetricKey}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/SymmetricKey.html}", note=[Accessed: 10-May-2021 ]}

#### BibLaTeX

@online{reference.wolfram_2020_symmetrickey, organization={Wolfram Research}, title={SymmetricKey}, year={2020}, url={https://reference.wolfram.com/language/ref/SymmetricKey.html}, note=[Accessed: 10-May-2021 ]}

#### CMS

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

#### APA

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