<?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 — [SOLVED] WolfSSL Interoperation with OpenSSL (AES CTR)]]></title>
		<link>https://www.wolfssl.com/forums/topic1270-solved-wolfssl-interoperation-with-openssl-aes-ctr.html</link>
		<atom:link href="https://www.wolfssl.com/forums/feed-rss-topic1270.xml" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in [SOLVED] WolfSSL Interoperation with OpenSSL (AES CTR).]]></description>
		<lastBuildDate>Thu, 11 Oct 2018 22:33:04 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [SOLVED] WolfSSL Interoperation with OpenSSL (AES CTR)]]></title>
			<link>https://www.wolfssl.com/forums/post4235.html#p4235</link>
			<description><![CDATA[<p>That&#039;s good to hear you figured it out.</p>]]></description>
			<author><![CDATA[null@example.com (john)]]></author>
			<pubDate>Thu, 11 Oct 2018 22:33:04 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post4235.html#p4235</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] WolfSSL Interoperation with OpenSSL (AES CTR)]]></title>
			<link>https://www.wolfssl.com/forums/post4221.html#p4221</link>
			<description><![CDATA[<p>Managed to figure out the issue.</p><p>While I was using the EVP_aes_256_ctr, I was using a 16b IV and a 16b key. I didn&#039;t realize the AES 256 function would accept a 16b key without errors. Changed it to a 32b key (as per documentation) and managed to get it working properly.</p>]]></description>
			<author><![CDATA[null@example.com (amar.paul)]]></author>
			<pubDate>Fri, 05 Oct 2018 15:34:06 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post4221.html#p4221</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] WolfSSL Interoperation with OpenSSL (AES CTR)]]></title>
			<link>https://www.wolfssl.com/forums/post4216.html#p4216</link>
			<description><![CDATA[<p>amar.paul,</p><p>Can you send us a sample of EVP encrypted data just to run though our parser to review the content format?</p><p>Warm Regards,</p><p>- K</p>]]></description>
			<author><![CDATA[null@example.com (Kaleb J. Himes)]]></author>
			<pubDate>Wed, 03 Oct 2018 21:47:05 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post4216.html#p4216</guid>
		</item>
		<item>
			<title><![CDATA[[SOLVED] WolfSSL Interoperation with OpenSSL (AES CTR)]]></title>
			<link>https://www.wolfssl.com/forums/post4211.html#p4211</link>
			<description><![CDATA[<p>I&#039;m currently trying to get a microcontroller running FreeRTOS with WolfSSL working with an x86 server using OpenSSL.</p><p>I&#039;m encrypting messages server-side with the OpenSSL EVP Cipher functions, using EVP_aes-256_ctr() as the type:</p><div class="codebox"><pre><code>EVP_CIPHER_CTX_new()
EVP_EncryptInit_ex(ctx, EVP_aes_256_ctr(), NULL, TEST_KEY, TEST_IV)
// EVP_CIPHER_CTX_set_padding(ctx, 0) /* tried adding this for wolfSSL compat */
EVP_EncryptUpdate()
EVP_EncryptFinal_ex()</code></pre></div><p>Now this currently works with OpenSSL on the other side running decryption. However, I&#039;m trying to get decryption working with WolfSSL and I&#039;ve been having problems. I&#039;ve currently tried a few approaches (mostly based on the FreeRTOS example code), including:<br /></p><div class="codebox"><pre><code>// attempt with bare AesCtrEncrypt:
byte cipher[AES_BLOCK_SIZE * 8]; // this is ~twice as large as the messages
Aes aes;
wc_AesSetKey(&amp;aes, TEST_KEY, AES_BLOCK_SIZE, TEST_IV, AES_ENCRYPTION);
wc_AesCtrEncrypt(&amp;aes, cipher, msg, out_len);

// attempt with wolfssl EVP Ciphers:
EVP_CIPHER_CTX ctx;
byte plain [AES_BLOCK_SIZE * 12];

EVP_CIPHER_CTX_init(&amp;ctx);
EVP_CipherInit(&amp;ctx, EVP_aes_256_ctr(), TEST_KEY, TEST_IV, 0/*decrypt*/)
EVP_Cipher(&amp;ctx, plain, (byte*)msg, len)</code></pre></div><br /><p>But neither of these two main approaches have worked for decrypting the encrypted bytes the server is sending over. Based on the docs I have no idea what to look for - the page for AesCbcEncrypt specifically mentions not using padding for OpenSSL interoperability, but the page for AesCtrEncrypt makes no mention.</p><p>- cbc page: <a href="https://www.wolfssl.com/doxygen/group__AES.html#gaed1e38cd30d917165183fc68dd4b218b">https://www.wolfssl.com/doxygen/group__ … 68dd4b218b</a><br />- ctr page: <a href="https://www.wolfssl.com/doxygen/group__AES.html#gabe7557f4867c7d8f84cecaa000fe43a1">https://www.wolfssl.com/doxygen/group__ … a000fe43a1</a></p><p>Thanks in advance!</p>]]></description>
			<author><![CDATA[null@example.com (amar.paul)]]></author>
			<pubDate>Mon, 01 Oct 2018 16:53:13 +0000</pubDate>
			<guid>https://www.wolfssl.com/forums/post4211.html#p4211</guid>
		</item>
	</channel>
</rss>
