<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[wolfSSL - Embedded SSL Library — wolfSSL and Block Ciphers]]></title>
		<link>https://www.wolfssl.com/forums/topic60-wolfssl-and-block-ciphers.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic60.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in wolfSSL and Block Ciphers.]]></description>
		<lastBuildDate>Thu, 13 Jan 2011 23:19:25 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[wolfSSL and Block Ciphers]]></title>
			<link>https://www.wolfssl.com/forums/post81.html#p81</link>
			<description><![CDATA[<p>[Migrated from SourceForge forums]</p><p><strong>weejamx</strong><br />(2009-05-12 21:15:23 UTC)</p><p>Hi,</p><p>I wanted to know if I can use Block Ciphers with wolfSSL like:</p><p>#include &lt;openssl/ssl.h&gt;<br />#include &lt;openssl/evp.h&gt;</p><p>int encrypt(char* in_data, char* out_data, int data_len)<br />{<br />&nbsp; &nbsp; &nbsp;DES_ECB_Encryption enc;</p><p>&nbsp; &nbsp; &nbsp;enc.SetKey(key, 256);<br />&nbsp; &nbsp; &nbsp;enc.Process(out_data, in_data, data_len);<br />}</p><p>or it&#039;s just a YaSSL feature? Do I miss something?</p><p>Thank you.<br />weejamx </p><br /><p><strong>weejamx</strong><br />(2009-05-12 21:18:24 UTC)</p><p>*****More info****** </p><p>the fact is: it not reconize `DES_ECB_Encryption&#039;. what should i must include? this is not wrapped by evp.h? In fact I did not sse any of this in the header, Do I should include it from the ctaocrypt/include?</p><p>I don&#039;t see any IV support too... Im lost there is no Decryptfinal for random plaintext size? Do I did&#039;nt understood basic stuff?</p><br /><p><strong>touska</strong> <br />(2009-05-12 21:31:06 UTC)</p><p>While both yaSSL and wolfSSL have an OpenSSL compatibility layer for SSL functionality, each have their own crypto API.&nbsp; yaSSL&#039;s is in C++ and wolfSSL&#039;s is in C.</p><p>To use wolfSSL&#039;s crypto look at wolfcrypt/test/test.c for examples, e.g., DES can be used with:</p><p>Des enc;</p><p>Des_SetKey()<br />Des_CbcEncrypt()</p><p>the header is &lt;des3.h&gt; which includes both DES and 3DES.</p><br /><p><strong>touska</strong> <br />(2009-05-12 21:42:56 UTC)</p><p>ECB mode doesn&#039;t have an IV and shouldn&#039;t ever be used.&nbsp; CBC mode, which wolfSSL supports, does have an IV and it is set during the SetKey call.</p><p>Block padding at the end of plaintext is typically an application issue.&nbsp; For example, SSL uses a few different types and sets it up itself, it then calls wolfCrypt to actually encrypt the data. </p><br /><p><strong>weejamx</strong><br />(2009-05-12 21:58:38 UTC)</p><p>Thank for the fast answer, I will be able to continue like if it was a google search, thanks a lot, I will try to figure it out.</p><br /><p><strong>weejamx</strong> <br />(2009-05-13 22:31:00 UTC)</p><p>By: Todd Ouska (touska) - 2009-05-12 17:42:</p><p>&quot;Block padding at the end of plaintext is typically an application issue. For example, SSL uses a few different types and sets it up itself, it then calls CTaoCrypt to actually encrypt the data.&quot;</p><p>I would like to use the same logic as wolfSSL. Can you easily point me in the wolfSSL source where it is done? I searched a lot, I tried also many stuff to padding.</p><p>I also tried the ARC4 Stream Cipher with almost the same code as test.c, but the functions output nothing in output bytes or output length, but it&#039;s not important for this post.</p><p>Thanks</p><br /><p><strong>touska</strong> <br />(2009-05-13 23:01:20 UTC)</p><p>BuildMessage() in cyassl_int.c is a good place to look.&nbsp; There you will see padding in action, take a look at the pad variable.</p><p>There is no output length for a stream cipher, the output length is the input length.&nbsp; Are you not passing an input length?&nbsp; Take a closer look at the example.</p><br /><p><strong>touska</strong> <br />(2009-05-13 23:06:56 UTC)</p><p>Actually, the test.c code for Arc4Process() is misleading by name, the .outputlen variable is the same as .inputlen which was copied from another spot.&nbsp; The variable is read-only and an input length parameter.&nbsp; Sorry for the confusion.</p><br /><p><strong>weejamx</strong> <br />(2009-05-17 15:15:21 UTC)</p><p>Hi,</p><p>Just to say, I finally put my brain to ON and write padding block functions, its only fews lines and work in every condition, so now I can use any block cipher as stream cipher.</p>]]></description>
			<author><![CDATA[null@example.com (chrisc)]]></author>
			<pubDate>Thu, 13 Jan 2011 23:19:25 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post81.html#p81</guid>
		</item>
	</channel>
</rss>
