<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Cocoaphony</title>
	<atom:link href="http://robnapier.net/blog/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://robnapier.net/blog</link>
	<description>Mac and iPhone, on the brain</description>
	<lastBuildDate>Sun, 13 May 2012 00:12:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Comment on Wrapping C++ &#8211; Take 2, Part 1 by Rob Napier</title>
		<link>http://robnapier.net/blog/wrapping-c-take-2-1-486/comment-page-1#comment-15979</link>
		<dc:creator>Rob Napier</dc:creator>
		<pubDate>Sun, 13 May 2012 00:12:40 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=486#comment-15979</guid>
		<description>&lt;p&gt;&lt;a href=&quot;#comment-15967&quot; rel=&quot;nofollow&quot;&gt;@Orpheus &lt;/a&gt; Check out my new post: http://robnapier.net/blog/wrapping-cppfinal-edition-759.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><a href="#comment-15967" rel="nofollow">@Orpheus </a> Check out my new post: <a href="http://robnapier.net/blog/wrapping-cppfinal-edition-759" rel="nofollow">http://robnapier.net/blog/wrapping-cppfinal-edition-759</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Wrapping C++ &#8211; Take 2, Part 1 by Wrapping C++ Final Edition &#124; Cocoaphony</title>
		<link>http://robnapier.net/blog/wrapping-c-take-2-1-486/comment-page-1#comment-15978</link>
		<dc:creator>Wrapping C++ Final Edition &#124; Cocoaphony</dc:creator>
		<pubDate>Sun, 13 May 2012 00:11:54 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=486#comment-15978</guid>
		<description>&lt;p&gt;[...] Objective-C can read it? This used to be a question that required some significant thought. See Wrapping C++, Take 2 Part 1 and Part 2 for my previous thinking on the [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] Objective-C can read it? This used to be a question that required some significant thought. See Wrapping C++, Take 2 Part 1 and Part 2 for my previous thinking on the [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Wrapping C++ &#8211; Take 2, Part 1 by Orpheus</title>
		<link>http://robnapier.net/blog/wrapping-c-take-2-1-486/comment-page-1#comment-15967</link>
		<dc:creator>Orpheus</dc:creator>
		<pubDate>Fri, 11 May 2012 13:44:37 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=486#comment-15967</guid>
		<description>&lt;p&gt;&lt;a href=&quot;#comment-15329&quot; rel=&quot;nofollow&quot;&gt;@Rob Napier &lt;/a&gt; 
I&#039;m an iOS developer with no C++ knowledge and I&#039;ve recently been pointed to your blog as a great resource for instruction on Objective C++ wrappers. I&#039;m wondering if it wouldn&#039;t be too much trouble for you to provide a simple example of what you meant when you said &quot;..now that you can declare ivars in the @implementation block, much of this technique is not required anymore&quot; in response to @mydogisbox&#039;s question: &quot;Why not just forward declare the class as a struct? C++ classes and structs are compatible..&quot; As my c++ header has no namespace, I feel that this would be useful to me and others. Thanks for the help if you had the time. Great blog!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><a href="#comment-15329" rel="nofollow">@Rob Napier </a> 
I&#8217;m an iOS developer with no C++ knowledge and I&#8217;ve recently been pointed to your blog as a great resource for instruction on Objective C++ wrappers. I&#8217;m wondering if it wouldn&#8217;t be too much trouble for you to provide a simple example of what you meant when you said &#8220;..now that you can declare ivars in the @implementation block, much of this technique is not required anymore&#8221; in response to @mydogisbox&#8217;s question: &#8220;Why not just forward declare the class as a struct? C++ classes and structs are compatible..&#8221; As my c++ header has no namespace, I feel that this would be useful to me and others. Thanks for the help if you had the time. Great blog!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Properly encrypting with AES with CommonCrypto by Carey</title>
		<link>http://robnapier.net/blog/aes-commoncrypto-564/comment-page-2#comment-15949</link>
		<dc:creator>Carey</dc:creator>
		<pubDate>Wed, 09 May 2012 20:25:59 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=564#comment-15949</guid>
		<description>&lt;p&gt;I&#039;m completely confused now. I just thought that encrypting and decrypting the data was the easiest safest way. I&#039;m new to security and don&#039;t really know how I should be handling data or which way is the best way. I don&#039;t know how to get the server to respond to the AuthenticationChallenge. I often don&#039;t have access to a webserice&#039;s server. I wonder if perhaps you would be willing to assist me further in understanding. I would compensate you for your time. This is a huge weakness in my iOS programming skills and I would like to improve it and understand it much better. Would you be interested?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;m completely confused now. I just thought that encrypting and decrypting the data was the easiest safest way. I&#8217;m new to security and don&#8217;t really know how I should be handling data or which way is the best way. I don&#8217;t know how to get the server to respond to the AuthenticationChallenge. I often don&#8217;t have access to a webserice&#8217;s server. I wonder if perhaps you would be willing to assist me further in understanding. I would compensate you for your time. This is a huge weakness in my iOS programming skills and I would like to improve it and understand it much better. Would you be interested?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Properly encrypting with AES with CommonCrypto by Rob Napier</title>
		<link>http://robnapier.net/blog/aes-commoncrypto-564/comment-page-2#comment-15948</link>
		<dc:creator>Rob Napier</dc:creator>
		<pubDate>Wed, 09 May 2012 20:16:03 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=564#comment-15948</guid>
		<description>&lt;p&gt;&lt;a href=&quot;#comment-15947&quot; rel=&quot;nofollow&quot;&gt;@Carey &lt;/a&gt; Yes, that would be fine provided you are correctly verifying the server certificate. The TLS tunnel is established before you send your data, so it is already encrypted and authenticated, which is the same thing you&#039;d be trying to recreate with RNCryptor.&lt;/p&gt;

&lt;p&gt;Ideally, you should limit the server certificates you are willing to accept for a secure HTTPS connection. You can do this in &lt;code&gt;connection:willSendRequestForAuthenticationChallenge:&lt;/code&gt; by using &lt;code&gt;SecTrustSetAnchorCertificates()&lt;/code&gt; to set the acceptable list of root certificates to just your signing root (rather than &quot;any trusted signing root&quot;). This is detailed in Chapter 11 of iOS:PTL (page 222). I don&#039;t believe I have any sample code posted for it, though.&lt;/p&gt;

&lt;p&gt;That said, it&#039;s certainly not the end of the world to just accept any device-trusted certificate (which is the default behavior). That gives you good protection against most attacks.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p><a href="#comment-15947" rel="nofollow">@Carey </a> Yes, that would be fine provided you are correctly verifying the server certificate. The TLS tunnel is established before you send your data, so it is already encrypted and authenticated, which is the same thing you&#8217;d be trying to recreate with RNCryptor.</p>

<p>Ideally, you should limit the server certificates you are willing to accept for a secure HTTPS connection. You can do this in <code>connection:willSendRequestForAuthenticationChallenge:</code> by using <code>SecTrustSetAnchorCertificates()</code> to set the acceptable list of root certificates to just your signing root (rather than &#8220;any trusted signing root&#8221;). This is detailed in Chapter 11 of iOS:PTL (page 222). I don&#8217;t believe I have any sample code posted for it, though.</p>

<p>That said, it&#8217;s certainly not the end of the world to just accept any device-trusted certificate (which is the default behavior). That gives you good protection against most attacks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Properly encrypting with AES with CommonCrypto by Carey</title>
		<link>http://robnapier.net/blog/aes-commoncrypto-564/comment-page-1#comment-15947</link>
		<dc:creator>Carey</dc:creator>
		<pubDate>Wed, 09 May 2012 19:49:44 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=564#comment-15947</guid>
		<description>&lt;p&gt;So you&#039;re saying that when my user on the iPhone enters his/her password as &quot;password&quot; I can just send it to the the server over https and all is fine and secure?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>So you&#8217;re saying that when my user on the iPhone enters his/her password as &#8220;password&#8221; I can just send it to the the server over https and all is fine and secure?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Properly encrypting with AES with CommonCrypto by Rob Napier</title>
		<link>http://robnapier.net/blog/aes-commoncrypto-564/comment-page-1#comment-15946</link>
		<dc:creator>Rob Napier</dc:creator>
		<pubDate>Wed, 09 May 2012 19:39:01 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=564#comment-15946</guid>
		<description>&lt;p&gt;Why do you believe that the HTTPS functionality on iOS devices is less secure than the system you&#039;re planning to implement? I&#039;m not aware of major flaws in the HTTPS implementation on iOS. What have you read?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Why do you believe that the HTTPS functionality on iOS devices is less secure than the system you&#8217;re planning to implement? I&#8217;m not aware of major flaws in the HTTPS implementation on iOS. What have you read?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Properly encrypting with AES with CommonCrypto by Carey</title>
		<link>http://robnapier.net/blog/aes-commoncrypto-564/comment-page-1#comment-15944</link>
		<dc:creator>Carey</dc:creator>
		<pubDate>Wed, 09 May 2012 19:10:33 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=564#comment-15944</guid>
		<description>&lt;p&gt;From what I have read that isn&#039;t very secure on the device. The device is reading sensitive medical data. So I need to decrypt what the server sends me and encrypt it to send back. Right?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>From what I have read that isn&#8217;t very secure on the device. The device is reading sensitive medical data. So I need to decrypt what the server sends me and encrypt it to send back. Right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Properly encrypting with AES with CommonCrypto by Rob Napier</title>
		<link>http://robnapier.net/blog/aes-commoncrypto-564/comment-page-1#comment-15943</link>
		<dc:creator>Rob Napier</dc:creator>
		<pubDate>Wed, 09 May 2012 19:07:10 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=564#comment-15943</guid>
		<description>&lt;p&gt;The other party to this must read and/or write the format documented here: https://github.com/rnapier/RNCryptor/wiki/Data-Format&lt;/p&gt;

&lt;p&gt;It&#039;s a fairly simple format and should be implementable in any language. The one difficult part of it is that the HMAC is at the end. That means that when you get to the end of the message, you have to roll back 32 bytes to find the end of the ciphertext. This is required to allow streaming. As long as you&#039;re able to encrypt or decrypt the entire message in memory, then this is a very easy format. If you want to support the same kind of streaming that RNCryptor does (where the entire message never has to be in memory), then you&#039;ll need to do the same thing I do and use a read-ahead buffer.&lt;/p&gt;

&lt;p&gt;RNCryptor will interoperate with OpenSSL format using RNOpenSSLCryptor, but this significantly reduces the security of the message. OpenSSL provides no message authentication, has a non-random IV, and a poor KDF.&lt;/p&gt;

&lt;p&gt;As noted on the Data-Format page, I&#039;ve considered supporting the more standard CMS format, but I don&#039;t know a lot of products that support this and it would add a lot of code and data overhead for potentially little real benefit to developers. I&#039;m not familiar with the formats that Windows uses for writing encrypted messages. If you have specs for the formats you&#039;re interested in, I can look at them.&lt;/p&gt;

&lt;p&gt;Generally if I were sending data to a server that the server was going to decrypt, I&#039;d just use HTTPS. Is there a reason you&#039;re performing a separate AES encryption?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The other party to this must read and/or write the format documented here: <a href="https://github.com/rnapier/RNCryptor/wiki/Data-Format" rel="nofollow">https://github.com/rnapier/RNCryptor/wiki/Data-Format</a></p>

<p>It&#8217;s a fairly simple format and should be implementable in any language. The one difficult part of it is that the HMAC is at the end. That means that when you get to the end of the message, you have to roll back 32 bytes to find the end of the ciphertext. This is required to allow streaming. As long as you&#8217;re able to encrypt or decrypt the entire message in memory, then this is a very easy format. If you want to support the same kind of streaming that RNCryptor does (where the entire message never has to be in memory), then you&#8217;ll need to do the same thing I do and use a read-ahead buffer.</p>

<p>RNCryptor will interoperate with OpenSSL format using RNOpenSSLCryptor, but this significantly reduces the security of the message. OpenSSL provides no message authentication, has a non-random IV, and a poor KDF.</p>

<p>As noted on the Data-Format page, I&#8217;ve considered supporting the more standard CMS format, but I don&#8217;t know a lot of products that support this and it would add a lot of code and data overhead for potentially little real benefit to developers. I&#8217;m not familiar with the formats that Windows uses for writing encrypted messages. If you have specs for the formats you&#8217;re interested in, I can look at them.</p>

<p>Generally if I were sending data to a server that the server was going to decrypt, I&#8217;d just use HTTPS. Is there a reason you&#8217;re performing a separate AES encryption?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Properly encrypting with AES with CommonCrypto by Carey</title>
		<link>http://robnapier.net/blog/aes-commoncrypto-564/comment-page-1#comment-15942</link>
		<dc:creator>Carey</dc:creator>
		<pubDate>Wed, 09 May 2012 18:41:49 +0000</pubDate>
		<guid isPermaLink="false">http://robnapier.net/blog/?p=564#comment-15942</guid>
		<description>&lt;p&gt;This code seems great. Except one problem. How does the server decrypt what I&#039;m sending? What&#039;s the standard for a windows server to match what I&#039;m doing with the RNCryptor class?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This code seems great. Except one problem. How does the server decrypt what I&#8217;m sending? What&#8217;s the standard for a windows server to match what I&#8217;m doing with the RNCryptor class?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

