|-
| width='120' | '''Signatures'''
|{{Func|crypto:encrypt|$data as xs:anyAtomicType, $encryption type as xs:string, $key as xs:anyAtomicType, $algorithm as xs:string|xs:base64Binary}}
|-
| '''Summary'''
|Encrypts data with the specified key:
* {{Code|$data}} must be a string or binary item.
* {{Code|$encryptiontype}} must be {{Code|symmetric}}.
* {{Code|$key}} is the secret key which is used for both encryption and decryption of input data. It must be a string or binary item. Its length is fixed and depends on the chosen algorithm: {{Code|8 bytes for DES}}, {{Code|16 bytes for AES}}.
* {{Code|$algorithm}} must either be {{Code|DES}} or {{Code|AES}}. '''Default is {{Code|DES}}'''.