\hypertarget{group__hmac__functions}{}\section{H\+M\+A\+C Functions}
\label{group__hmac__functions}\index{H\+M\+A\+C Functions@{H\+M\+A\+C Functions}}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
string \hyperlink{group__hmac__functions_ga273ae6d3d7e9dfd45155cf7589882a7c}{Qore\+::\+D\+S\+S1\+\_\+hmac} (data data, string key)
\begin{DoxyCompactList}\small\item\em Returns the D\+S\+S1 (S\+H\+A-\/1 and \href{http://en.wikipedia.org/wiki/Digital_Signature_Algorithm}{\tt D\+S\+A}) based H\+M\+A\+C of the supplied argument as a hex string. \end{DoxyCompactList}\item 
string \hyperlink{group__hmac__functions_gae0e62ec8220f67c57160ee5e724e38bb}{Qore\+::\+D\+S\+S\+\_\+hmac} (data data, string key)
\begin{DoxyCompactList}\small\item\em Returns the D\+S\+S (S\+H\+A-\/0 and \href{http://en.wikipedia.org/wiki/Digital_Signature_Algorithm}{\tt D\+S\+A}) based H\+M\+A\+C of the supplied argument as a hex string. \end{DoxyCompactList}\item 
string \hyperlink{group__hmac__functions_ga0c3c030ee810d1e4545eb60224ef2f51}{Qore\+::\+M\+D2\+\_\+hmac} (data data, string key)
\begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/MD2_(cryptography)}{\tt M\+D2} based H\+M\+A\+C of the supplied argument as a hex string. \end{DoxyCompactList}\item 
string \hyperlink{group__hmac__functions_ga95007a24ccb4b71b6717db94203e724c}{Qore\+::\+M\+D4\+\_\+hmac} (data data, string key)
\begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/MD4}{\tt M\+D4} based H\+M\+A\+C of the supplied argument as a hex string. \end{DoxyCompactList}\item 
string \hyperlink{group__hmac__functions_ga9380e7a0aa8ae7f425ef671587db17d4}{Qore\+::\+M\+D5\+\_\+hmac} (data data, string key)
\begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/MD5}{\tt M\+D5} based H\+M\+A\+C of the supplied argument as a hex string. \end{DoxyCompactList}\item 
string \hyperlink{group__hmac__functions_ga41a1ac452966138a244902fb8560fa09}{Qore\+::\+M\+D\+C2\+\_\+hmac} (data data, string key)
\begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/MDC2}{\tt M\+D\+C2} based H\+M\+A\+C of the supplied argument as a hex string. \end{DoxyCompactList}\item 
string \hyperlink{group__hmac__functions_ga8f1bb6dc984eb6e33f3dfa241d06c5b0}{Qore\+::\+R\+I\+P\+E\+M\+D160\+\_\+hmac} (data data, string key)
\begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/RIPEMD}{\tt R\+I\+P\+E\+M\+D} based H\+M\+A\+C of the supplied argument as a hex string. \end{DoxyCompactList}\item 
string \hyperlink{group__hmac__functions_ga6c39c8f198bb7e29677cb1eaeaeaa7a0}{Qore\+::\+S\+H\+A1\+\_\+hmac} (data data, string key)
\begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\tt S\+H\+A1} based H\+M\+A\+C of the supplied argument as a hex string. \end{DoxyCompactList}\item 
string \hyperlink{group__hmac__functions_gad6f20664a81729d7804251fb98f08b54}{Qore\+::\+S\+H\+A224\+\_\+hmac} (data data, string key)
\begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\tt S\+H\+A224} based H\+M\+A\+C of the supplied argument as a hex string. \end{DoxyCompactList}\item 
string \hyperlink{group__hmac__functions_ga3d31d997ed70f1dd9b29ff500c2c5491}{Qore\+::\+S\+H\+A256\+\_\+hmac} (data data, string key)
\begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\tt S\+H\+A256} based H\+M\+A\+C of the supplied argument as a hex string. \end{DoxyCompactList}\item 
string \hyperlink{group__hmac__functions_ga1330d317d741818ad6bf3029149c2f27}{Qore\+::\+S\+H\+A384\+\_\+hmac} (data data, string key)
\begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\tt S\+H\+A384} based H\+M\+A\+C of the supplied argument as a hex string. \end{DoxyCompactList}\item 
string \hyperlink{group__hmac__functions_ga99d77cc0d6dd639906f9ade1ac36f6a0}{Qore\+::\+S\+H\+A512\+\_\+hmac} (data data, string key)
\begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\tt S\+H\+A512} based H\+M\+A\+C of the supplied argument as a hex string. \end{DoxyCompactList}\item 
string \hyperlink{group__hmac__functions_ga4d2572f1c39720a82db19770835d555b}{Qore\+::\+S\+H\+A\+\_\+hmac} (data data, string key)
\begin{DoxyCompactList}\small\item\em Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\tt S\+H\+A} based H\+M\+A\+C of the supplied argument as a hex string. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Qore's cryptography support is provided by the Open\+S\+S\+L library.

In cryptography, a keyed-\/hash message authentication code (H\+M\+A\+C) is a specific construction for calculating a message authentication code (M\+A\+C) involving a cryptographic hash function in combination with a secret cryptographic key. As with any M\+A\+C, it may be used to simultaneously verify both the data integrity and the authentication of a message. Any cryptographic hash function, such as M\+D5 or S\+H\+A-\/1, may be used in the calculation of an H\+M\+A\+C; the resulting M\+A\+C algorithm is termed H\+M\+A\+C-\/\+M\+D5 or H\+M\+A\+C-\/\+S\+H\+A1 accordingly. The cryptographic strength of the H\+M\+A\+C 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}{\tt Wikipedia's Hash-\/based message authentication code article}.

See also\+:
\begin{DoxyItemize}
\item \hyperlink{group__cryptographic__functions}{Crytographic Functions}
\item \hyperlink{group__digest__functions}{Digest (Hash) Functions}
\item \hyperlink{group__cryptographic__constants}{Crytographic Contants} 
\end{DoxyItemize}

\subsection{Function Documentation}
\hypertarget{group__hmac__functions_ga273ae6d3d7e9dfd45155cf7589882a7c}{}\index{H\+M\+A\+C Functions@{H\+M\+A\+C Functions}!D\+S\+S1\+\_\+hmac@{D\+S\+S1\+\_\+hmac}}
\index{D\+S\+S1\+\_\+hmac@{D\+S\+S1\+\_\+hmac}!H\+M\+A\+C Functions@{H\+M\+A\+C Functions}}
\subsubsection[{D\+S\+S1\+\_\+hmac}]{\setlength{\rightskip}{0pt plus 5cm}string Qore\+::\+D\+S\+S1\+\_\+hmac (
\begin{DoxyParamCaption}
\item[{data}]{data, }
\item[{string}]{key}
\end{DoxyParamCaption}
)}\label{group__hmac__functions_ga273ae6d3d7e9dfd45155cf7589882a7c}


Returns the D\+S\+S1 (S\+H\+A-\/1 and \href{http://en.wikipedia.org/wiki/Digital_Signature_Algorithm}{\tt D\+S\+A}) based H\+M\+A\+C 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}
my \textcolor{keywordtype}{string} $str = \hyperlink{group__hmac__functions_ga273ae6d3d7e9dfd45155cf7589882a7c}{DSS1\_hmac}(\textcolor{stringliteral}{"Hello There This is a Test - 1234567890"}, \textcolor{stringliteral}{"a key"});
\textcolor{preprocessor}{# returns "37a3cc73159aa129b0eb22bbdf4b9309d389f629"}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
this algorithm is considered outdated and is included for backwards-\/compatibility
\end{DoxyNote}

\begin{DoxyExceptions}{Exceptions}
{\em D\+S\+S1-\/\+H\+M\+A\+C-\/\+E\+R\+R\+O\+R} & error calculating digest (should not normally happen) \\
\hline
\end{DoxyExceptions}
\hypertarget{group__hmac__functions_gae0e62ec8220f67c57160ee5e724e38bb}{}\index{H\+M\+A\+C Functions@{H\+M\+A\+C Functions}!D\+S\+S\+\_\+hmac@{D\+S\+S\+\_\+hmac}}
\index{D\+S\+S\+\_\+hmac@{D\+S\+S\+\_\+hmac}!H\+M\+A\+C Functions@{H\+M\+A\+C Functions}}
\subsubsection[{D\+S\+S\+\_\+hmac}]{\setlength{\rightskip}{0pt plus 5cm}string Qore\+::\+D\+S\+S\+\_\+hmac (
\begin{DoxyParamCaption}
\item[{data}]{data, }
\item[{string}]{key}
\end{DoxyParamCaption}
)}\label{group__hmac__functions_gae0e62ec8220f67c57160ee5e724e38bb}


Returns the D\+S\+S (S\+H\+A-\/0 and \href{http://en.wikipedia.org/wiki/Digital_Signature_Algorithm}{\tt D\+S\+A}) based H\+M\+A\+C 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}
my \textcolor{keywordtype}{string} $str = \hyperlink{group__hmac__functions_gae0e62ec8220f67c57160ee5e724e38bb}{DSS\_hmac}(\textcolor{stringliteral}{"Hello There This is a Test - 1234567890"}, \textcolor{stringliteral}{"a key"});
\textcolor{preprocessor}{# returns "37a3cc73159aa129b0eb22bbdf4b9309d389f629"}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
this algorithm is considered outdated and is included for backwards-\/compatibility
\end{DoxyNote}

\begin{DoxyExceptions}{Exceptions}
{\em D\+S\+S-\/\+H\+M\+A\+C-\/\+E\+R\+R\+O\+R} & error calculating digest (should not normally happen) \\
\hline
\end{DoxyExceptions}
\hypertarget{group__hmac__functions_ga0c3c030ee810d1e4545eb60224ef2f51}{}\index{H\+M\+A\+C Functions@{H\+M\+A\+C Functions}!M\+D2\+\_\+hmac@{M\+D2\+\_\+hmac}}
\index{M\+D2\+\_\+hmac@{M\+D2\+\_\+hmac}!H\+M\+A\+C Functions@{H\+M\+A\+C Functions}}
\subsubsection[{M\+D2\+\_\+hmac}]{\setlength{\rightskip}{0pt plus 5cm}string Qore\+::\+M\+D2\+\_\+hmac (
\begin{DoxyParamCaption}
\item[{data}]{data, }
\item[{string}]{key}
\end{DoxyParamCaption}
)}\label{group__hmac__functions_ga0c3c030ee810d1e4545eb60224ef2f51}


Returns the \href{http://en.wikipedia.org/wiki/MD2_(cryptography)}{\tt M\+D2} based H\+M\+A\+C of the supplied argument as a hex string. 

\begin{DoxyParagraph}{Platform Availability\+:}
\hyperlink{group__option__constants_ga2e1b34b0ee0e76d35143adeaac8211ba}{Qore\+::\+Option\+::\+H\+A\+V\+E\+\_\+\+M\+D2}
\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}
my \textcolor{keywordtype}{string} $str = \hyperlink{group__hmac__functions_ga0c3c030ee810d1e4545eb60224ef2f51}{MD2\_hmac}(\textcolor{stringliteral}{"Hello There This is a Test - 1234567890"}, \textcolor{stringliteral}{"a key"});
\textcolor{preprocessor}{# returns "27f5f17500b408e97643403ea8ef1413"}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em M\+D2-\/\+H\+M\+A\+C-\/\+E\+R\+R\+O\+R} & error calculating digest (should not normally happen)\\
\hline
\end{DoxyExceptions}
\begin{DoxySeeAlso}{See also}
\hyperlink{group__digest__functions_ga92b9dd3feb62a72720cfad39f79dd3e7}{M\+D2\+\_\+bin()} 
\end{DoxySeeAlso}
\hypertarget{group__hmac__functions_ga95007a24ccb4b71b6717db94203e724c}{}\index{H\+M\+A\+C Functions@{H\+M\+A\+C Functions}!M\+D4\+\_\+hmac@{M\+D4\+\_\+hmac}}
\index{M\+D4\+\_\+hmac@{M\+D4\+\_\+hmac}!H\+M\+A\+C Functions@{H\+M\+A\+C Functions}}
\subsubsection[{M\+D4\+\_\+hmac}]{\setlength{\rightskip}{0pt plus 5cm}string Qore\+::\+M\+D4\+\_\+hmac (
\begin{DoxyParamCaption}
\item[{data}]{data, }
\item[{string}]{key}
\end{DoxyParamCaption}
)}\label{group__hmac__functions_ga95007a24ccb4b71b6717db94203e724c}


Returns the \href{http://en.wikipedia.org/wiki/MD4}{\tt M\+D4} based H\+M\+A\+C 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}
my \textcolor{keywordtype}{string} $str = \hyperlink{group__hmac__functions_ga95007a24ccb4b71b6717db94203e724c}{MD4\_hmac}(\textcolor{stringliteral}{"Hello There This is a Test - 1234567890"}, \textcolor{stringliteral}{"a key"});
\textcolor{preprocessor}{# returns "053d084f321a3886e60166ebd9609ce1"}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em M\+D4-\/\+H\+M\+A\+C-\/\+E\+R\+R\+O\+R} & error calculating digest (should not normally happen) \\
\hline
\end{DoxyExceptions}
\hypertarget{group__hmac__functions_ga9380e7a0aa8ae7f425ef671587db17d4}{}\index{H\+M\+A\+C Functions@{H\+M\+A\+C Functions}!M\+D5\+\_\+hmac@{M\+D5\+\_\+hmac}}
\index{M\+D5\+\_\+hmac@{M\+D5\+\_\+hmac}!H\+M\+A\+C Functions@{H\+M\+A\+C Functions}}
\subsubsection[{M\+D5\+\_\+hmac}]{\setlength{\rightskip}{0pt plus 5cm}string Qore\+::\+M\+D5\+\_\+hmac (
\begin{DoxyParamCaption}
\item[{data}]{data, }
\item[{string}]{key}
\end{DoxyParamCaption}
)}\label{group__hmac__functions_ga9380e7a0aa8ae7f425ef671587db17d4}


Returns the \href{http://en.wikipedia.org/wiki/MD5}{\tt M\+D5} based H\+M\+A\+C 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}
my \textcolor{keywordtype}{string} $str = \hyperlink{group__hmac__functions_ga9380e7a0aa8ae7f425ef671587db17d4}{MD5\_hmac}(\textcolor{stringliteral}{"Hello There This is a Test - 1234567890"}, \textcolor{stringliteral}{"a key"});
\textcolor{preprocessor}{# returns "87505c6164aaf6ca6315233902a01ef4"}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
the M\+D5 algorithm is not collision-\/resistant; it's recommended to use another hash algorithm (like S\+H\+A-\/256) if cryptographic security is important
\end{DoxyNote}

\begin{DoxyExceptions}{Exceptions}
{\em M\+D5-\/\+H\+M\+A\+C-\/\+E\+R\+R\+O\+R} & error calculating digest (should not normally happen) \\
\hline
\end{DoxyExceptions}
\hypertarget{group__hmac__functions_ga41a1ac452966138a244902fb8560fa09}{}\index{H\+M\+A\+C Functions@{H\+M\+A\+C Functions}!M\+D\+C2\+\_\+hmac@{M\+D\+C2\+\_\+hmac}}
\index{M\+D\+C2\+\_\+hmac@{M\+D\+C2\+\_\+hmac}!H\+M\+A\+C Functions@{H\+M\+A\+C Functions}}
\subsubsection[{M\+D\+C2\+\_\+hmac}]{\setlength{\rightskip}{0pt plus 5cm}string Qore\+::\+M\+D\+C2\+\_\+hmac (
\begin{DoxyParamCaption}
\item[{data}]{data, }
\item[{string}]{key}
\end{DoxyParamCaption}
)}\label{group__hmac__functions_ga41a1ac452966138a244902fb8560fa09}


Returns the \href{http://en.wikipedia.org/wiki/MDC2}{\tt M\+D\+C2} based H\+M\+A\+C 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}
my \textcolor{keywordtype}{string} $str = \hyperlink{group__hmac__functions_ga41a1ac452966138a244902fb8560fa09}{MDC2\_hmac}(\textcolor{stringliteral}{"Hello There This is a Test - 1234567890"}, \textcolor{stringliteral}{"a key"});
\textcolor{preprocessor}{# returns "e0ef6a6803e58807c5db395e180a999c"}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em M\+D\+C2-\/\+H\+M\+A\+C-\/\+E\+R\+R\+O\+R} & error calculating digest (should not normally happen) \\
\hline
\end{DoxyExceptions}
\hypertarget{group__hmac__functions_ga8f1bb6dc984eb6e33f3dfa241d06c5b0}{}\index{H\+M\+A\+C Functions@{H\+M\+A\+C Functions}!R\+I\+P\+E\+M\+D160\+\_\+hmac@{R\+I\+P\+E\+M\+D160\+\_\+hmac}}
\index{R\+I\+P\+E\+M\+D160\+\_\+hmac@{R\+I\+P\+E\+M\+D160\+\_\+hmac}!H\+M\+A\+C Functions@{H\+M\+A\+C Functions}}
\subsubsection[{R\+I\+P\+E\+M\+D160\+\_\+hmac}]{\setlength{\rightskip}{0pt plus 5cm}string Qore\+::\+R\+I\+P\+E\+M\+D160\+\_\+hmac (
\begin{DoxyParamCaption}
\item[{data}]{data, }
\item[{string}]{key}
\end{DoxyParamCaption}
)}\label{group__hmac__functions_ga8f1bb6dc984eb6e33f3dfa241d06c5b0}


Returns the \href{http://en.wikipedia.org/wiki/RIPEMD}{\tt R\+I\+P\+E\+M\+D} based H\+M\+A\+C 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}
my \textcolor{keywordtype}{string} $str = \hyperlink{group__hmac__functions_ga8f1bb6dc984eb6e33f3dfa241d06c5b0}{RIPEMD160\_hmac}(\textcolor{stringliteral}{"Hello There This is a Test - 1234567890"}, \textcolor{stringliteral}{"a key"});
\textcolor{preprocessor}{# returns "4bca70bca1601aba57624eeb2606535cb12f2079"}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em R\+I\+P\+E\+M\+D160-\/\+H\+M\+A\+C-\/\+E\+R\+R\+O\+R} & error calculating digest (should not normally happen) \\
\hline
\end{DoxyExceptions}
\hypertarget{group__hmac__functions_ga6c39c8f198bb7e29677cb1eaeaeaa7a0}{}\index{H\+M\+A\+C Functions@{H\+M\+A\+C Functions}!S\+H\+A1\+\_\+hmac@{S\+H\+A1\+\_\+hmac}}
\index{S\+H\+A1\+\_\+hmac@{S\+H\+A1\+\_\+hmac}!H\+M\+A\+C Functions@{H\+M\+A\+C Functions}}
\subsubsection[{S\+H\+A1\+\_\+hmac}]{\setlength{\rightskip}{0pt plus 5cm}string Qore\+::\+S\+H\+A1\+\_\+hmac (
\begin{DoxyParamCaption}
\item[{data}]{data, }
\item[{string}]{key}
\end{DoxyParamCaption}
)}\label{group__hmac__functions_ga6c39c8f198bb7e29677cb1eaeaeaa7a0}


Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\tt S\+H\+A1} based H\+M\+A\+C 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}
my \textcolor{keywordtype}{string} $str = \hyperlink{group__hmac__functions_ga6c39c8f198bb7e29677cb1eaeaeaa7a0}{SHA1\_hmac}(\textcolor{stringliteral}{"Hello There This is a Test - 1234567890"}, \textcolor{stringliteral}{"a key"});
\textcolor{preprocessor}{# returns "37a3cc73159aa129b0eb22bbdf4b9309d389f629"}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
Cryptographic weaknesses were discovered in S\+H\+A-\/1, and the standard was no longer approved for most cryptographic uses after 2010.
\end{DoxyNote}

\begin{DoxyExceptions}{Exceptions}
{\em S\+H\+A1-\/\+H\+M\+A\+C-\/\+E\+R\+R\+O\+R} & error calculating digest (should not normally happen) \\
\hline
\end{DoxyExceptions}
\hypertarget{group__hmac__functions_gad6f20664a81729d7804251fb98f08b54}{}\index{H\+M\+A\+C Functions@{H\+M\+A\+C Functions}!S\+H\+A224\+\_\+hmac@{S\+H\+A224\+\_\+hmac}}
\index{S\+H\+A224\+\_\+hmac@{S\+H\+A224\+\_\+hmac}!H\+M\+A\+C Functions@{H\+M\+A\+C Functions}}
\subsubsection[{S\+H\+A224\+\_\+hmac}]{\setlength{\rightskip}{0pt plus 5cm}string Qore\+::\+S\+H\+A224\+\_\+hmac (
\begin{DoxyParamCaption}
\item[{data}]{data, }
\item[{string}]{key}
\end{DoxyParamCaption}
)}\label{group__hmac__functions_gad6f20664a81729d7804251fb98f08b54}


Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\tt S\+H\+A224} based H\+M\+A\+C of the supplied argument as a hex string. 

\begin{DoxyParagraph}{Platform Availability\+:}
\hyperlink{group__option__constants_gac2b845ff7b7e953d0ab2c7c0e33154fe}{Qore\+::\+Option\+::\+H\+A\+V\+E\+\_\+\+S\+H\+A224}
\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}
my \textcolor{keywordtype}{string} $str = \hyperlink{group__hmac__functions_gad6f20664a81729d7804251fb98f08b54}{SHA224\_hmac}(\textcolor{stringliteral}{"Hello There This is a Test - 1234567890"}, \textcolor{stringliteral}{"a key"});
\textcolor{preprocessor}{# returns "fad5667fa5aa412044555b7e077fced62372fe9c6ce20815609da12c"}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+H\+A224-\/\+H\+M\+A\+C-\/\+E\+R\+R\+O\+R} & error calculating digest (should not normally happen) \\
\hline
\end{DoxyExceptions}
\hypertarget{group__hmac__functions_ga3d31d997ed70f1dd9b29ff500c2c5491}{}\index{H\+M\+A\+C Functions@{H\+M\+A\+C Functions}!S\+H\+A256\+\_\+hmac@{S\+H\+A256\+\_\+hmac}}
\index{S\+H\+A256\+\_\+hmac@{S\+H\+A256\+\_\+hmac}!H\+M\+A\+C Functions@{H\+M\+A\+C Functions}}
\subsubsection[{S\+H\+A256\+\_\+hmac}]{\setlength{\rightskip}{0pt plus 5cm}string Qore\+::\+S\+H\+A256\+\_\+hmac (
\begin{DoxyParamCaption}
\item[{data}]{data, }
\item[{string}]{key}
\end{DoxyParamCaption}
)}\label{group__hmac__functions_ga3d31d997ed70f1dd9b29ff500c2c5491}


Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\tt S\+H\+A256} based H\+M\+A\+C of the supplied argument as a hex string. 

\begin{DoxyParagraph}{Platform Availability\+:}
\hyperlink{group__option__constants_ga8bbafb0df946db4960ec53f1739352c2}{Qore\+::\+Option\+::\+H\+A\+V\+E\+\_\+\+S\+H\+A256}
\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}
my \textcolor{keywordtype}{string} $str = \hyperlink{group__hmac__functions_ga3d31d997ed70f1dd9b29ff500c2c5491}{SHA256\_hmac}(\textcolor{stringliteral}{"Hello There This is a Test - 1234567890"}, \textcolor{stringliteral}{"a key"});
\textcolor{preprocessor}{# returns "1c90c21e227712b62019ff831f34cba22c2e70f1a902651ef69a70705ee0f754"}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+H\+A256-\/\+H\+M\+A\+C-\/\+E\+R\+R\+O\+R} & error calculating digest (should not normally happen) \\
\hline
\end{DoxyExceptions}
\hypertarget{group__hmac__functions_ga1330d317d741818ad6bf3029149c2f27}{}\index{H\+M\+A\+C Functions@{H\+M\+A\+C Functions}!S\+H\+A384\+\_\+hmac@{S\+H\+A384\+\_\+hmac}}
\index{S\+H\+A384\+\_\+hmac@{S\+H\+A384\+\_\+hmac}!H\+M\+A\+C Functions@{H\+M\+A\+C Functions}}
\subsubsection[{S\+H\+A384\+\_\+hmac}]{\setlength{\rightskip}{0pt plus 5cm}string Qore\+::\+S\+H\+A384\+\_\+hmac (
\begin{DoxyParamCaption}
\item[{data}]{data, }
\item[{string}]{key}
\end{DoxyParamCaption}
)}\label{group__hmac__functions_ga1330d317d741818ad6bf3029149c2f27}


Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\tt S\+H\+A384} based H\+M\+A\+C of the supplied argument as a hex string. 

\begin{DoxyParagraph}{Platform Availability\+:}
\hyperlink{group__option__constants_gaefa59259c4fcbe89eaf1efa5364e0420}{Qore\+::\+Option\+::\+H\+A\+V\+E\+\_\+\+S\+H\+A384}
\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}
my \textcolor{keywordtype}{string} $str = \hyperlink{group__hmac__functions_ga1330d317d741818ad6bf3029149c2f27}{SHA384\_hmac}(\textcolor{stringliteral}{"Hello There This is a Test - 1234567890"}, \textcolor{stringliteral}{"a key"});
\textcolor{preprocessor}{# returns
       "e2c253c6dcb050990b4da3cee95cd7b227f43388fa8116f476f59395af295d0d3bb7156ab2fcd0663b0500249a7a0865"}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+H\+A384-\/\+H\+M\+A\+C-\/\+E\+R\+R\+O\+R} & error calculating digest (should not normally happen) \\
\hline
\end{DoxyExceptions}
\hypertarget{group__hmac__functions_ga99d77cc0d6dd639906f9ade1ac36f6a0}{}\index{H\+M\+A\+C Functions@{H\+M\+A\+C Functions}!S\+H\+A512\+\_\+hmac@{S\+H\+A512\+\_\+hmac}}
\index{S\+H\+A512\+\_\+hmac@{S\+H\+A512\+\_\+hmac}!H\+M\+A\+C Functions@{H\+M\+A\+C Functions}}
\subsubsection[{S\+H\+A512\+\_\+hmac}]{\setlength{\rightskip}{0pt plus 5cm}string Qore\+::\+S\+H\+A512\+\_\+hmac (
\begin{DoxyParamCaption}
\item[{data}]{data, }
\item[{string}]{key}
\end{DoxyParamCaption}
)}\label{group__hmac__functions_ga99d77cc0d6dd639906f9ade1ac36f6a0}


Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\tt S\+H\+A512} based H\+M\+A\+C of the supplied argument as a hex string. 

\begin{DoxyParagraph}{Platform Availability\+:}
\hyperlink{group__option__constants_ga361d12136d30719ba4861fd892ee022f}{Qore\+::\+Option\+::\+H\+A\+V\+E\+\_\+\+S\+H\+A512}
\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}
my \textcolor{keywordtype}{string} $str = \hyperlink{group__hmac__functions_ga99d77cc0d6dd639906f9ade1ac36f6a0}{SHA512\_hmac}(\textcolor{stringliteral}{"Hello There This is a Test - 1234567890"}, \textcolor{stringliteral}{"a key"});
\textcolor{preprocessor}{# returns
       "8dcefd7ea3f90ff1c822b5e9547fc36edf78c3e4ce13d47510a212a406bdda1a4094e7ea5ade90e1c736e204d331a814520eba49f3d074e2c261208de07264f6"}
\end{DoxyCode}

\end{DoxyParagraph}

\begin{DoxyExceptions}{Exceptions}
{\em S\+H\+A512-\/\+H\+M\+A\+C-\/\+E\+R\+R\+O\+R} & error calculating digest (should not normally happen) \\
\hline
\end{DoxyExceptions}
\hypertarget{group__hmac__functions_ga4d2572f1c39720a82db19770835d555b}{}\index{H\+M\+A\+C Functions@{H\+M\+A\+C Functions}!S\+H\+A\+\_\+hmac@{S\+H\+A\+\_\+hmac}}
\index{S\+H\+A\+\_\+hmac@{S\+H\+A\+\_\+hmac}!H\+M\+A\+C Functions@{H\+M\+A\+C Functions}}
\subsubsection[{S\+H\+A\+\_\+hmac}]{\setlength{\rightskip}{0pt plus 5cm}string Qore\+::\+S\+H\+A\+\_\+hmac (
\begin{DoxyParamCaption}
\item[{data}]{data, }
\item[{string}]{key}
\end{DoxyParamCaption}
)}\label{group__hmac__functions_ga4d2572f1c39720a82db19770835d555b}


Returns the \href{http://en.wikipedia.org/wiki/Secure_Hash_Algorithm}{\tt S\+H\+A} based H\+M\+A\+C 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}
my \textcolor{keywordtype}{string} $str = \hyperlink{group__hmac__functions_ga4d2572f1c39720a82db19770835d555b}{SHA\_hmac}(\textcolor{stringliteral}{"Hello There This is a Test - 1234567890"}, \textcolor{stringliteral}{"a key"});
\textcolor{preprocessor}{# returns "0ad47c8d36dc4606d52f7e4cbd144ef2fda492a0"}
\end{DoxyCode}

\end{DoxyParagraph}
\begin{DoxyNote}{Note}
S\+H\+A/\+S\+H\+A0 was withdrawn shortly after publication due to an undisclosed \char`\"{}significant flaw\char`\"{} and replaced by the slightly revised version S\+H\+A-\/1.
\end{DoxyNote}

\begin{DoxyExceptions}{Exceptions}
{\em S\+H\+A-\/\+H\+M\+A\+C-\/\+E\+R\+R\+O\+R} & error calculating digest (should not normally happen) \\
\hline
\end{DoxyExceptions}
