Changes

Jump to navigation Jump to search
52 bytes removed ,  19:01, 23 September 2019
|Creates an authentication code for the specified {{Code|$data}} via a cryptographic hash function:
* {{Code|$key}} must not be empty.
* {{Code|$algorithm}} describes the hash algorithm which is used for encryption. Currently supported are {{Code|md5}}, {{Code|sha1}}, {{Code|sha256}}, {{Code|sha384}}, {{Code|sha512}}. '''Default is {{Code|md5}}'''.* {{Code|$encoding}} must either be {{Code|hex}} or {{Code|base64}}; it specifies the encoding of the returned authentication code. '''Default is {{Code|base64}}'''.
|-
| '''Errors'''
|-
| '''Example'''
|'''Returns the Return message authentication code (MAC) for a given string.''':
'''Query:'''
<pre class="brush:xquery">
crypto:hmac('message','secretkey','md5','base64hex')
</pre>
|-
| '''Example'''
|'''Encrypts Encrypt input data.''' '''Query:'''
<pre class="brush:xquery">
crypto:encrypt('message', 'symmetric','keykeyke','DES')
</pre>
|}
|-
| '''Example'''
|'''Decrypts Decrypt input data and returns the return original string.''':
'''Query:'''
<pre class="brush:xquery">
let $encrypted := crypto:encrypt('message', 'symmetric','keykeyke','DES')return crypto:decrypt($encrypted, 'symmetric','keykeyke','DES')
</pre>
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu