<?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>PHP &#8211; Xojo Programming Blog</title>
	<atom:link href="https://blog.xojo.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.xojo.com</link>
	<description>Blog about the Xojo programming language and IDE</description>
	<lastBuildDate>Fri, 28 Jul 2017 15:00: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>A Better Alternative to PHP</title>
		<link>https://blog.xojo.com/2017/07/28/an-better-alternative-to-php/</link>
		
		<dc:creator><![CDATA[Paul Lefebvre]]></dc:creator>
		<pubDate>Fri, 28 Jul 2017 10:28:51 +0000</pubDate>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Xojo Cloud]]></category>
		<category><![CDATA[Deployment]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[webdev]]></category>
		<guid isPermaLink="false">http://blog.xojo.com/?p=2742</guid>

					<description><![CDATA[Like PHP, Xojo is object-oriented. Unlike PHP Xojo has a coherent framework design that is easier to work with. And the language is simpler and more focused as well. Try out Xojo and see how easy creating web apps can be!]]></description>
										<content:encoded><![CDATA[<p>Are you tired of the hassles of creating web apps using PHP? Why not develop faster and smarter with Xojo?</p>
<p>Like PHP, Xojo is object-oriented. Unlike PHP, Xojo has a coherent framework design that is easy to work with; plus the Xojo language is simple and focused.</p>
<p><span id="more-2742"></span></p>
<h3>Work Faster with an IDE</h3>
<p>Save yourself time and trouble by using an integrated development environment (<a href="https://en.wikipedia.org/wiki/Integrated_development_environment">IDE</a>). Why juggle text editors, FTP software, web servers and everything else you need to develop using PHP? With Xojo, you just need the IDE itself. Plus Xojo has a visual layout designer. You can design your web pages by dragging and dropping controls and positioning things how you want.</p>
<p align="center"><img decoding="async" src="https://www.xojo.com/resources/images/php/Figure01-VisualDesigner.png" alt="Xojo Visual Designer Web" /></p>
<h3>Learn One Thing</h3>
<p>Rather than having to master the details of PHP, HTML, JavaScript, AJAX, CSS and other somewhat related technologies, with Xojo you only have to know Xojo. You write your code in the Xojo language. Don’t worry about HTML or JavaScript -although you can if you want, Xojo is flexible. Xojo creates the HTML, CSS, JavaScript and AJAX code on the fly at runtime.</p>
<h3>Expandable</h3>
<p>Do you have existing JavaScript controls that you want to use? Take advantage of the Xojo Web SDK, which provides an API for you to integrate JavaScript (and HTML) controls and frameworks into Xojo.</p>
<p>This is Yahoo’s Rich Text Editor in a Xojo web app:</p>
<p align="center"><img decoding="async" src="https://www.xojo.com/resources/images/php/Figure02-YUIEditor.png" alt="Xojo UI Editor" /></p>
<h3>Easy Deployment</h3>
<p>Of course you can deploy your web apps to your own properly configured servers. But if you don&#8217;t have web server configuration experience or you just want a simple and secure deployment option, you can use <a href="http://www.xojo.com/cloud">Xojo Cloud</a>. Hosting with Xojo Cloud is as easy as clicking the “Deploy” button in Xojo; your app is built and uploaded to your Xojo Cloud server for immediate availability. You don’t have to worry about permissions, security or configuration.</p>
<p>See a Xojo web app hosted on Xojo Cloud here: <a href="http://demos.xojo.com">http://demos.xojo.com</a></p>
<p align="center"><img decoding="async" src="https://www.xojo.com/resources/images/php/Figure03-WebApp.png" alt="Xojo Web App" /></p>
<h3>Free to Develop</h3>
<p>Xojo is free to use for learning and development. <a href="http://www.xojo.com/download">Download and try it today</a> and see why people are choosing the simplicity of Xojo.</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>
	</channel>
</rss>
