<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Crypto &#8211; Xojo Programming Blog</title>
	<atom:link href="https://blog.xojo.com/tag/crypto/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.xojo.com</link>
	<description>Blog about the Xojo programming language and IDE</description>
	<lastBuildDate>Tue, 30 Nov 2021 17:13:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Crypto Improvements</title>
		<link>https://blog.xojo.com/2021/11/18/crypto-improvements/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Thu, 18 Nov 2021 12:40:00 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Xojo Programming Language]]></category>
		<guid isPermaLink="false">https://blog.xojo.com/?p=9589</guid>

					<description><![CDATA[Xojo 2021 Release 3 has a few improvements to the Crypto module that you might find useful such as SHA3, BlowFish/TwoFish and CRC-32.]]></description>
										<content:encoded><![CDATA[
<p>Xojo 2021 Release 3 has a few improvements to the <a href="https://documentation.xojo.com/api/cryptography/crypto.html">Crypto</a> module that you might find useful.</p>



<h3 class="wp-block-heading">SHA3</h3>



<p>A new <a href="https://en.wikipedia.org/wiki/SHA-3">SHA3</a> algorithm is available for use with the Hash function. You can now use SHA3-256 (SHA3 with 256-bit digest) and SHA3-512 (SHA3 with a 512 bit digest) from the <a href="https://documentation.xojo.com/api/cryptography/crypto.html#crypto-hashalgorithms">Crypto.HashAlgorithms</a> enumeration for stronger encryption or compatibility with something else that uses them.</p>



<pre class="wp-block-preformatted">Var hash As String
hash = Crypto.Hash("YourPasswordSentence", Crypto.HashAlgorithms.SHA3_512)</pre>



<h3 class="wp-block-heading">BlowFish / TwoFish</h3>



<p>The BlowFish and TwoFish encryption algorithms can now be used in Xojo. These two algorithms are similar, with <a href="https://en.wikipedia.org/wiki/Blowfish_(cipher)">BlowFish</a> being the original algorithm and <a href="https://en.wikipedia.org/wiki/Twofish">TwoFish</a> being a newer, more secure version that was derived from BlowFish.</p>



<p>You can use them in Xojo with the <a href="https://documentation.xojo.com/api/cryptography/crypto.html#crypto-blowfishencrypt">Crypto.BlowFishEncrypt</a>, <a href="https://documentation.xojo.com/api/cryptography/crypto.html#crypto-blowfishdecrypt">Crypto.BlowFishDecrypt</a>, <a href="https://documentation.xojo.com/api/cryptography/crypto.html#crypto-twofishencrypt">Crypto.TwoFishEncrypt</a> and <a href="https://documentation.xojo.com/api/cryptography/crypto.html#crypto-twofishdecrypt">Crypto.TwoFishDecrypt</a> methods.</p>



<p>You can use either to encrypt data, but in general you&#8217;ll want to avoid BlowFish for your own code, although it might prove useful for compatibility with other libraries or tools.</p>



<h3 class="wp-block-heading">AES</h3>



<p>AES (Advanced Encryption Standard) is also used to encrypt data. You can do this using the <a href="https://documentation.xojo.com/api/cryptography/crypto.html#crypto-aesencrypt">Crypto.AESEncrypt</a> and <a href="https://documentation.xojo.com/api/cryptography/crypto.html#crypto-aesencrypt">Crypto.AESDecrypt</a> methods. Here is a quick sample:</p>



<pre class="wp-block-preformatted">Var encrypted As MemoryBlock

Var dataToEncrypt As MemoryBlock = "Secret!"
Var key As MemoryBlock = Crypto.GenerateRandomBytes(16)
Var initVector As MemoryBlock = Crypto.GenerateRandomBytes(16)
encrypted = Crypto.AESEncrypt(key, dataToEncrypt, Crypto.BlockModes.CBC, initVector)

Var decrypted As MemoryBlock
decrypted = Crypto.AESDecrypt(key, encrypted, Crypto.BlockModes.CBC, initVector)
// decrypted = "Secret!"</pre>



<p></p>



<h3 class="wp-block-heading">CRC-32</h3>



<p>CRC32 is just a simple way to test data integrity and is not cryptographically secure. It still has its uses for fast data comparison and simple hash tables. It can be called like this:</p>



<pre class="wp-block-preformatted">Var crc32 As String
crc32 = Crypto.Hash("StringOrDataToTest", Crypto.HashAlgorithms.CRC32)</pre>



<h3 class="wp-block-heading">RSASign</h3>



<p>RSASign now takes an optional parameter and RSASignModes let you specify the hash to use.</p>



<p>Learn more about the Crypto module in the <a href="https://documentation.xojo.com/api/cryptography/crypto.html">Xojo Documentation</a>.</p>



<p></p>



<p>Updated (Nov 22, 2021): Added AES section</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>A compromise to security is always just that.</title>
		<link>https://blog.xojo.com/2017/08/28/a-compromise-to-security-is-always-just-that/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Mon, 28 Aug 2017 18:22:02 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[Mobile]]></category>
		<guid isPermaLink="false">http://blog.xojo.com/?p=3192</guid>

					<description><![CDATA[Governments debate requiring companies to build "backdoors" into their technology. The problem is that if the government or the company can get in, others will inevitably find a way to exploit that same back door too, making us and our data less safe and secure.]]></description>
										<content:encoded><![CDATA[<p>Last month the Australian government <a href="https://www.macobserver.com/news/australia-attorney-general-apple-encryption-back-door/">suggested</a> they might require tech companies to provide back doors into their systems to help law enforcement use those back doors to catch bad guys. Apple immediately dispatched people to go talk with them about it. Apple&#8217;s stance has been that such back doors don&#8217;t help catch bad guys and just make the rest of us less secure. Is that really true?</p>
<p><span id="more-3192"></span></p>
<p>Systems like Apple&#8217;s iMessage (their text messaging service) use encryption ensuring that all messages sent between Apple devices via iMessage are encrypted with keys that Apple does not have. They keys are on your device. Law enforcement agencies want Apple and others to provide a means of decrypting those messages without having to obtain the device itself. <strong>The problem is that if the government and Apple can get in, others will inevitably find a way to exploit that same back door too, making us and our data less safe and secure.</strong></p>
<p>What some governments have failed to understand is that the bad guys can bypass any back door by using their own encryption. The smart bad guys probably assume that these back doors exist now (or at least aren&#8217;t taking any chances) and are already using their own encryption for their communications. How hard is it to write software to encrypt and decrypt messages? Do bad guys have access to programmers smart enough to do this? Yes, they almost certainly do.</p>
<p>Let&#8217;s take a look at what is involved in using <a href="http://www.xojo.com">Xojo</a> to write an app that encrypts and decrypts messages. First, two keys need to be generated, a public key and a private one. The public key allows anyone to encrypt a message that only the holder of the matching private key can decrypt. Public keys can only encrypt. They are no good for decrypting messages. This means you can give anyone your public key which they can then use to send encrypted messages to you that no one else but you can decrypt.</p>
<pre>Dim privateKey As String
Dim publicKey As String
If Crypto.RSAGenerateKeyPair(KeySize, privateKey, publicKey) Then
 PrivKey.Text = privateKey
 PubKey.Text = publickey
 SaveNewKeys(privateKey, publicKey)
Else
 Beep
 MsgBox "An error has occured. Keys could not be generated."
End If
</pre>
<p>This is just 10 lines of code and it could be further reduced. I wrote this to make it easier to read. The important function is RSAGenerateKeyPair on the third line. Next, you need to be able to encrypt a message using someone else&#8217;s public key. Let&#8217;s take a look at the code to do that:</p>
<pre>Dim publicKey As String = RecipientsPublicKey.Text
Dim msg As MemoryBlock = OriginalMessage.Text
try
 Dim encryptedData As MemoryBlock = Crypto.RSAEncrypt(msg, publicKey)
 beep
 If encryptedData = Nil Then
  MsgBox("Encryption failed.")
 else
  Dim c As New Clipboard
  c.Text = Encodebase64(encryptedData)
  c.close
  MsgBox("Your encrypted message has been copied to the clipboard.")
 End If
Catch rte As RuntimeException
 If rte IsA CryptoException Then
  Beep
  MsgBox "Encryption failed because the Public key provided is not valid."
 Else
  Raise rte
 End If
End Try</pre>
<p>This is 21 lines of code, most of which is handling errors. The one line that is really doing the work is the fourth one that contains RSAEncrypt. Next we need to be be able to decrypt. Here&#8217;s what that code looks like:</p>
<pre>Dim privateKey As String = privKey.Text
try
 Dim decryptedData As MemoryBlock = Crypto.RSADecrypt(DecodeBase64(EncryptedMessage.Text), privateKey)
 Decryptedmessage.Text = DefineEncoding(decryptedData.StringValue(0, decryptedData.size), Encodings.UTF8)
Catch rte As RuntimeException
 If rte IsA CryptoException Then
 Beep
 MsgBox "The message could not be decrypted because the incorrect key was provided."
 Else
 Raise rte
 End If
End Try</pre>
<p>This is 12 lines of code and like the other code examples, is mostly error checking. The important line is the third one that calls RSADecrypt. There is some additional code to save the keys to a text file and load them back in automatically when the app is launched. However, even adding in all that code gets you to only about 80 lines total. <strong>In other words, this is not a big app and not beyond the ability of someone with intermediate programming skills or even perhaps a very dedicated novice.</strong> (To learn about this in more depth, read <a href="http://blog.xojo.com/2014/02/05/using-publicprivate-key-encryption-in-xojo/">Using Public/Private Key Encryption in Xojo</a>).</p>
<p>If you&#8217;d like to try out encrypting messages with the app from which the code above originated, you can download <a href="http://blog.xojo.com/wp-content/uploads/2017/08/CryptoMessage-Mac.zip">CryptoMessage for macOS</a>, <a href="http://blog.xojo.com/wp-content/uploads/2017/08/CryptoMessage-Windows.zip">CryptoMessage for Windows</a> or <a href="http://blog.xojo.com/wp-content/uploads/2017/08/CryptoMessage-Linux.zip">CryptoMessage for Linux</a>. Have a friend do it as well and you can send encrypted messages back and forth. If you&#8217;re more adventurous and would like to try playing around with the source code itself, make sure you have <a href="http://www.xojo.com">Xojo</a> installed (which can be <a href="http://www.xojo.com/download">downloaded</a> and used for free) then download the <a href="http://blog.xojo.com/wp-content/uploads/2017/08/CryptoMessage.zip">CryptoMessage Xojo Project</a>.</p>
<p>Xojo has a <a href="http://developer.xojo.com/xojo-crypto">crypto library</a> (the part that provides key generation, encryption and decryption) built-in to it. However, if a programmer wasn&#8217;t using Xojo, they could easily find a crypto library on the Internet to use. In other words, building your own app to encrypt and decrypt messages is not very challenging. As I mentioned earlier, the bad guys (at least the smart ones) are likely already doing this as they are probably sufficiently paranoid that despite public announcements to the contrary, the back doors already exist.</p>
<p><strong>The assumption that compromising our security enables catching more bad guys is a flawed one that I have <a href="http://blog.xojo.com/2016/01/27/smartphone-encryption-is-a-red-herring/">written about</a> <a href="http://blog.xojo.com/2016/02/04/if-smartphone-encryption-is-a-red-herring-how-do-we-track-the-bad-guys/">before</a>.</strong> It won&#8217;t work and we will all suffer needlessly. Imagine not being able to carry on a private conversation via your smartphone. That would make your device feel <strong>a lot</strong> less useful. Some governments have &#8220;experts&#8221; that have suggested it would be possible to have a back door Law Enforcement could use but could not be compromised by anyone else. That is a logical impossibility. Governments do not possess magic powers. They are made of up people like you and me. That is wishful thinking at best and negligent at worse.</p>
<p>When your government starts making noises about doing this, I advise you to make it clear to them that for the reasons I have stated in this post, such a compromising security is all downside with no upside at all.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>RSA: Private/Public keys between Xojo and PHP</title>
		<link>https://blog.xojo.com/2017/06/06/rsa-privatepublic-keys-between-xojo-and-php/</link>
		
		<dc:creator><![CDATA[Javier Menendez]]></dc:creator>
		<pubDate>Tue, 06 Jun 2017 04:37:26 +0000</pubDate>
				<category><![CDATA[Learning]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[AprendeXojo]]></category>
		<category><![CDATA[Crypto]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[RSA]]></category>
		<guid isPermaLink="false">http://blog.xojo.com/?p=2767</guid>

					<description><![CDATA[Among other topics, Cryptography and data ciphering always fascinated me. Beyond their mathematical perspective, most of the time it is a matter of putting them&#8230;]]></description>
										<content:encoded><![CDATA[<p>Among other topics, Cryptography and data ciphering always fascinated me. Beyond their mathematical perspective, most of the time it is a matter of putting them in practice with developed solutions: dealing with data only visible between the transmitter and the receiver. As it happens, the Xojo framework makes it really easy to deal with ciphered data.<span id="more-2767"></span></p>
<p>All the methods related to cryptography and data ciphering are available under the <a href="http://developer.xojo.com/xojo-crypto"><b>Crypto</b></a> module of Xojo, using behind the scene the Crypto++ 5.6.3 library. From the practical side, this allows us to use the <strong>RSA</strong> public key ciphering and other algorithms to compute unique footprints for given data, as for example <a href="http://developer.xojo.com/xojo-crypto$Hash"><b>Hash</b></a>, <a href="http://developer.xojo.com/xojo-crypto$MD5"><b>MD5</b></a> or <a href="http://developer.xojo.com/xojo-crypto$SHA1"><b>SHA</b></a>. <a href="https://blog.xojo.com/2014/02/05/using-publicprivate-key-encryption-in-xojo/">Paul blogged</a> about using Public/Private Key Encryption in Xojo back when we added RSA encryption functions in 2014.</p>
<p>Among the methods related to RSA, we can find the ones to create the Private/Public keys, test the integrity of the public key, signing the given data and, of course, check the integrity of the signature, and ciphering / deciphering the given group of data.</p>
<p>As you probably already know, when we work with RSA we have to keep the Private key in a safe place, using the Public one to give to other people/service/app to whom we want to share information with in a safe manner. This way the users and/or apps and services will be able to use our public key to cipher the data that they want to share with us, and we will be able to use our private key to decipher that group of data so it is <em>legible</em> again.</p>
<h1>RSA: Creating and interchanging the keys</h1>
<p>Generating the pair of keys could not be more easy in Xojo, with this snippet of code:</p>
<pre>Dim publicKey As String
Dim privateKey As String
If Crypto.RSAGenerateKeyPair( 1024, privateKey, publicKey ) Then msgBox “Successfully generated Keys!"</pre>
<p>As you can see, the <a href="http://developer.xojo.com/xojo-crypto$RSAGenerateKeyPair"><b>RSAGenerateKeyPair</b></a> method receives the Integer number that indicates the strength (robustness) of the generated keys, followed by the String variables containing the generated Private and Public keys, passed by reference.</p>
<p>But in some cases it is possible that you want to use these keys beyond the scope of Xojo, for example when integrating your app with a service or solution developed in PHP. In these cases you have to consider that the keys generated with Xojo are in hexadecimal format.</p>
<p>What does this mean? Well, a public key generated with Xojo will look like this chunk of data:</p>
<pre>30819D300D06092A864886F70D010101050003818B0030818702818100B4B531D3402C250D8640E739601F01FBE8ABB39635BE1778A7F4E55C49419C0595EF5A5824EA8E7A1871FB63B8960EDBB97B08C2E7EA43229903AEBCB45B9FD9E24780B15BCADB5E026849592CC1FA9B399EBD8457CC4E7A686CF53E9146E1D867ACEB675728E8821DEDA4C2F807FD668A81601F551484C5D1334B62D5E90E33020111</pre>
<p>While other external libraries (as is the case in most of the web development frameworks), expect other data format codified as Base64. This is, something like this:</p>
<pre>-----BEGIN PUBLIC KEY-----

MIGHAoGBALS1MdNALCUNhkDnOWAfAfvoq7OWNb4XeKf05VxJQZwFle9aWCTqjnoYcftjuJYO27l7
CMLn6kMimQOuvLRbn9niR4CxW8rbXgJoSVkswfqbOZ69hFfMTnpobPU+kUbh2Ges62dXKOiCHe2k
wvgH/WaKgWAfVRSExdEzS2LV6Q4zAgER

-----END PUBLIC KEY-----</pre>
<p>So the first step to encode our Xojo keys (Public or Private ones) as Base64 is converting them previously from his hexadecimal form to the DER encoding (<em>Distinguished Encoding Rules</em>). Here is where we have to employ the <a href="http://developer.xojo.com/xojo-crypto$DEREncodePrivateKey"><b>DEREncodePrivateKey</b></a> and <a href="http://developer.xojo.com/xojo-crypto$DEREncodePublicKey"><b>DEREncodePublicKey</b></a> methods if we want to encode the Private or the Public key, respectively. Once we have done this, we will be able to encode the resulting chunk of data as Base64 without forgetting to add the header <code>“—–BEGIN PUBLIC KEY—–“</code> and the footer <code>“—–END PUBLIC KEY—–“</code> with the accompanying ends of lines, or maybe the header <code>“—–BEGIN CERTIFICATE—–”</code> and the footer <code>“—–END CERTIFICATE—–“</code> if we are dealing with a Public Key (for the Private keys we have to use the header <code>“—–BEGIN RSA PRIVATE KEY—–”</code> and the footer <code>“—–END RSA PRIVATE KEY—–“</code>).</p>
<p>You can interchange and use the Private and Public keys generated with Xojo using the <a href="http://phpseclib.sourceforge.net/">PHPSecLib</a> library.</p>
<p>In addition, as pointed by <a href="https://thezaz.com/">Thom McGrath</a>, you can use also these keys with OpenSSL this way:</p>
<pre>if (@openssl_public_encrypt($data, $result, $public_key, OPENSSL_PKCS1_OAEP_PADDING)) {
         return $result;
 } else {
         throw new \Exception('Unable to encrypt');
 }</pre>
<p>Xojo&#8217;s Crypto library will be able to use a private key to decrypt $result in this case.</p>
<p>Finally, if you are interested in the cryptography topic, let me recommend you some good books: <a href="https://www.schneier.com/books/applied_cryptography/" target="_blank" rel="noopener noreferrer">Applied Cryptography</a> and <a href="http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0470474246.html" target="_blank" rel="noopener noreferrer">Cryptography Engineering</a>.</p>
<p><em>Javier Rodri­guez has been the Xojo Spanish Evangelist since 2008, he’s also a Developer, Consultant and Trainer who has be using Xojo since 1998. He manages <a href="http://www.aprendexojo.com/">AprendeXojo.com</a> and is the developer behind the GuancheMOS plug-in for Xojo Developers and the Snippery app, among others.</em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>If Smartphone Encryption Is A Red Herring, How Do We Track The Bad Guys?</title>
		<link>https://blog.xojo.com/2016/02/04/if-smartphone-encryption-is-a-red-herring-how-do-we-track-the-bad-guys/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Thu, 04 Feb 2016 00:00:00 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mobile]]></category>
		<guid isPermaLink="false">http://blogtemp.xojo.com/2016/02/04/if-smartphone-encryption-is-a-red-herring-how-do-we-track-the-bad-guys/</guid>

					<description><![CDATA[Smartphone Encryption is a Red Herring, but the Good Guys have other options. We don't need universal back doors.]]></description>
										<content:encoded><![CDATA[<p>In the blog post <a href="http://blog.xojo.com/2016/01/27/smartphone-encryption-is-a-red-herring/">Smartphone Encryption is a Red Herring</a>, I pointed out the folly of requiring an encryption back door for the Good Guys to use. So the question arises- &#8220;What <em>can</em> be done? If we don&#8217;t want a global encryption back door that can be used by anyone, can we still track the Bad Guys?&#8221;</p>
<p>The answer is yes. There are plenty of options that don&#8217;t require a global back door. I&#8217;m not passing judgment on whether these are inherently good or bad options, just that they are available when there is a reason to track a Bad Guy.<br />
<span id="more-285"></span></p>
<p><strong>Keyloggers</strong><br />
A <a href="https://en.wikipedia.org/wiki/Keystroke_logging" target="_blank" rel="noopener">keylogger</a> is used to track everything someone types. They come in both software and hardware varieties. Once installed, they can provide regular data about passwords and other communications the Bad Guy is making. Some store the data for later retrieval, while others broadcast it on a regular basis. They exist in varieties for both computers and cell phones.</p>
<p><img fetchpriority="high" decoding="async" style="display: block; margin-left: auto; margin-right: auto;" title="keyboard.png" src="https://blog.xojo.com/wp-content/uploads/2016/02/keyboard.pngt1466486449161ampwidth424ampheight322" sizes="(max-width: 424px) 100vw, 424px" alt="keyboard.png" width="424" height="322" /><br />
<strong>Online Man in the Middle</strong><br />
With proper authorization, the Good Guys <a href="https://en.wikipedia.org/wiki/Man-in-the-middle_attack" target="_blank" rel="noopener">can stand between</a> the Bad Guys and common online services they might be using. Working with their internet provider, they can gather data similar to keyloggers by intercepting and relaying data back and forth.</p>
<p><strong>Digital Evidence Collection</strong><br />
When a warrant is served and computers or mobile devices are retrieved for analysis, gathering evidence quickly is paramount. The Bad Guys may have countermeasures installed on their devices, so being able to copy data from hard drives and other storage mediums across platforms while they are still online is important. Once images of the data are created, the evidence can be safely analyzed without being concerned about time bombs or other countermeasures. Xojo has been used to create tools that are used for both digital evidence collection and analysis. Being a cross platform tool is a particular advantage in this scenario.</p>
<p>None of the above options require a global back door, and they can all be limited to just the Bad Guys in question when surveillance is warranted. A <a href="https://www.onthewire.io/harvard-study-questions-going-dark-crypto-problem/" target="_blank" rel="noopener">recently released Harvard study</a> has similar findings. Some options are better than others depending on the region in the world and the technical prowess of the Bad Guys. <a href="../../../com/xojo/blog/smartphone-encryption-is-a-red-herring.html" target="_blank" rel="noopener">Smartphone Encryption is a Red Herring</a>, but the Good Guys have other options. We don&#8217;t need universal back doors.</p>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Smartphone Encryption is a Red Herring</title>
		<link>https://blog.xojo.com/2016/01/27/smartphone-encryption-is-a-red-herring/</link>
		
		<dc:creator><![CDATA[Geoff Perlman]]></dc:creator>
		<pubDate>Wed, 27 Jan 2016 00:00:00 +0000</pubDate>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Crypto]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[Mobile]]></category>
		<guid isPermaLink="false">http://blogtemp.xojo.com/2016/01/27/smartphone-encryption-is-a-red-herring/</guid>

					<description><![CDATA[Encryption Red Herring: Proposed AES encryption backdoor will not work but will create an exponentially greater problem for everyone but the bad guys.]]></description>
										<content:encoded><![CDATA[<p><img decoding="async" style="width: 320px; margin: 0px 10px 10px 0px; float: left;" title="EnigmaMachine.png" src="https://blog.xojo.com/wp-content/uploads/2016/01/EnigmaMachine.pngt1466486449161ampwidth320" sizes="(max-width: 320px) 100vw, 320px" alt="EnigmaMachine.png" width="320" data-constrained="true" />As the Founder and CEO of a <a href="https://xojo.com/" target="_blank" rel="noopener">software company</a> that makes a development tool for mobile platforms, as well as for desktop and web, I have a lot of experience with encryption. The current controversy over encryption is really important to me. During World War II, the Germans created a way of sending encrypted messages to commanders in the field. The device came to be known as an <a href="https://en.wikipedia.org/wiki/Enigma_machine" target="_blank" rel="noopener">Engima machine</a>. It looked like a typewriter but had an encryption key that changed a message into unreadable noise. That message could only be decoded if you knew the key used to encrypt it. The Allies worked very hard to get their hands on one of these devices so they could learn how it works and be able to decrypt the messages and know what the German military plans. Ultimately the Allies figured it out and it helped them win the war. If this has peaked your curiosity, check out the movie <a href="http://www.imdb.com/title/tt0141926/?ref_=nv_sr_1" target="_blank" rel="noopener">U-571</a> (a fictional account of the effort to obtain an Enigma machine) and <a href="http://www.imdb.com/title/tt2084970/" target="_blank" rel="noopener">The Imitation Game</a> about the team that figured out the encryption key.</p>
<p><span id="more-319"></span></p>
<p>Today, terrorists are using encryption to hide their communications just like the Nazis did in WWII. What makes encryption different today is that it is also being used by millions of ordinary people, many of whom have no idea they are even using it. Almost every smartphone in use today, encrypts text messages and other data automatically. This is all done behind the scenes without the user ever being aware of it.</p>
<p style="text-align: left;">The type of encryption used on the iPhone and Android is called <a href="https://en.wikipedia.org/wiki/Advanced_Encryption_Standard" target="_blank" rel="noopener">AES</a> and it&#8217;s formidable. Intercepting your text messages isn&#8217;t actually difficult but decrypting those messages is, at best, impractical. To decrypt a message, just like with the Enigma machine, you need to know the key that was used to encrypt it. If you don&#8217;t have that key, you&#8217;d have to guess at what the key might be then look at the results of decrypting the message with that key to see if you have anything but unintelligible gibberish. Even with access to the fastest computers in the world, it could literally take years to guess the right key. It will come as no surprise that governments at almost every level don&#8217;t like this one bit. At their most transparent, they are used to getting a search warrant and being able to look at whatever you&#8217;ve got to see if it supports their suspicion that you are in fact up to no good. At their least, they wish to get on your phone (ideally from a secure, remote location) and take your data without a warrant or you having any idea they were ever there. The problem for governments is that they can&#8217;t. In Apple&#8217;s case, even if Apple was willing to compile with a request that they decrypt the data on your phone, they can&#8217;t. The key is stored on your phone in a way that even Apple can&#8217;t get to it. In this sense, Apple is in complete alignment with you in terms of your privacy.</p>
<p><img decoding="async" style="display: block; margin-left: auto; margin-right: auto;" title="red_herring.png" src="https://blog.xojo.com/wp-content/uploads/2016/01/red_herring.pngt1466486449161ampwidth321ampheight225" sizes="(max-width: 321px) 100vw, 321px" alt="red_herring.png" width="321" height="225" /></p>
<p>There are lawmakers here in the United States that want to force companies like Apple and Google to provide a <em>back door</em>. This would be a way for Apple to get into your data should a search warrant (presumably) be issued. Apple&#8217;s CEO Tim Cook as <a href="http://www.theguardian.com/technology/2016/jan/13/apple-tim-cook-us-government-encryption" target="_blank" rel="noopener">pointed out</a> what a <a href="http://techcrunch.com/2015/06/02/apples-tim-cook-delivers-blistering-speech-on-encryption-privacy/" target="_blank" rel="noopener">bad idea</a> this is. <strong>Back doors don&#8217;t get used by just the good guys.</strong> They will get used by the bad guys as well. In an effort to make it possible for law enforcement to get at the data of the tiny percentage of the population that is doing wrong, we would be opening everyone up to being hacked remotely. It&#8217;s not possible to make a back door that only the good guys can use. Think about your contacts, text messages, email, photos, all being exposed. Just the increased level of extortion alone would be so bad that your smartphone would go back to being useful as nothing more than a phone. Do any of you really want to go back to the 1980s?</p>
<p>What is worse than that, however, is <strong>what is not being talked about in the news</strong>. Smartphone encryption is a <a href="https://en.wikipedia.org/wiki/Red_herring" target="_blank" rel="noopener">red herring</a>. A back door wouldn&#8217;t solve the problem. Bad guys would simply write their own apps to encrypt the data themselves before they send it. This is incredibly easy to do. <a href="http://www.xojo.com" target="_blank" rel="noopener">Xojo</a>, the development tool my company created, has this same type of AES encryption built-in. Many other development tools have it as well. I could write an app to encrypt a message in a few minutes. Even if you have never written a line of code in your life, after a few hours learning Xojo, you could write the same app yourself. <strong>If you or I can do it, the bad guys can too.</strong> The smartest of them are almost certainly <em>already</em> doing this today. The end result would be that every law-abiding citizen&#8217;s personal and private data would become hackable- causing a digital tsunami of cybercrime that would be impossible for law enforcement to stop while achieving next to nothing towards actual security.</p>
<p><img decoding="async" style="width: 320px; margin: 10px auto; display: block;" title="edited_lock_and_code.png" src="https://blog.xojo.com/wp-content/uploads/2016/01/edited_lock_and_code.pngt1466486449161ampwidth320" sizes="(max-width: 320px) 100vw, 320px" alt="edited_lock_and_code.png" width="320" data-constrained="true" />I understand why our lawmakers and law enforcement are concerned about encryption. It is a barrier to evidence for them. Tim Cook has argued that we have to balance law enforcement with our personal privacy. That&#8217;s certainly true. However, in this case, you don&#8217;t even have to go that far. <strong>What our elected officials are proposing will not work and will only create an exponentially greater problem.</strong> You may be asking yourself, &#8220;Surely they have thought of this, right?&#8221; Clearly they haven&#8217;t. Too often people make decisions without complete information or having taken sufficient time to to think the matter through. We have all seen this many times in our lives. Smartphone encryption is just the latest example. It&#8217;s not the first and won&#8217;t be the last. I&#8217;m all for looking for better ways to catch the bad guys but smartphone back doors <strong>will not work</strong>. Your elected officials are wasting your precious taxpayer dollars. If you want to stop this, contact them and ask them to better educate themselves on this topic. You can point them to this blog post to start. I can&#8217;t speak for countries outside the United States, but here elected officials give considerable weight to their constituents that reach out to them. You can contact your Representatives in the House <a href="http://www.house.gov/representatives/" target="_blank" rel="noopener">here</a> and your Senators <a href="http://www.senate.gov/senators/contact/" target="_blank" rel="noopener">here</a>.</p>
<p>Lastly, while I am proud of Tim Cook for fighting back on this issue, it saddens me that he appears alone on the world stage while doing this. Powerful people in technology such as Mark Zukerberg of Facebook, Larry Page and Sergey Brin of Google, Satya Nadella of Microsoft and others should be taking an equal stand. They are in an even better position than we are as individuals to make it clear that the proposed solution won&#8217;t work. Until then, contact your elected officials and tell them that dog won&#8217;t hunt.</p>
<p style="text-align: center;"><span id="hs-cta-wrapper-2f9a74a4-35c0-4f3d-b3d0-101223008c8b" class="hs-cta-wrapper"><span id="hs-cta-2f9a74a4-35c0-4f3d-b3d0-101223008c8b" class="hs-cta-node hs-cta-2f9a74a4-35c0-4f3d-b3d0-101223008c8b"> <!-- [if lte IE 8]></p>





<div id="hs-cta-ie-element"></div>


<![endif]--> <a href="http://blog.xojo.com/2016/02/04/if-smartphone-encryption-is-a-red-herring-how-do-we-track-the-bad-guys/" target="_blank" rel="noopener"><img decoding="async" id="hs-cta-img-2f9a74a4-35c0-4f3d-b3d0-101223008c8b" class="hs-cta-img aligncenter" style="border-width: 0px;" src="https://blog.xojo.com/wp-content/uploads/2013/08/2f9a74a4-35c0-4f3d-b3d0-101223008c8b.png" alt="Security: How to Track The Bad Guys" width="384" height="64" /></a></span></span><br />
<!-- end HubSpot Call-to-Action Code --></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
