\hypertarget{group__hmac__functions}{}\doxysection{HMAC Functions} \label{group__hmac__functions}\index{HMAC Functions@{HMAC Functions}} Collaboration diagram for HMAC Functions\+:\nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=350pt]{group__hmac__functions} \end{center} \end{figure} \doxysubsection*{Modules} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{group__crypto__transformations}{Cryptographic Stream Transformations}} \item \mbox{\hyperlink{group__cryptographic__constants}{Cryptographic Contants}} \item \mbox{\hyperlink{group__digest__algorithms}{Crytographic Digest Algorithms}} \end{DoxyCompactItemize} \doxysubsection*{Functions} \begin{DoxyCompactItemize} \item \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_ga3a75abdcf6815bd9c15ae55f5d8f0cc7}{Qore\+::\+DSS1\+\_\+hmac}} (data data, data key) \begin{DoxyCompactList}\small\item\em Returns the DSS1 (SHA-\/1 and \href{http://en.wikipedia.org/wiki/Digital_Signature_Algorithm}{\texttt{ DSA}}) based HMAC of the supplied argument as a hex string. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_gaca49d7d4e9a7999b7b11ffa734d98cf3}{Qore\+::\+DSS\+\_\+hmac}} (data data, data key) \begin{DoxyCompactList}\small\item\em Returns the DSS (SHA-\/0 and \href{http://en.wikipedia.org/wiki/Digital_Signature_Algorithm}{\texttt{ DSA}}) based HMAC of the supplied argument as a hex string. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_gaeebc2ad2c2cf99a33e42c98344fceb49}{Qore\+::\+MD2\+\_\+hmac}} (data data, data key) \begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/MD2_(cryptography)}{\texttt{ MD2}} based HMAC of the supplied argument as a hex string. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_gaa1f5781d25e14ad544f76db36111e1f3}{Qore\+::\+MD4\+\_\+hmac}} (data data, data key) \begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/MD4}{\texttt{ MD4}} based HMAC of the supplied argument as a hex string. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_gac4dc67bcb217ae04c43a9df9d14d0a85}{Qore\+::\+MD5\+\_\+hmac}} (data data, data key) \begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/MD5}{\texttt{ MD5}} based HMAC of the supplied argument as a hex string. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_ga2839943cdcce18a3e5ef63ac5c728eb2}{Qore\+::\+MDC2\+\_\+hmac}} (data data, data key) \begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/MDC2}{\texttt{ MDC2}} based HMAC of the supplied argument as a hex string. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_gadecee6c469e1b4dade49924bd68c7ae4}{Qore\+::\+RIPEMD160\+\_\+hmac}} (data data, data key) \begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/RIPEMD}{\texttt{ RIPEMD}} based HMAC of the supplied argument as a hex string. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_gaf76d63347ffb70de4202a771ad767e2d}{Qore\+::\+SHA1\+\_\+hmac}} (data data, data key) \begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\texttt{ SHA1}} based HMAC of the supplied argument as a hex string. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_gaf78d06e41607133b0c053a544b2e92b7}{Qore\+::\+SHA224\+\_\+hmac}} (data data, data key) \begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\texttt{ SHA224}} based HMAC of the supplied argument as a hex string. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_gaf8c329f83b4b31f2e88b5342d487480b}{Qore\+::\+SHA256\+\_\+hmac}} (data data, data key) \begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\texttt{ SHA256}} based HMAC of the supplied argument as a hex string. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_gac028eb1719043ec2461239a0c1de2654}{Qore\+::\+SHA384\+\_\+hmac}} (data data, data key) \begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\texttt{ SHA384}} based HMAC of the supplied argument as a hex string. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_ga492a23df5cb989d296c96a2076ef6f8f}{Qore\+::\+SHA512\+\_\+hmac}} (data data, data key) \begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\texttt{ SHA512}} based HMAC of the supplied argument as a hex string. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_gac5ffb694353caa752b069e7b6d018fca}{Qore\+::\+SHA\+\_\+hmac}} (data data, data key) \begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\texttt{ SHA}} based HMAC of the supplied argument as a hex string. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{group__hmac__functions_gad159aa97f0f07e827e74b4b9a12b92ca}{Qore\+::decrypt\+\_\+to\+\_\+binary}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} alg, data data, data key, data iv=\mbox{\hyperlink{group__cryptographic__constants_ga3e258a2c4d9e99eb43a97e7bf1dbe870}{Qore\+::\+Default\+IV}}, \+\_\+\+\_\+7\+\_\+ data mac, \+\_\+\+\_\+7\+\_\+ data aad) \begin{DoxyCompactList}\small\item\em Returns a binary value of decrypted data corresponding to the input arguments inluding the given \mbox{\hyperlink{group__crypto__transformations}{algorithm}}. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_ga94bc9698c368c32987d7207096806df1}{Qore\+::decrypt\+\_\+to\+\_\+string}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} alg, data data, data key, data iv=\mbox{\hyperlink{group__cryptographic__constants_ga3e258a2c4d9e99eb43a97e7bf1dbe870}{Qore\+::\+Default\+IV}}, \+\_\+\+\_\+7\+\_\+ data mac, \+\_\+\+\_\+7\+\_\+ data aad, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} encoding) \begin{DoxyCompactList}\small\item\em Returns a string of decrypted data corresponding to the input arguments inluding the given \mbox{\hyperlink{group__crypto__transformations}{algorithm}}. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{group__hmac__functions_gaefc09e78e7bccccf7bc3629e4e86c9e2}{Qore\+::digest}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} digest, data data) \begin{DoxyCompactList}\small\item\em Returns the digest of the supplied arguments as a binary value. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{group__hmac__functions_ga7141b56ffa6c5a4f8c9c58f788f33780}{Qore\+::encrypt}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} alg, data data, data key, data iv=\mbox{\hyperlink{group__cryptographic__constants_ga3e258a2c4d9e99eb43a97e7bf1dbe870}{Qore\+::\+Default\+IV}}, \+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} $>$ mac, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} mac\+\_\+size, \+\_\+\+\_\+7\+\_\+ data aad) \begin{DoxyCompactList}\small\item\em Returns a binary value of encrypted data corresponding to the input arguments inluding the given \mbox{\hyperlink{group__crypto__transformations}{algorithm}}. \end{DoxyCompactList}\item \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ \mbox{\hyperlink{group__hmac__functions_ga814c4d87e71a361d804daed88f5b7e97}{Qore\+::get\+\_\+cipher\+\_\+info}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} cipher) \begin{DoxyCompactList}\small\item\em Returns information about the given cipher or \mbox{\hyperlink{basic_data_types_NOTHING}{NOTHING}} if the cipher is unknown. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$ auto $>$ \mbox{\hyperlink{group__hmac__functions_gae431528555553d236bad69b9ccacb428}{Qore\+::get\+\_\+crypto\+\_\+info}} () \begin{DoxyCompactList}\small\item\em Returns a hash of information about each cryptographic algorithmn supported by the current build of Qore. \end{DoxyCompactList}\item \mbox{\hyperlink{class_qore_1_1_transform}{Transform}} \mbox{\hyperlink{group__hmac__functions_ga913932d6120f9ea1e3918168fb204976}{Qore\+::get\+\_\+decryptor}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} alg, data key, data iv=\mbox{\hyperlink{group__cryptographic__constants_ga3e258a2c4d9e99eb43a97e7bf1dbe870}{Qore\+::\+Default\+IV}}, \+\_\+\+\_\+7\+\_\+ data mac, \+\_\+\+\_\+7\+\_\+ data aad) \begin{DoxyCompactList}\small\item\em Returns a \mbox{\hyperlink{class_qore_1_1_transform}{Transform}} object for decrypting data using the given \mbox{\hyperlink{group__crypto__transformations}{algorithm}} for use with \mbox{\hyperlink{class_qore_1_1_transform_input_stream}{Transform\+Input\+Stream}} and \mbox{\hyperlink{class_qore_1_1_transform_output_stream}{Transform\+Output\+Stream}}. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} $>$ \mbox{\hyperlink{group__hmac__functions_ga227c4f084f2cffee4c466989d68a1fe3}{Qore\+::get\+\_\+digests}} () \begin{DoxyCompactList}\small\item\em Returns a list of supported digest algorithms for \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxyCompactList}\item \mbox{\hyperlink{class_qore_1_1_transform}{Transform}} \mbox{\hyperlink{group__hmac__functions_ga6e67ba0396d70cd012f7c46c7562b81f}{Qore\+::get\+\_\+encryptor}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} alg, data key, data iv=\mbox{\hyperlink{group__cryptographic__constants_ga3e258a2c4d9e99eb43a97e7bf1dbe870}{Qore\+::\+Default\+IV}}, \+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} $>$ mac, \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} mac\+\_\+size, \+\_\+\+\_\+7\+\_\+ data aad) \begin{DoxyCompactList}\small\item\em Returns a \mbox{\hyperlink{class_qore_1_1_transform}{Transform}} object for encrypting data using the given \mbox{\hyperlink{group__crypto__transformations}{algorithm}} for use with \mbox{\hyperlink{class_qore_1_1_transform_input_stream}{Transform\+Input\+Stream}} and \mbox{\hyperlink{class_qore_1_1_transform_output_stream}{Transform\+Output\+Stream}}. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{group__hmac__functions_gaa5fd7a2cd931d0390368d54865602c20}{Qore\+::get\+\_\+random\+\_\+bytes}} (\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}} size) \begin{DoxyCompactList}\small\item\em returns a binary value of random bytes using openssl \end{DoxyCompactList}\item bool \mbox{\hyperlink{group__hmac__functions_ga38c09b0428e8bb11c20fe56ee6353fac}{Qore\+::has\+\_\+digest}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_gaefc09e78e7bccccf7bc3629e4e86c9e2}{digest}}) \begin{DoxyCompactList}\small\item\em Returns \mbox{\hyperlink{basic_data_types_True}{True}} if the given digest is supported, \mbox{\hyperlink{basic_data_types_False}{False}} if not. \end{DoxyCompactList}\item \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{Qore\+::hmac}} (\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} \mbox{\hyperlink{group__hmac__functions_gaefc09e78e7bccccf7bc3629e4e86c9e2}{digest}}, data data, data key) \begin{DoxyCompactList}\small\item\em Returns the digest-\/based HMAC of the supplied arguments as a binary value. \end{DoxyCompactList}\end{DoxyCompactItemize} \doxysubsection{Detailed Description} Qore\textquotesingle{}s cryptography support is provided by the Open\+SSL library. In cryptography, a keyed-\/hash message authentication code (HMAC) is a specific construction for calculating a message authentication code (MAC) involving a cryptographic hash function in combination with a secret cryptographic key. As with any MAC, it may be used to simultaneously verify both the data integrity and the authentication of a message. Any cryptographic hash function, such as MD5 or SHA-\/1, may be used in the calculation of an HMAC; the resulting MAC algorithm is termed HMAC-\/\+MD5 or HMAC-\/\+SHA1 accordingly. The cryptographic strength of the HMAC depends upon the cryptographic strength of the underlying hash function, the size of its hash output, and on the size and quality of the key. For more info\+: \href{http://en.wikipedia.org/wiki/Hmac}{\texttt{ Wikipedia\textquotesingle{}s Hash-\/based message authentication code article}}. See also\+: \begin{DoxyItemize} \item \mbox{\hyperlink{group__cryptographic__functions}{Cryptographic Functions}} \item \mbox{\hyperlink{group__digest__functions}{Digest (Hash) Functions}} \item \mbox{\hyperlink{group__cryptographic__constants}{Cryptographic Contants}} \end{DoxyItemize} \doxysubsection{Function Documentation} \mbox{\Hypertarget{group__hmac__functions_gad159aa97f0f07e827e74b4b9a12b92ca}\label{group__hmac__functions_gad159aa97f0f07e827e74b4b9a12b92ca}} \index{HMAC Functions@{HMAC Functions}!decrypt\_to\_binary@{decrypt\_to\_binary}} \index{decrypt\_to\_binary@{decrypt\_to\_binary}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{decrypt\_to\_binary()}{decrypt\_to\_binary()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} Qore\+::decrypt\+\_\+to\+\_\+binary (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{alg, }\item[{data}]{data, }\item[{data}]{key, }\item[{data}]{iv = {\ttfamily \mbox{\hyperlink{group__cryptographic__constants_ga3e258a2c4d9e99eb43a97e7bf1dbe870}{Qore\+::\+Default\+IV}}}, }\item[{\+\_\+\+\_\+7\+\_\+ data}]{mac, }\item[{\+\_\+\+\_\+7\+\_\+ data}]{aad }\end{DoxyParamCaption})} Returns a binary value of decrypted data corresponding to the input arguments inluding the given \mbox{\hyperlink{group__crypto__transformations}{algorithm}}. \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{binary bin = \mbox{\hyperlink{group__hmac__functions_gad159aa97f0f07e827e74b4b9a12b92ca}{decrypt\_to\_binary}}(Qore::CRYPTO\_ALG\_BLOWFISH, data, key);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em alg} & the transformation algorithm; see \mbox{\hyperlink{group__crypto__transformations}{Cryptographic Stream Transformations}} for possible values \\ \hline {\em data} & the data to decrypt \\ \hline {\em key} & the encryption key \\ \hline {\em iv} & the initialization vector or cryptographic nonce \\ \hline {\em mac} & a message authentication code to be used to decrypt the message if required by the cryptographic algorithm, if not required, this argument is ignored \\ \hline {\em aad} & \href{https://www.cryptopp.com/wiki/ADATA}{\texttt{ Additional Authenticated Data}}; if the cryptographic algorithm does not support AAD, then this argument is ignored\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a binary value of decrypted data corresponding to the input arguments \end{DoxyReturn} \begin{DoxyExceptions}{Exceptions} {\em DECRYPT-\/\+ERROR} & unknown decryption algorithm; error with the decryption algorithm (ex\+: invalid key)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{group__hmac__functions_ga94bc9698c368c32987d7207096806df1}{Qore\+::decrypt\+\_\+to\+\_\+string()}} \item \mbox{\hyperlink{group__hmac__functions_ga7141b56ffa6c5a4f8c9c58f788f33780}{Qore\+::encrypt()}} \item \mbox{\hyperlink{group__hmac__functions_gae431528555553d236bad69b9ccacb428}{Qore\+::get\+\_\+crypto\+\_\+info()}} \item \mbox{\hyperlink{group__hmac__functions_ga913932d6120f9ea1e3918168fb204976}{Qore\+::get\+\_\+decryptor()}} \item \mbox{\hyperlink{group__hmac__functions_ga6e67ba0396d70cd012f7c46c7562b81f}{Qore\+::get\+\_\+encryptor()}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxyNote}{Note} If Qore is compiled with Open\+SSL 3+, it will use dynamic lookups of all ciphers known to the Open\+SSL library, otherwise it tried to match the cipher with known ciphers at compile time; use \mbox{\hyperlink{group__digest__algorithms_ga908829ccad7e4dc9def95d0d7ba7d898}{Cipher\+Map}} for a list of known ciphers \end{DoxyNote} \begin{DoxySince}{Since} Qore 0.\+8.\+13 \end{DoxySince} \mbox{\Hypertarget{group__hmac__functions_ga94bc9698c368c32987d7207096806df1}\label{group__hmac__functions_ga94bc9698c368c32987d7207096806df1}} \index{HMAC Functions@{HMAC Functions}!decrypt\_to\_string@{decrypt\_to\_string}} \index{decrypt\_to\_string@{decrypt\_to\_string}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{decrypt\_to\_string()}{decrypt\_to\_string()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::decrypt\+\_\+to\+\_\+string (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{alg, }\item[{data}]{data, }\item[{data}]{key, }\item[{data}]{iv = {\ttfamily \mbox{\hyperlink{group__cryptographic__constants_ga3e258a2c4d9e99eb43a97e7bf1dbe870}{Qore\+::\+Default\+IV}}}, }\item[{\+\_\+\+\_\+7\+\_\+ data}]{mac, }\item[{\+\_\+\+\_\+7\+\_\+ data}]{aad, }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{encoding }\end{DoxyParamCaption})} Returns a string of decrypted data corresponding to the input arguments inluding the given \mbox{\hyperlink{group__crypto__transformations}{algorithm}}. \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{string str = \mbox{\hyperlink{group__hmac__functions_ga94bc9698c368c32987d7207096806df1}{decrypt\_to\_string}}(Qore::CRYPTO\_ALG\_BLOWFISH, data, key);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em alg} & the transformation algorithm; see \mbox{\hyperlink{group__crypto__transformations}{Cryptographic Stream Transformations}} for possible values \\ \hline {\em data} & the data to decrypt \\ \hline {\em key} & the encryption key \\ \hline {\em iv} & the initialization vector or cryptographic nonce \\ \hline {\em mac} & a message authentication code to be used to decrypt the message if required by the cryptographic algorithm, if not required, this argument is ignored \\ \hline {\em aad} & \href{https://www.cryptopp.com/wiki/ADATA}{\texttt{ Additional Authenticated Data}}; if the cryptographic algorithm does not support AAD, then this argument is ignored \\ \hline {\em encoding} & the character encoding tag for the string return value; if not present, the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}} is assumed\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a string of decrypted data corresponding to the input arguments \end{DoxyReturn} \begin{DoxyExceptions}{Exceptions} {\em DECRYPT-\/\+ERROR} & unknown decryption algorithm; error with the decryption algorithm (ex\+: invalid key)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{group__hmac__functions_gad159aa97f0f07e827e74b4b9a12b92ca}{Qore\+::decrypt\+\_\+to\+\_\+binary()}} \item \mbox{\hyperlink{group__hmac__functions_ga7141b56ffa6c5a4f8c9c58f788f33780}{Qore\+::encrypt()}} \item \mbox{\hyperlink{group__hmac__functions_gae431528555553d236bad69b9ccacb428}{Qore\+::get\+\_\+crypto\+\_\+info()}} \item \mbox{\hyperlink{group__hmac__functions_ga913932d6120f9ea1e3918168fb204976}{Qore\+::get\+\_\+decryptor()}} \item \mbox{\hyperlink{group__hmac__functions_ga6e67ba0396d70cd012f7c46c7562b81f}{Qore\+::get\+\_\+encryptor()}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxyNote}{Note} If Qore is compiled with Open\+SSL 3+, it will use dynamic lookups of all ciphers known to the Open\+SSL library, otherwise it tried to match the cipher with known ciphers at compile time; use \mbox{\hyperlink{group__digest__algorithms_ga908829ccad7e4dc9def95d0d7ba7d898}{Cipher\+Map}} for a list of known ciphers \end{DoxyNote} \begin{DoxySince}{Since} Qore 0.\+8.\+13 \end{DoxySince} \mbox{\Hypertarget{group__hmac__functions_gaefc09e78e7bccccf7bc3629e4e86c9e2}\label{group__hmac__functions_gaefc09e78e7bccccf7bc3629e4e86c9e2}} \index{HMAC Functions@{HMAC Functions}!digest@{digest}} \index{digest@{digest}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{digest()}{digest()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} Qore\+::digest (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{digest, }\item[{data}]{data }\end{DoxyParamCaption})} Returns the digest of the supplied arguments as a binary value. \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{binary bin = \mbox{\hyperlink{group__hmac__functions_gaefc09e78e7bccccf7bc3629e4e86c9e2}{digest}}(\textcolor{stringliteral}{"{}md2"{}}, \textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns }} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em digest} & the digest to use; for supported digests, see \mbox{\hyperlink{group__digest__algorithms_ga08088b7c0d1162c80782a6dbd8fa05a7}{Digest\+Map}} \\ \hline {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} the binary value of the digest \end{DoxyReturn} \begin{DoxyExceptions}{Exceptions} {\em DIGEST-\/\+ERROR} & unknown digest \\ \hline {\em DIGEST-\/\+CALCULATION-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxyNote}{Note} If Qore is compiled with Open\+SSL 3+, it will use dynamic lookups of all digests known to the Open\+SSL library, otherwise it tried to match the digest with known digests at compile time; use \mbox{\hyperlink{group__digest__algorithms_ga08088b7c0d1162c80782a6dbd8fa05a7}{Digest\+Map}} for a list of known digests \end{DoxyNote} \begin{DoxySince}{Since} Qore 0.\+9.\+3 \end{DoxySince} \mbox{\Hypertarget{group__hmac__functions_ga3a75abdcf6815bd9c15ae55f5d8f0cc7}\label{group__hmac__functions_ga3a75abdcf6815bd9c15ae55f5d8f0cc7}} \index{HMAC Functions@{HMAC Functions}!DSS1\_hmac@{DSS1\_hmac}} \index{DSS1\_hmac@{DSS1\_hmac}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{DSS1\_hmac()}{DSS1\_hmac()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+DSS1\+\_\+hmac (\begin{DoxyParamCaption}\item[{data}]{data, }\item[{data}]{key }\end{DoxyParamCaption})} Returns the DSS1 (SHA-\/1 and \href{http://en.wikipedia.org/wiki/Digital_Signature_Algorithm}{\texttt{ DSA}}) based HMAC of the supplied argument as a hex string. \begin{DoxyParams}{Parameters} {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments \\ \hline {\em key} & a secret passphrase/key\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hex string of the digest (ex\+: {\ttfamily \char`\"{}37a3cc73159aa129b0eb22bbdf4b9309d389f629\char`\"{}}) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{string str = \mbox{\hyperlink{group__hmac__functions_ga3a75abdcf6815bd9c15ae55f5d8f0cc7}{DSS1\_hmac}}(\textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}}, \textcolor{stringliteral}{"{}a key"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns "{}37a3cc73159aa129b0eb22bbdf4b9309d389f629"{}}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} this digest algorithm is considered outdated and is included for backwards-\/compatibility only when Qore is built with an older openssl library \end{DoxyNote} \begin{DoxyExceptions}{Exceptions} {\em DSS1-\/\+HMAC-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxySeeAlso} \mbox{\Hypertarget{group__hmac__functions_gaca49d7d4e9a7999b7b11ffa734d98cf3}\label{group__hmac__functions_gaca49d7d4e9a7999b7b11ffa734d98cf3}} \index{HMAC Functions@{HMAC Functions}!DSS\_hmac@{DSS\_hmac}} \index{DSS\_hmac@{DSS\_hmac}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{DSS\_hmac()}{DSS\_hmac()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+DSS\+\_\+hmac (\begin{DoxyParamCaption}\item[{data}]{data, }\item[{data}]{key }\end{DoxyParamCaption})} Returns the DSS (SHA-\/0 and \href{http://en.wikipedia.org/wiki/Digital_Signature_Algorithm}{\texttt{ DSA}}) based HMAC of the supplied argument as a hex string. \begin{DoxyParams}{Parameters} {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments \\ \hline {\em key} & a secret passphrase/key\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hex string of the digest (ex\+: {\ttfamily \char`\"{}37a3cc73159aa129b0eb22bbdf4b9309d389f629\char`\"{}}) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{string str = \mbox{\hyperlink{group__hmac__functions_gaca49d7d4e9a7999b7b11ffa734d98cf3}{DSS\_hmac}}(\textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}}, \textcolor{stringliteral}{"{}a key"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns "{}37a3cc73159aa129b0eb22bbdf4b9309d389f629"{}}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} this digest algorithm is considered outdated and is included for backwards-\/compatibility only when Qore is built with an older openssl library \end{DoxyNote} \begin{DoxyExceptions}{Exceptions} {\em DSS-\/\+HMAC-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxySeeAlso} \mbox{\Hypertarget{group__hmac__functions_ga7141b56ffa6c5a4f8c9c58f788f33780}\label{group__hmac__functions_ga7141b56ffa6c5a4f8c9c58f788f33780}} \index{HMAC Functions@{HMAC Functions}!encrypt@{encrypt}} \index{encrypt@{encrypt}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{encrypt()}{encrypt()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} Qore\+::encrypt (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{alg, }\item[{data}]{data, }\item[{data}]{key, }\item[{data}]{iv = {\ttfamily \mbox{\hyperlink{group__cryptographic__constants_ga3e258a2c4d9e99eb43a97e7bf1dbe870}{Qore\+::\+Default\+IV}}}, }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} $>$}]{mac, }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{mac\+\_\+size, }\item[{\+\_\+\+\_\+7\+\_\+ data}]{aad }\end{DoxyParamCaption})} Returns a binary value of encrypted data corresponding to the input arguments inluding the given \mbox{\hyperlink{group__crypto__transformations}{algorithm}}. \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{binary bin = \mbox{\hyperlink{group__hmac__functions_ga7141b56ffa6c5a4f8c9c58f788f33780}{encrypt}}(Qore::CRYPTO\_ALG\_BLOWFISH, data, key);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em alg} & the transformation algorithm; see \mbox{\hyperlink{group__crypto__transformations}{Cryptographic Stream Transformations}} for possible values \\ \hline {\em data} & the data to encrypt \\ \hline {\em key} & the encryption key \\ \hline {\em iv} & the initialization vector or cryptographic nonce \\ \hline {\em mac} & a reference to a \mbox{\hyperlink{data_type_declarations_binary_type}{binary}} lvalue that will store the \href{https://en.wikipedia.org/wiki/Message_authentication_code}{\texttt{ Message Authentication Code (MAC)}} when the transformation is closed, if the algorithm produces one; it is not an error to provide a reference here for cryptographic algorithms that do not generate a MAC, however in such cases, nothing will be written to the reference; in case this argument is passed, the {\itshape mac\+\_\+size} argument must also be passed or a {\ttfamily MAC-\/\+ERROR} exception will be thrown \\ \hline {\em mac\+\_\+size} & number of bytes of the MAC to return; this value must be non-\/negative and less than 4096 or a {\ttfamily MAC-\/\+ERROR} exception will be thrown \\ \hline {\em aad} & \href{https://www.cryptopp.com/wiki/ADATA}{\texttt{ Additional Authenticated Data}}; if the cryptographic algorithm does not support AAD, then this argument is ignored\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a binary value of encrypted data corresponding to the input arguments \end{DoxyReturn} \begin{DoxyExceptions}{Exceptions} {\em MAC-\/\+ERROR} & this exception is thrown if the {\itshape mac\+\_\+size} argument is passed but no {\itshape mac} argument or vice-\/versa or if the {\itshape mac\+\_\+size} argument is negative or greater than 4096 bytes \\ \hline {\em ENCRYPT-\/\+ERROR} & unknown encryption algorithm; error with the encryption algorithm (ex\+: invalid key size)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{group__hmac__functions_gad159aa97f0f07e827e74b4b9a12b92ca}{Qore\+::decrypt\+\_\+to\+\_\+binary()}} \item \mbox{\hyperlink{group__hmac__functions_ga94bc9698c368c32987d7207096806df1}{Qore\+::decrypt\+\_\+to\+\_\+string()}} \item \mbox{\hyperlink{group__hmac__functions_gae431528555553d236bad69b9ccacb428}{Qore\+::get\+\_\+crypto\+\_\+info()}} \item \mbox{\hyperlink{group__hmac__functions_ga913932d6120f9ea1e3918168fb204976}{Qore\+::get\+\_\+decryptor()}} \item \mbox{\hyperlink{group__hmac__functions_ga6e67ba0396d70cd012f7c46c7562b81f}{Qore\+::get\+\_\+encryptor()}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxyNote}{Note} If Qore is compiled with Open\+SSL 3+, it will use dynamic lookups of all ciphers known to the Open\+SSL library, otherwise it tried to match the cipher with known ciphers at compile time; use \mbox{\hyperlink{group__digest__algorithms_ga908829ccad7e4dc9def95d0d7ba7d898}{Cipher\+Map}} for a list of known ciphers \end{DoxyNote} \begin{DoxySince}{Since} Qore 0.\+8.\+13 \end{DoxySince} \mbox{\Hypertarget{group__hmac__functions_ga814c4d87e71a361d804daed88f5b7e97}\label{group__hmac__functions_ga814c4d87e71a361d804daed88f5b7e97}} \index{HMAC Functions@{HMAC Functions}!get\_cipher\_info@{get\_cipher\_info}} \index{get\_cipher\_info@{get\_cipher\_info}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{get\_cipher\_info()}{get\_cipher\_info()}} {\footnotesize\ttfamily \+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$auto$>$ Qore\+::get\+\_\+cipher\+\_\+info (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{cipher }\end{DoxyParamCaption})} Returns information about the given cipher or \mbox{\hyperlink{basic_data_types_NOTHING}{NOTHING}} if the cipher is unknown. \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em cipher} & the cipher to look up\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hash with information about the cipher or \mbox{\hyperlink{basic_data_types_NOTHING}{NOTHING}} if the cipher is unknown \end{DoxyReturn} \begin{DoxyNote}{Note} If Qore is compiled with Open\+SSL 3+, it will use dynamic lookups of all ciphers known to the Open\+SSL library, otherwise it tried to match the cipher with known ciphers at compile time; use \mbox{\hyperlink{group__digest__algorithms_ga908829ccad7e4dc9def95d0d7ba7d898}{Cipher\+Map}} for a list of known ciphers \end{DoxyNote} \begin{DoxyExceptions}{Exceptions} {\em ENCODING-\/\+CONVERSION-\/\+ERROR} & this error is thrown if the string cannot be converted to the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}}\\ \hline \end{DoxyExceptions} \begin{DoxySince}{Since} Qore 1.\+4.\+0 \end{DoxySince} \mbox{\Hypertarget{group__hmac__functions_gae431528555553d236bad69b9ccacb428}\label{group__hmac__functions_gae431528555553d236bad69b9ccacb428}} \index{HMAC Functions@{HMAC Functions}!get\_crypto\_info@{get\_crypto\_info}} \index{get\_crypto\_info@{get\_crypto\_info}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{get\_crypto\_info()}{get\_crypto\_info()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga0231dbb472dd230310af7c7c34f56e92}{hash}}$<$auto$>$ Qore\+::get\+\_\+crypto\+\_\+info (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Returns a hash of information about each cryptographic algorithmn supported by the current build of Qore. \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{hash h = \mbox{\hyperlink{group__hmac__functions_gae431528555553d236bad69b9ccacb428}{get\_crypto\_info}}();} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyReturn}{Returns} a hash of information about each cryptographic algorithmn supported by the current build of Qore; keys are algorithm names, values are hashes with the following keys\+: \begin{DoxyItemize} \item {\ttfamily key\+\_\+len\+:} the minimum required length of the cryptographic key; if 0 it means that the cipher takes a variable key length \item {\ttfamily iv\+\_\+len\+:} the minimum required lengh of the initialization vector or nonce; if 0 it means that the initialization vector can be of any length (note that initialization vector or nonce is always optional); -\/1 means that the algorithm does not support (ignores) initialization vectors \item {\ttfamily type\+:} either {\ttfamily \char`\"{}\+GCM\char`\"{}} for \href{https://en.wikipedia.org/wiki/Galois/Counter_Mode}{\texttt{ Galois Counter Mode}} (meaning that the cipher accepts AAD and produces / requires a \href{https://en.wikipedia.org/wiki/Message_authentication_code}{\texttt{ Message Authentication Code (MAC)}} for encryption / decryption, respectively) or {\ttfamily \char`\"{}\+CBC\char`\"{}} for \href{http://en.wikipedia.org/wiki/Cipher_block_chaining\#Cipher-block_chaining_.28CBC.29}{\texttt{ Cipher Block Chaining}} (meaning that the cipher does not support AAD or a MAC) \end{DoxyItemize} \end{DoxyReturn} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{group__hmac__functions_gad159aa97f0f07e827e74b4b9a12b92ca}{Qore\+::decrypt\+\_\+to\+\_\+binary()}} \item \mbox{\hyperlink{group__hmac__functions_ga94bc9698c368c32987d7207096806df1}{Qore\+::decrypt\+\_\+to\+\_\+string()}} \item \mbox{\hyperlink{group__hmac__functions_ga7141b56ffa6c5a4f8c9c58f788f33780}{Qore\+::encrypt()}} \item \mbox{\hyperlink{group__hmac__functions_ga913932d6120f9ea1e3918168fb204976}{Qore\+::get\+\_\+decryptor()}} \item \mbox{\hyperlink{group__hmac__functions_ga6e67ba0396d70cd012f7c46c7562b81f}{Qore\+::get\+\_\+encryptor()}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxySince}{Since} Qore 0.\+8.\+13 \end{DoxySince} \mbox{\Hypertarget{group__hmac__functions_ga913932d6120f9ea1e3918168fb204976}\label{group__hmac__functions_ga913932d6120f9ea1e3918168fb204976}} \index{HMAC Functions@{HMAC Functions}!get\_decryptor@{get\_decryptor}} \index{get\_decryptor@{get\_decryptor}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{get\_decryptor()}{get\_decryptor()}} {\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_transform}{Transform}} Qore\+::get\+\_\+decryptor (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{alg, }\item[{data}]{key, }\item[{data}]{iv = {\ttfamily \mbox{\hyperlink{group__cryptographic__constants_ga3e258a2c4d9e99eb43a97e7bf1dbe870}{Qore\+::\+Default\+IV}}}, }\item[{\+\_\+\+\_\+7\+\_\+ data}]{mac, }\item[{\+\_\+\+\_\+7\+\_\+ data}]{aad }\end{DoxyParamCaption})} Returns a \mbox{\hyperlink{class_qore_1_1_transform}{Transform}} object for decrypting data using the given \mbox{\hyperlink{group__crypto__transformations}{algorithm}} for use with \mbox{\hyperlink{class_qore_1_1_transform_input_stream}{Transform\+Input\+Stream}} and \mbox{\hyperlink{class_qore_1_1_transform_output_stream}{Transform\+Output\+Stream}}. \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{class_qore_1_1_file_output_stream}{Qore::FileOutputStream}} of(\textcolor{stringliteral}{"{}my-\/file.txt.enc"{}});} \DoxyCodeLine{\mbox{\hyperlink{class_qore_1_1_transform_output_stream}{Qore::TransformOutputStream}} ts(of, \mbox{\hyperlink{group__hmac__functions_ga913932d6120f9ea1e3918168fb204976}{get\_decryptor}}(\mbox{\hyperlink{group__crypto__transformations_ga537286d57ff4a0326f427e8d513cbfb0}{Qore::CRYPTO\_ALG\_BLOWFISH}}, key));} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em alg} & the transformation algorithm; see \mbox{\hyperlink{group__crypto__transformations}{Cryptographic Stream Transformations}} for possible values \\ \hline {\em key} & the encryption key \\ \hline {\em iv} & the initialization vector \\ \hline {\em mac} & a message authentication code to be used to decrypt the message if required by the cryptographic algorithm, if not required, this argument is ignored \\ \hline {\em aad} & \href{https://www.cryptopp.com/wiki/ADATA}{\texttt{ Additional Authenticated Data}}; if the cryptographic algorithm does not support AAD, then this argument is ignored\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a \mbox{\hyperlink{class_qore_1_1_transform}{Transform}} object for decrypting data using the given \mbox{\hyperlink{group__crypto__transformations}{algorithm}} for use with \mbox{\hyperlink{class_qore_1_1_transform_input_stream}{Transform\+Input\+Stream}} and \mbox{\hyperlink{class_qore_1_1_transform_output_stream}{Transform\+Output\+Stream}} \end{DoxyReturn} \begin{DoxyExceptions}{Exceptions} {\em DECRYPT-\/\+ERROR} & unknown encryption algorithm; error decrypting the data\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{group__hmac__functions_gad159aa97f0f07e827e74b4b9a12b92ca}{Qore\+::decrypt\+\_\+to\+\_\+binary()}} \item \mbox{\hyperlink{group__hmac__functions_ga94bc9698c368c32987d7207096806df1}{Qore\+::decrypt\+\_\+to\+\_\+string()}} \item \mbox{\hyperlink{group__hmac__functions_ga7141b56ffa6c5a4f8c9c58f788f33780}{Qore\+::encrypt()}} \item \mbox{\hyperlink{group__hmac__functions_gae431528555553d236bad69b9ccacb428}{Qore\+::get\+\_\+crypto\+\_\+info()}} \item \mbox{\hyperlink{group__hmac__functions_ga6e67ba0396d70cd012f7c46c7562b81f}{Qore\+::get\+\_\+encryptor()}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxyNote}{Note} If Qore is compiled with Open\+SSL 3+, it will use dynamic lookups of all ciphers known to the Open\+SSL library, otherwise it tried to match the cipher with known ciphers at compile time; use \mbox{\hyperlink{group__digest__algorithms_ga908829ccad7e4dc9def95d0d7ba7d898}{Cipher\+Map}} for a list of known ciphers \end{DoxyNote} \begin{DoxySince}{Since} Qore 0.\+8.\+13 \end{DoxySince} \mbox{\Hypertarget{group__hmac__functions_ga227c4f084f2cffee4c466989d68a1fe3}\label{group__hmac__functions_ga227c4f084f2cffee4c466989d68a1fe3}} \index{HMAC Functions@{HMAC Functions}!get\_digests@{get\_digests}} \index{get\_digests@{get\_digests}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{get\_digests()}{get\_digests()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_ga4b52a1cbee7a3aed46c32cb0a938629c}{list}}$<$\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}$>$ Qore\+::get\+\_\+digests (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})} Returns a list of supported digest algorithms for \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_CONSTANT}{CONSTANT}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\textcolor{comment}{\# make a map of supported digests}} \DoxyCodeLine{hash digest\_map = map \{\$1: \textcolor{keyword}{True}\}, \mbox{\hyperlink{group__hmac__functions_ga227c4f084f2cffee4c466989d68a1fe3}{get\_digests}}();} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyReturn}{Returns} a list of supported digest algorithms for \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxyReturn} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxySeeAlso} \begin{DoxyNote}{Note} This function returns the same value as the keys of \mbox{\hyperlink{group__digest__algorithms_ga08088b7c0d1162c80782a6dbd8fa05a7}{Digest\+Map}} \end{DoxyNote} \begin{DoxySince}{Since} Qore 0.\+9.\+3 \end{DoxySince} \mbox{\Hypertarget{group__hmac__functions_ga6e67ba0396d70cd012f7c46c7562b81f}\label{group__hmac__functions_ga6e67ba0396d70cd012f7c46c7562b81f}} \index{HMAC Functions@{HMAC Functions}!get\_encryptor@{get\_encryptor}} \index{get\_encryptor@{get\_encryptor}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{get\_encryptor()}{get\_encryptor()}} {\footnotesize\ttfamily \mbox{\hyperlink{class_qore_1_1_transform}{Transform}} Qore\+::get\+\_\+encryptor (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{alg, }\item[{data}]{key, }\item[{data}]{iv = {\ttfamily \mbox{\hyperlink{group__cryptographic__constants_ga3e258a2c4d9e99eb43a97e7bf1dbe870}{Qore\+::\+Default\+IV}}}, }\item[{\+\_\+\+\_\+7\+\_\+ reference$<$ \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} $>$}]{mac, }\item[{\+\_\+\+\_\+7\+\_\+ \mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{mac\+\_\+size, }\item[{\+\_\+\+\_\+7\+\_\+ data}]{aad }\end{DoxyParamCaption})} Returns a \mbox{\hyperlink{class_qore_1_1_transform}{Transform}} object for encrypting data using the given \mbox{\hyperlink{group__crypto__transformations}{algorithm}} for use with \mbox{\hyperlink{class_qore_1_1_transform_input_stream}{Transform\+Input\+Stream}} and \mbox{\hyperlink{class_qore_1_1_transform_output_stream}{Transform\+Output\+Stream}}. \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\mbox{\hyperlink{class_qore_1_1_file_output_stream}{Qore::FileOutputStream}} of(\textcolor{stringliteral}{"{}my-\/file.txt.enc"{}});} \DoxyCodeLine{\mbox{\hyperlink{class_qore_1_1_transform_output_stream}{Qore::TransformOutputStream}} ts(of, \mbox{\hyperlink{group__hmac__functions_ga6e67ba0396d70cd012f7c46c7562b81f}{get\_encryptor}}(\mbox{\hyperlink{group__crypto__transformations_ga537286d57ff4a0326f427e8d513cbfb0}{Qore::CRYPTO\_ALG\_BLOWFISH}}, key));} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em alg} & the transformation algorithm; see \mbox{\hyperlink{group__crypto__transformations}{Cryptographic Stream Transformations}} for possible values \\ \hline {\em key} & the encryption key \\ \hline {\em iv} & the initialization vector \\ \hline {\em mac} & a reference to a \mbox{\hyperlink{data_type_declarations_binary_type}{binary}} lvalue that will store the \href{https://en.wikipedia.org/wiki/Message_authentication_code}{\texttt{ Message Authentication Code (MAC)}} when the transformation is closed, if the algorithm produces one; it is not an error to provide a reference here for cryptographic algorithms that do not generate a MAC, however in such cases, nothing will be written to the reference; in case this argument is passed, the {\itshape mac\+\_\+size} argument must also be passed or a {\ttfamily MAC-\/\+ERROR} exception will be thrown \\ \hline {\em mac\+\_\+size} & number of bytes of the MAC to return; this value must be non-\/negative and less than 4096 or a {\ttfamily MAC-\/\+ERROR} exception will be thrown \\ \hline {\em aad} & \href{https://www.cryptopp.com/wiki/ADATA}{\texttt{ Additional Authenticated Data}}; if the cryptographic algorithm does not support AAD, then this argument is ignored\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a \mbox{\hyperlink{class_qore_1_1_transform}{Transform}} object for encrypting data using the given \mbox{\hyperlink{group__crypto__transformations}{algorithm}} for use with \mbox{\hyperlink{class_qore_1_1_transform_input_stream}{Transform\+Input\+Stream}} and \mbox{\hyperlink{class_qore_1_1_transform_output_stream}{Transform\+Output\+Stream}} \end{DoxyReturn} \begin{DoxyExceptions}{Exceptions} {\em MAC-\/\+ERROR} & this exception is thrown if the {\itshape mac\+\_\+size} argument is passed but no {\itshape mac} argument or vice-\/versa or if the {\itshape mac\+\_\+size} argument is negative or greater than 4096 bytes \\ \hline {\em ENCRYPT-\/\+ERROR} & unknown encryption algorithm; error with the encryption algorithm (ex\+: invalid key size)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{group__hmac__functions_gad159aa97f0f07e827e74b4b9a12b92ca}{Qore\+::decrypt\+\_\+to\+\_\+binary()}} \item \mbox{\hyperlink{group__hmac__functions_ga94bc9698c368c32987d7207096806df1}{Qore\+::decrypt\+\_\+to\+\_\+string()}} \item \mbox{\hyperlink{group__hmac__functions_ga7141b56ffa6c5a4f8c9c58f788f33780}{Qore\+::encrypt()}} \item \mbox{\hyperlink{group__hmac__functions_gae431528555553d236bad69b9ccacb428}{Qore\+::get\+\_\+crypto\+\_\+info()}} \item \mbox{\hyperlink{group__hmac__functions_ga913932d6120f9ea1e3918168fb204976}{Qore\+::get\+\_\+decryptor()}} \end{DoxyItemize} \end{DoxySeeAlso} \begin{DoxyNote}{Note} If Qore is compiled with Open\+SSL 3+, it will use dynamic lookups of all ciphers known to the Open\+SSL library, otherwise it tried to match the cipher with known ciphers at compile time; use \mbox{\hyperlink{group__digest__algorithms_ga908829ccad7e4dc9def95d0d7ba7d898}{Cipher\+Map}} for a list of known ciphers \end{DoxyNote} \begin{DoxySince}{Since} Qore 0.\+8.\+13 \end{DoxySince} \mbox{\Hypertarget{group__hmac__functions_gaa5fd7a2cd931d0390368d54865602c20}\label{group__hmac__functions_gaa5fd7a2cd931d0390368d54865602c20}} \index{HMAC Functions@{HMAC Functions}!get\_random\_bytes@{get\_random\_bytes}} \index{get\_random\_bytes@{get\_random\_bytes}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{get\_random\_bytes()}{get\_random\_bytes()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} Qore\+::get\+\_\+random\+\_\+bytes (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_ga2de8717e92c5f97ccc6511f6062d6502}{int}}}]{size }\end{DoxyParamCaption})} returns a binary value of random bytes using openssl \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{\textcolor{comment}{\# return 16 bytes of random data}} \DoxyCodeLine{binary b = \mbox{\hyperlink{group__hmac__functions_gaa5fd7a2cd931d0390368d54865602c20}{get\_random\_bytes}}(16);} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em size} & the number of bytes in the output; if this value is not positive, an empty binary value is returned\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a binary value of random bytes using openssl \end{DoxyReturn} \begin{DoxyExceptions}{Exceptions} {\em GET-\/\+RANDOM-\/\+BYTES-\/\+ERROR} & thrown if there is an error generating or acquiring random data (ex\+: not enough entropy; random function not supported by the current random method)\\ \hline \end{DoxyExceptions} \begin{DoxySince}{Since} Qore 0.\+8.\+13 \end{DoxySince} \mbox{\Hypertarget{group__hmac__functions_ga38c09b0428e8bb11c20fe56ee6353fac}\label{group__hmac__functions_ga38c09b0428e8bb11c20fe56ee6353fac}} \index{HMAC Functions@{HMAC Functions}!has\_digest@{has\_digest}} \index{has\_digest@{has\_digest}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{has\_digest()}{has\_digest()}} {\footnotesize\ttfamily bool Qore\+::has\+\_\+digest (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{digest }\end{DoxyParamCaption})} Returns \mbox{\hyperlink{basic_data_types_True}{True}} if the given digest is supported, \mbox{\hyperlink{basic_data_types_False}{False}} if not. \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em digest} & the digest to check\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} \mbox{\hyperlink{basic_data_types_True}{True}} if the given digest is supported, \mbox{\hyperlink{basic_data_types_False}{False}} if not \end{DoxyReturn} \begin{DoxyNote}{Note} If Qore is compiled with Open\+SSL 3+, it will use dynamic lookups of all digests known to the Open\+SSL library, otherwise it tried to match the digest with known digests at compile time; use \mbox{\hyperlink{group__digest__algorithms_ga08088b7c0d1162c80782a6dbd8fa05a7}{Digest\+Map}} for a list of known digests \end{DoxyNote} \begin{DoxyExceptions}{Exceptions} {\em ENCODING-\/\+CONVERSION-\/\+ERROR} & this error is thrown if the string cannot be converted to the \mbox{\hyperlink{character_encoding_default_encoding}{default character encoding}}\\ \hline \end{DoxyExceptions} \begin{DoxySince}{Since} Qore 1.\+4.\+0 \end{DoxySince} \mbox{\Hypertarget{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}\label{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}} \index{HMAC Functions@{HMAC Functions}!hmac@{hmac}} \index{hmac@{hmac}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{hmac()}{hmac()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gaf11c7f5c43ced1e9b95bd2270ee87ed9}{binary}} Qore\+::hmac (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}}}]{digest, }\item[{data}]{data, }\item[{data}]{key }\end{DoxyParamCaption})} Returns the digest-\/based HMAC of the supplied arguments as a binary value. \begin{DoxyParagraph}{Code Flags\+:} \mbox{\hyperlink{code_flags_RET_VALUE_ONLY}{RET\+\_\+\+VALUE\+\_\+\+ONLY}} \end{DoxyParagraph} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{binary bin = \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac}}(\textcolor{stringliteral}{"{}ripemd160"{}}, \textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}}, \textcolor{stringliteral}{"{}a key"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns <4bca70bca1601aba57624eeb2606535cb12f2079>}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em digest} & the digest to use; for supported digests, see \mbox{\hyperlink{group__digest__algorithms_ga08088b7c0d1162c80782a6dbd8fa05a7}{Digest\+Map}} \\ \hline {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments \\ \hline {\em key} & a secret passphrase/key\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} the binary value of the HMAC \end{DoxyReturn} \begin{DoxyExceptions}{Exceptions} {\em DIGEST-\/\+ERROR} & unknown digest \\ \hline {\em HMAC-\/\+CALCULATION-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__digest__algorithms_ga08088b7c0d1162c80782a6dbd8fa05a7}{Digest\+Map}} \end{DoxySeeAlso} \begin{DoxyNote}{Note} If Qore is compiled with Open\+SSL 3+, it will use dynamic lookups of all digests known to the Open\+SSL library, otherwise it tried to match the digest with known digests at compile time; use \mbox{\hyperlink{group__digest__algorithms_ga08088b7c0d1162c80782a6dbd8fa05a7}{Digest\+Map}} for a list of known digests \end{DoxyNote} \begin{DoxySince}{Since} Qore 0.\+9.\+3 \end{DoxySince} \mbox{\Hypertarget{group__hmac__functions_gaeebc2ad2c2cf99a33e42c98344fceb49}\label{group__hmac__functions_gaeebc2ad2c2cf99a33e42c98344fceb49}} \index{HMAC Functions@{HMAC Functions}!MD2\_hmac@{MD2\_hmac}} \index{MD2\_hmac@{MD2\_hmac}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{MD2\_hmac()}{MD2\_hmac()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+MD2\+\_\+hmac (\begin{DoxyParamCaption}\item[{data}]{data, }\item[{data}]{key }\end{DoxyParamCaption})} Returns the \href{http://en.wikipedia.org/wiki/MD2_(cryptography)}{\texttt{ MD2}} based HMAC of the supplied argument as a hex string. \begin{DoxyParagraph}{Platform Availability\+:} \mbox{\hyperlink{group__option__constants_ga2e1b34b0ee0e76d35143adeaac8211ba}{Qore\+::\+Option\+::\+HAVE\+\_\+\+MD2}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments \\ \hline {\em key} & a secret passphrase/key\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hex string of the digest (ex\+: {\ttfamily \char`\"{}27f5f17500b408e97643403ea8ef1413\char`\"{}}) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{string str = \mbox{\hyperlink{group__hmac__functions_gaeebc2ad2c2cf99a33e42c98344fceb49}{MD2\_hmac}}(\textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}}, \textcolor{stringliteral}{"{}a key"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns "{}27f5f17500b408e97643403ea8ef1413"{}}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyExceptions}{Exceptions} {\em MD2-\/\+HMAC-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \begin{DoxyItemize} \item \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \item \mbox{\hyperlink{group__digest__functions_ga92b9dd3feb62a72720cfad39f79dd3e7}{MD2\+\_\+bin()}} \end{DoxyItemize} \end{DoxySeeAlso} \mbox{\Hypertarget{group__hmac__functions_gaa1f5781d25e14ad544f76db36111e1f3}\label{group__hmac__functions_gaa1f5781d25e14ad544f76db36111e1f3}} \index{HMAC Functions@{HMAC Functions}!MD4\_hmac@{MD4\_hmac}} \index{MD4\_hmac@{MD4\_hmac}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{MD4\_hmac()}{MD4\_hmac()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+MD4\+\_\+hmac (\begin{DoxyParamCaption}\item[{data}]{data, }\item[{data}]{key }\end{DoxyParamCaption})} Returns the \href{http://en.wikipedia.org/wiki/MD4}{\texttt{ MD4}} based HMAC of the supplied argument as a hex string. \begin{DoxyParams}{Parameters} {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments \\ \hline {\em key} & a secret passphrase/key\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hex string of the digest (ex\+: {\ttfamily \char`\"{}053d084f321a3886e60166ebd9609ce1\char`\"{}}) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{string str = \mbox{\hyperlink{group__hmac__functions_gaa1f5781d25e14ad544f76db36111e1f3}{MD4\_hmac}}(\textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}}, \textcolor{stringliteral}{"{}a key"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns "{}053d084f321a3886e60166ebd9609ce1"{}}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyExceptions}{Exceptions} {\em MD4-\/\+HMAC-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxySeeAlso} \mbox{\Hypertarget{group__hmac__functions_gac4dc67bcb217ae04c43a9df9d14d0a85}\label{group__hmac__functions_gac4dc67bcb217ae04c43a9df9d14d0a85}} \index{HMAC Functions@{HMAC Functions}!MD5\_hmac@{MD5\_hmac}} \index{MD5\_hmac@{MD5\_hmac}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{MD5\_hmac()}{MD5\_hmac()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+MD5\+\_\+hmac (\begin{DoxyParamCaption}\item[{data}]{data, }\item[{data}]{key }\end{DoxyParamCaption})} Returns the \href{http://en.wikipedia.org/wiki/MD5}{\texttt{ MD5}} based HMAC of the supplied argument as a hex string. \begin{DoxyParams}{Parameters} {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments \\ \hline {\em key} & a secret passphrase/key\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hex string of the digest (ex\+: {\ttfamily \char`\"{}87505c6164aaf6ca6315233902a01ef4\char`\"{}}) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{string str = \mbox{\hyperlink{group__hmac__functions_gac4dc67bcb217ae04c43a9df9d14d0a85}{MD5\_hmac}}(\textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}}, \textcolor{stringliteral}{"{}a key"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns "{}87505c6164aaf6ca6315233902a01ef4"{}}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} the MD5 algorithm is not collision-\/resistant; it\textquotesingle{}s recommended to use another hash algorithm (like SHA-\/256) if cryptographic security is important \end{DoxyNote} \begin{DoxyExceptions}{Exceptions} {\em MD5-\/\+HMAC-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxySeeAlso} \mbox{\Hypertarget{group__hmac__functions_ga2839943cdcce18a3e5ef63ac5c728eb2}\label{group__hmac__functions_ga2839943cdcce18a3e5ef63ac5c728eb2}} \index{HMAC Functions@{HMAC Functions}!MDC2\_hmac@{MDC2\_hmac}} \index{MDC2\_hmac@{MDC2\_hmac}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{MDC2\_hmac()}{MDC2\_hmac()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+MDC2\+\_\+hmac (\begin{DoxyParamCaption}\item[{data}]{data, }\item[{data}]{key }\end{DoxyParamCaption})} Returns the \href{http://en.wikipedia.org/wiki/MDC2}{\texttt{ MDC2}} based HMAC of the supplied argument as a hex string. \begin{DoxyParams}{Parameters} {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments \\ \hline {\em key} & a secret passphrase/key\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hex string of the digest (ex\+: {\ttfamily \char`\"{}e0ef6a6803e58807c5db395e180a999c\char`\"{}}) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{string str = \mbox{\hyperlink{group__hmac__functions_ga2839943cdcce18a3e5ef63ac5c728eb2}{MDC2\_hmac}}(\textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}}, \textcolor{stringliteral}{"{}a key"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns "{}e0ef6a6803e58807c5db395e180a999c"{}}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyExceptions}{Exceptions} {\em MDC2-\/\+HMAC-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxySeeAlso} \mbox{\Hypertarget{group__hmac__functions_gadecee6c469e1b4dade49924bd68c7ae4}\label{group__hmac__functions_gadecee6c469e1b4dade49924bd68c7ae4}} \index{HMAC Functions@{HMAC Functions}!RIPEMD160\_hmac@{RIPEMD160\_hmac}} \index{RIPEMD160\_hmac@{RIPEMD160\_hmac}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{RIPEMD160\_hmac()}{RIPEMD160\_hmac()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+RIPEMD160\+\_\+hmac (\begin{DoxyParamCaption}\item[{data}]{data, }\item[{data}]{key }\end{DoxyParamCaption})} Returns the \href{http://en.wikipedia.org/wiki/RIPEMD}{\texttt{ RIPEMD}} based HMAC of the supplied argument as a hex string. \begin{DoxyParams}{Parameters} {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments \\ \hline {\em key} & a secret passphrase/key\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hex string of the digest (ex\+: {\ttfamily \char`\"{}4bca70bca1601aba57624eeb2606535cb12f2079\char`\"{}}) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{string str = \mbox{\hyperlink{group__hmac__functions_gadecee6c469e1b4dade49924bd68c7ae4}{RIPEMD160\_hmac}}(\textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}}, \textcolor{stringliteral}{"{}a key"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns "{}4bca70bca1601aba57624eeb2606535cb12f2079"{}}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyExceptions}{Exceptions} {\em RIPEMD160-\/\+HMAC-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxySeeAlso} \mbox{\Hypertarget{group__hmac__functions_gaf76d63347ffb70de4202a771ad767e2d}\label{group__hmac__functions_gaf76d63347ffb70de4202a771ad767e2d}} \index{HMAC Functions@{HMAC Functions}!SHA1\_hmac@{SHA1\_hmac}} \index{SHA1\_hmac@{SHA1\_hmac}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{SHA1\_hmac()}{SHA1\_hmac()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+SHA1\+\_\+hmac (\begin{DoxyParamCaption}\item[{data}]{data, }\item[{data}]{key }\end{DoxyParamCaption})} Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\texttt{ SHA1}} based HMAC of the supplied argument as a hex string. \begin{DoxyParams}{Parameters} {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments \\ \hline {\em key} & a secret passphrase/key\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hex string of the digest (ex\+: {\ttfamily \char`\"{}37a3cc73159aa129b0eb22bbdf4b9309d389f629\char`\"{}}) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{string str = \mbox{\hyperlink{group__hmac__functions_gaf76d63347ffb70de4202a771ad767e2d}{SHA1\_hmac}}(\textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}}, \textcolor{stringliteral}{"{}a key"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns "{}37a3cc73159aa129b0eb22bbdf4b9309d389f629"{}}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} Cryptographic weaknesses were discovered in SHA-\/1, and the standard was no longer approved for most cryptographic uses after 2010. \end{DoxyNote} \begin{DoxyExceptions}{Exceptions} {\em SHA1-\/\+HMAC-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxySeeAlso} \mbox{\Hypertarget{group__hmac__functions_gaf78d06e41607133b0c053a544b2e92b7}\label{group__hmac__functions_gaf78d06e41607133b0c053a544b2e92b7}} \index{HMAC Functions@{HMAC Functions}!SHA224\_hmac@{SHA224\_hmac}} \index{SHA224\_hmac@{SHA224\_hmac}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{SHA224\_hmac()}{SHA224\_hmac()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+SHA224\+\_\+hmac (\begin{DoxyParamCaption}\item[{data}]{data, }\item[{data}]{key }\end{DoxyParamCaption})} Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\texttt{ SHA224}} based HMAC of the supplied argument as a hex string. \begin{DoxyParagraph}{Platform Availability\+:} \mbox{\hyperlink{group__option__constants_gac2b845ff7b7e953d0ab2c7c0e33154fe}{Qore\+::\+Option\+::\+HAVE\+\_\+\+SHA224}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments \\ \hline {\em key} & a secret passphrase/key\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hex string of the digest (ex\+: {\ttfamily \char`\"{}fad5667fa5aa412044555b7e077fced62372fe9c6ce20815609da12c\char`\"{}}) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{string str = \mbox{\hyperlink{group__hmac__functions_gaf78d06e41607133b0c053a544b2e92b7}{SHA224\_hmac}}(\textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}}, \textcolor{stringliteral}{"{}a key"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns "{}fad5667fa5aa412044555b7e077fced62372fe9c6ce20815609da12c"{}}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyExceptions}{Exceptions} {\em SHA224-\/\+HMAC-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxySeeAlso} \mbox{\Hypertarget{group__hmac__functions_gaf8c329f83b4b31f2e88b5342d487480b}\label{group__hmac__functions_gaf8c329f83b4b31f2e88b5342d487480b}} \index{HMAC Functions@{HMAC Functions}!SHA256\_hmac@{SHA256\_hmac}} \index{SHA256\_hmac@{SHA256\_hmac}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{SHA256\_hmac()}{SHA256\_hmac()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+SHA256\+\_\+hmac (\begin{DoxyParamCaption}\item[{data}]{data, }\item[{data}]{key }\end{DoxyParamCaption})} Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\texttt{ SHA256}} based HMAC of the supplied argument as a hex string. \begin{DoxyParagraph}{Platform Availability\+:} \mbox{\hyperlink{group__option__constants_ga8bbafb0df946db4960ec53f1739352c2}{Qore\+::\+Option\+::\+HAVE\+\_\+\+SHA256}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments \\ \hline {\em key} & a secret passphrase/key\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hex string of the digest (ex\+: {\ttfamily \char`\"{}1c90c21e227712b62019ff831f34cba22c2e70f1a902651ef69a70705ee0f754\char`\"{}}) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{string str = \mbox{\hyperlink{group__hmac__functions_gaf8c329f83b4b31f2e88b5342d487480b}{SHA256\_hmac}}(\textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}}, \textcolor{stringliteral}{"{}a key"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns "{}1c90c21e227712b62019ff831f34cba22c2e70f1a902651ef69a70705ee0f754"{}}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyExceptions}{Exceptions} {\em SHA256-\/\+HMAC-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxySeeAlso} \mbox{\Hypertarget{group__hmac__functions_gac028eb1719043ec2461239a0c1de2654}\label{group__hmac__functions_gac028eb1719043ec2461239a0c1de2654}} \index{HMAC Functions@{HMAC Functions}!SHA384\_hmac@{SHA384\_hmac}} \index{SHA384\_hmac@{SHA384\_hmac}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{SHA384\_hmac()}{SHA384\_hmac()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+SHA384\+\_\+hmac (\begin{DoxyParamCaption}\item[{data}]{data, }\item[{data}]{key }\end{DoxyParamCaption})} Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\texttt{ SHA384}} based HMAC of the supplied argument as a hex string. \begin{DoxyParagraph}{Platform Availability\+:} \mbox{\hyperlink{group__option__constants_gaefa59259c4fcbe89eaf1efa5364e0420}{Qore\+::\+Option\+::\+HAVE\+\_\+\+SHA384}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments \\ \hline {\em key} & a secret passphrase/key\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hex string of the digest (ex\+: {\ttfamily \char`\"{}e2c253c6dcb050990b4da3cee95cd7b227f43388fa8116f476f59395af295d0d3bb7156ab2fcd0663b0500249a7a0865\char`\"{}}) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{string str = \mbox{\hyperlink{group__hmac__functions_gac028eb1719043ec2461239a0c1de2654}{SHA384\_hmac}}(\textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}}, \textcolor{stringliteral}{"{}a key"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns "{}e2c253c6dcb050990b4da3cee95cd7b227f43388fa8116f476f59395af295d0d3bb7156ab2fcd0663b0500249a7a0865"{}}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyExceptions}{Exceptions} {\em SHA384-\/\+HMAC-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxySeeAlso} \mbox{\Hypertarget{group__hmac__functions_ga492a23df5cb989d296c96a2076ef6f8f}\label{group__hmac__functions_ga492a23df5cb989d296c96a2076ef6f8f}} \index{HMAC Functions@{HMAC Functions}!SHA512\_hmac@{SHA512\_hmac}} \index{SHA512\_hmac@{SHA512\_hmac}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{SHA512\_hmac()}{SHA512\_hmac()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+SHA512\+\_\+hmac (\begin{DoxyParamCaption}\item[{data}]{data, }\item[{data}]{key }\end{DoxyParamCaption})} Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\texttt{ SHA512}} based HMAC of the supplied argument as a hex string. \begin{DoxyParagraph}{Platform Availability\+:} \mbox{\hyperlink{group__option__constants_ga361d12136d30719ba4861fd892ee022f}{Qore\+::\+Option\+::\+HAVE\+\_\+\+SHA512}} \end{DoxyParagraph} \begin{DoxyParams}{Parameters} {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments \\ \hline {\em key} & a secret passphrase/key\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hex string of the digest (ex\+: {\ttfamily \char`\"{}8dcefd7ea3f90ff1c822b5e9547fc36edf78c3e4ce13d47510a212a406bdda1a4094e7ea5ade90e1c736e204d331a814520eba49f3d074e2c261208de07264f6\char`\"{}}) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{string str = \mbox{\hyperlink{group__hmac__functions_ga492a23df5cb989d296c96a2076ef6f8f}{SHA512\_hmac}}(\textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}}, \textcolor{stringliteral}{"{}a key"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns "{}8dcefd7ea3f90ff1c822b5e9547fc36edf78c3e4ce13d47510a212a406bdda1a4094e7ea5ade90e1c736e204d331a814520eba49f3d074e2c261208de07264f6"{}}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyExceptions}{Exceptions} {\em SHA512-\/\+HMAC-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxySeeAlso} \mbox{\Hypertarget{group__hmac__functions_gac5ffb694353caa752b069e7b6d018fca}\label{group__hmac__functions_gac5ffb694353caa752b069e7b6d018fca}} \index{HMAC Functions@{HMAC Functions}!SHA\_hmac@{SHA\_hmac}} \index{SHA\_hmac@{SHA\_hmac}!HMAC Functions@{HMAC Functions}} \doxysubsubsection{\texorpdfstring{SHA\_hmac()}{SHA\_hmac()}} {\footnotesize\ttfamily \mbox{\hyperlink{group__type__conversion__functions_gacf16b4126b795f4b6933ef3425cadae3}{string}} Qore\+::\+SHA\+\_\+hmac (\begin{DoxyParamCaption}\item[{data}]{data, }\item[{data}]{key }\end{DoxyParamCaption})} Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\texttt{ SHA}} based HMAC of the supplied argument as a hex string. \begin{DoxyParams}{Parameters} {\em data} & the data to process and produce a digest for; the trailing null character is not included in the digest when processing string arguments \\ \hline {\em key} & a secret passphrase/key\\ \hline \end{DoxyParams} \begin{DoxyReturn}{Returns} a hex string of the digest (ex\+: {\ttfamily \char`\"{}0ad47c8d36dc4606d52f7e4cbd144ef2fda492a0\char`\"{}}) \end{DoxyReturn} \begin{DoxyParagraph}{Example\+:} \begin{DoxyCode}{0} \DoxyCodeLine{string str = \mbox{\hyperlink{group__hmac__functions_gac5ffb694353caa752b069e7b6d018fca}{SHA\_hmac}}(\textcolor{stringliteral}{"{}Hello There This is a Test -\/ 1234567890"{}}, \textcolor{stringliteral}{"{}a key"{}});} \DoxyCodeLine{\textcolor{comment}{\# returns "{}0ad47c8d36dc4606d52f7e4cbd144ef2fda492a0"{}}} \end{DoxyCode} \end{DoxyParagraph} \begin{DoxyNote}{Note} SHA/\+SHA0 was withdrawn shortly after publication due to an undisclosed \char`\"{}significant flaw\char`\"{} and replaced by the slightly revised version SHA-\/1. \end{DoxyNote} \begin{DoxyExceptions}{Exceptions} {\em SHA-\/\+HMAC-\/\+ERROR} & error calculating digest (should not normally happen)\\ \hline \end{DoxyExceptions} \begin{DoxySeeAlso}{See also} \mbox{\hyperlink{group__hmac__functions_gaf88021aec5a7048984b0a0e5ce21733d}{hmac()}} \end{DoxySeeAlso}