
#use wml::openssl-macros area=docs page=RSA_blinding_on

<title>Documents, RSA_blinding_on(3)</title>

<h1>RSA_blinding_on(3)</h1>

#use wml::imp::generic

{:
## What's this? [[s|(<STRONG>[^<].+?)</A>(</STRONG><DD>)|$1$2|sg]]
[[s|<P>\s+<P>|<P>|sg]]
[[s|<P>\s+</|</|sg]]
[[s|<DD>\s*<DT>|<DD>&nbsp;<DT>|sg]]
[[s|<DD>\s*</DL>|<DD>&nbsp;</DL>|sg]]
[[s|\[|&#91;|sg]]
[[s|\]|&#93;|sg]]

<!-- INDEX BEGIN -->

<UL>

	<LI><A HREF="#NAME">NAME</A>
	<LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
	<LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
	<LI><A HREF="#RETURN_VALUES">RETURN VALUES</A>
	<LI><A HREF="#SEE_ALSO">SEE ALSO</A>
	<LI><A HREF="#HISTORY">HISTORY</A>
</UL>
<!-- INDEX END -->

<HR>
<P>
<HR>
<H1><A NAME="NAME">NAME</A></H1>
<P>
RSA_blinding_on, RSA_blinding_off - protect the RSA operation from timing
attacks

</P>
<P>
<HR>
<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
<PRE> #include &lt;openssl/rsa.h&gt;
</PRE>
<PRE> int RSA_blinding_on(RSA *rsa, BN_CTX *ctx);
</PRE>
<PRE> void RSA_blinding_off(RSA *rsa);
</PRE>
<P>
<HR>
<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
<P>
RSA is vulnerable to timing attacks. In a setup where attackers can measure
the time of RSA decryption or signature operations, blinding must be used
to protect the RSA operation from that attack.

</P>
<P>
<CODE>RSA_blinding_on()</CODE> turns blinding on for key <STRONG>rsa</STRONG> and generates a random blinding factor. <STRONG>ctx</STRONG> is <STRONG>NULL</STRONG> or a pre-allocated and initialized <STRONG>BN_CTX</STRONG>. The random number generator must be seeded prior to calling
<CODE>RSA_blinding_on().</CODE>

</P>
<P>
<CODE>RSA_blinding_off()</CODE> turns blinding off and frees the memory
used for the blinding factor.

</P>
<P>
<HR>
<H1><A NAME="RETURN_VALUES">RETURN VALUES</A></H1>
<P>
<CODE>RSA_blinding_on()</CODE> returns 1 on success, and 0 if an error
occurred.

</P>
<P>
<CODE>RSA_blinding_off()</CODE> returns no value.

</P>
<P>
<HR>
<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
<P>
<A HREF="../crypto/rsa.html#">rsa(3)</A>, <A HREF="../crypto/rand.html#">rand(3)</A>



</P>
<P>
<HR>
<H1><A NAME="HISTORY">HISTORY</A></H1>
<P>
<CODE>RSA_blinding_on()</CODE> and <CODE>RSA_blinding_off()</CODE> appeared
in SSLeay 0.9.0.

</P>
:}


