<?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>PHPBlog.it &#187; cifrare</title>
	<atom:link href="http://phpblog.it/tag/cifrare/feed/" rel="self" type="application/rss+xml" />
	<link>http://phpblog.it</link>
	<description>Solo un altro blog targato WordPress</description>
	<lastBuildDate>Mon, 30 Jan 2012 10:36:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Come criptare i nostri scripts in PHP &#8211; Zend Guard</title>
		<link>http://phpblog.it/2008/10/15/criptare-i-nostri-scripts-in-php-zend-guard/</link>
		<comments>http://phpblog.it/2008/10/15/criptare-i-nostri-scripts-in-php-zend-guard/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 05:00:13 +0000</pubDate>
		<dc:creator>Davide Martignetti</dc:creator>
				<category><![CDATA[phpblog]]></category>
		<category><![CDATA[programmazione]]></category>
		<category><![CDATA[sicurezza]]></category>
		<category><![CDATA[cifrare]]></category>
		<category><![CDATA[criptare]]></category>
		<category><![CDATA[decode]]></category>
		<category><![CDATA[encode]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[zend guard]]></category>
		<category><![CDATA[zend optimizer]]></category>

		<guid isPermaLink="false">http://phpblog.it/2008/10/15/criptare-i-nostri-scripts-in-php-zend-guard/</guid>
		<description><![CDATA[Questo articolo è un approfondimento di “Offuscare o proteggere il nostro codice PHP &#8211; Introduzione“, analizzeremo le funzionalità, i pregi ed i difetti di Zend Guard al fine di criptare uno script PHP. Zend Guard non è l&#8217;unico programma che permette di cifrare uno script in PHP, per la lista completa vi rimando a Offuscare [...]]]></description>
			<content:encoded><![CDATA[<p>Questo articolo è un approfondimento di “<a href="http://phpblog.it/2008/07/21/offuscare-o-proteggere-il-nostro-codice-php-introduzione/" title="Offuscare o proteggere il nostro codice PHP - Introduzione">Offuscare o proteggere il nostro codice PHP &#8211; Introduzione</a>“, analizzeremo le funzionalità, i pregi ed i difetti di Zend Guard al fine di criptare uno script PHP.<br />
Zend Guard non è l&#8217;unico programma che permette di cifrare uno script in PHP, per la lista completa vi rimando a <a href="http://phpblog.it/2008/07/21/offuscare-o-proteggere-il-nostro-codice-php-introduzione/" title="Offuscare o proteggere il nostro codice PHP - Introduzione">Offuscare o proteggere il nostro codice PHP &#8211; Introduzione</a>.</p>
<p><span id="more-155"></span></p>
<h3>Zend Guard</h3>
<p>Zend Guard è senz&#8217;altro il più usato strumento a pagamento ( 600$ ) che permette di criptare i files PHP, forse perchè si integra perfettamente nell&#8217;interfaccia di Zend Studio, usandolo potrete anche creare delle licenze per i vostri prodotti, l&#8217;interfaccia è semplice ed intuitiva così come la sua installazione. Per usare Zend Guard è però necessario avere installato sul nostro webserver Zend Optimizer (Zend Optimizer è gratuito).<br />
Seppur il più usato Zend Guard non è di certo lo strumento più sicuro al quale affidare i nostri script. Esistono vari servizi gratuiti e a pagamento offerti dalla comunità online, di questi, però, troviamo online solamente quelli a pagamento: primo fra tutti <a href="http://www.zendecode.com/">Zend Decode</a> ( 50$ &#8211; per PHP4 e PHP5, solo per Windows ).<br />
Per provare Zend Guard scaricate ed installate Zend Guard [<br />
<a href="http://www.zend.com/en/products/guard/downloads">Scarica</a> ] ed anche Zend Optimizer [ <a href="http://www.zend.com/en/products/guard/downloads">Scarica</a> - Quando lo si installa fare molta attenzione a non premere invio senza curarsi di ciò che ci viene chiesto perchè è molto importante configurarlo correttamente! ].</p>
<p>Ecco come si presenta un semplicissimo script prima e dopo essere stato criptato ( ho usato la versione demo ):</p>
<h3>Prima</h3>
<p>[source:Php]&lt;?php<br />
function isOnline($address=&#8221;localhost&#8221;, $port=&#8221;80&#8243;, $timeout=&#8221;1&#8243;)<br />
{<br />
@$fp=fsockopen($address,$port,$err_no,$errstr,$timeout);<br />
if($fp)<br />
{<br />
return 1;<br />
fclose($fp);<br />
}<br />
else<br />
{<br />
echo &#8220;Errore numero $err_no: $errstr\n&#8221;;<br />
return 0;<br />
}<br />
}<br />
?&gt;[/source]</p>
<h3>Dopo</h3>
<p>[source:Php]&lt;?php @Zend;<br />
4123;<br />
/* ñ!This is not a text file!Þí */<br />
print &lt;&lt;&lt;EOM<br />
&lt;html&gt;&lt;body&gt;&lt;a href=&#8221;http://www.zend.com/products/zend_guard&#8221;&gt;&lt;img border=&#8221;0&#8243; src=&#8221;http://www.zend.com/images/store/safeguard_optimizer_img.gif&#8221; align=&#8221;right&#8221;&gt;&lt;/a&gt;&lt;center&gt;&lt;h1&gt;Zend Optimizer not installed&lt;/h1&gt;&lt;/center&gt;&lt;p&gt;This file was encoded by the &lt;a href=&#8221;http://www.zend.com/products/zend_guard&#8221;&gt;Zend Guard&lt;/a&gt;. In order to run it, please install the &lt;a href=&#8221;http://www.zend.com/products/zend_optimizer&#8221;&gt;Zend Optimizer&lt;/a&gt; (available without charge), version 3.0.0 or later. &lt;/p&gt;&lt;h2&gt;Seeing this message instead of the website you expected?&lt;/h2&gt;This means that this webserver is not configured correctly. In order to view this website properly, please contact the website&#8217;s system administrator/webmaster with the following message:&lt;tt&gt;The component &#8220;Zend Optimizer&#8221; is not installed on the Web Server and therefore cannot service encoded files. Please download and install the Zend Optimizer (available without charge) on the Web Server.&lt;/tt&gt;&lt;b&gt;Note&lt;/b&gt;: Zend Technologies cannot resolve issues related to this message appearing on websites not belonging to &lt;a href=&#8221;http://www.zend.com&#8221;&gt;Zend Technologies&lt;/a&gt;. &lt;h2&gt;What is the Zend Optimizer?&lt;/h2&gt;&lt;p&gt;The Zend Optimizer is one of the most popular PHP plugins for performance-improvement, and has been available without charge, since the early days of PHP 4. It improves performance by scanning PHP&#8217;s intermediate code and passing it through multiple Optimization Passes to replace inefficient code patterns with more efficient code blocks. The replaced code blocks perform exactly the same operations as the original code, only faster. &lt;/p&gt;&lt;p&gt;In addition to improving performance, the Zend Optimizer also enables PHP to transparently load files encoded by the Zend Guard. &lt;/p&gt;&lt;p&gt;The Zend Optimizer is a free product available for download from &lt;a href=&#8221;http://www.zend.com&#8221;&gt;Zend Technologies&lt;/a&gt;. Zend Technologies also developed the PHP scripting engine, known as the &lt;a href=&#8221;http://www.zend.com/products/zend_engine&#8221;&gt;Zend Engine&lt;/a&gt;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;<br />
EOM;<br />
exit();<br />
__halt_compiler();<br />
?&gt;<br />
200407220335061262xù<br />
Ÿ2}W½N#1ö!t‚,Ez„Ñƒvìõ=5=Wœ¢Ä›5ò&amp;Å=Â½/Á# ^€Ž’††‚&#8217;@ºæüŸÍÖÍ|ãÙùÆóc»æ©šéè¼qƒÆØa:×Z`_ÊJÉ¬f%a˜2iŠ¿LW‹ÅŸÓñtjœq‰f­ž\ëÕ@)¥ Bº[ïlRëVœ#’k„ûT‹þ×’w™{/‘ÒøzÜÚWÃS~ú$š·º©çŠ©.¬àÂœ<br />
ñïè¨¶õ.ìBISÈ´Y†# ö8ZÎJ¯ºB_­n…ð¯aüq¦òù~o©õd\_év‡åÑ0„&lt;éâ¬‹‘Hõ}žwI‰d%@u^w¾<br />
uêoÊé¸-³ÝžFµ‹ÜIÀ5Ö‡m~Žð0Ã¸?d˜D˜táÃW®¶Ã8Â´ßïvî»rMÏ¿#_zô0šÝl2;ö/ÈÌ¼5‘ÐbëààmvŒÇRº91Cÿ¾Ë[èŒÿÓ¢BçÆh£FÍj¡Œm$2Fw(öÓ£ãMkvõ<br />
¼uâüÙÀSÏ€}Úö4{„z&amp;HÞ°­É…ÈÐ:çö Â5ƒP^Ì¡”Øö˜Ny<br />
(ã¸â üneÌïF )'„b^Ea»4N(JV²Š#ò¤’Àyjîÿrý—Ä<br />
[/source]</p>
<p><img src="http://172.18.0.13/wordpress/wp-content/uploads/2008/10/encode.png" alt="Come criptare i nostri scripts in PHP - Zend Guard" /></p>
<p>Se volete provare il programma dovete creare un nuovo progetto seguendo le istruzioni, una volta creato vi comparirà una schermata, sulla destra della sezione centrale cliccate sull&#8217;opzione &#8220;Encode project&#8221;, vi troverete il file criptato nella path specificata alla voce &#8220;Output Location&#8221;.</p>
<p><strong>Conclusioni:</strong> Il programma è caro, richiede zend optimizer installato sul webserver e la protezione è facilmente aggirabile, a mio parere esistono alternative più valide e più economiche  .</p>
]]></content:encoded>
			<wfw:commentRss>http://phpblog.it/2008/10/15/criptare-i-nostri-scripts-in-php-zend-guard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Come criptare i nostri scripts in PHP &#8211; Source Guardian</title>
		<link>http://phpblog.it/2008/10/08/come-criptare-i-nostri-scripts-in-php-source-guardian/</link>
		<comments>http://phpblog.it/2008/10/08/come-criptare-i-nostri-scripts-in-php-source-guardian/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 05:00:09 +0000</pubDate>
		<dc:creator>Davide Martignetti</dc:creator>
				<category><![CDATA[phpblog]]></category>
		<category><![CDATA[programmazione]]></category>
		<category><![CDATA[sicurezza]]></category>
		<category><![CDATA[cifrare]]></category>
		<category><![CDATA[criptare]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[source guardian]]></category>

		<guid isPermaLink="false">http://phpblog.it/2008/10/08/come-criptare-i-nostri-scripts-in-php-source-guardian/</guid>
		<description><![CDATA[Questo articolo è un approfondimento di &#8220;Offuscare o proteggere il nostro codice PHP &#8211; Introduzione&#8220;, analizzeremo le funzionalità, i pregi ed i difetti di Zend Guard al fine di criptare uno script PHP. Source Guardian non è l&#8217;unico programma che permette di cifrare uno script in PHP, per la lista completa vi rimando a Offuscare [...]]]></description>
			<content:encoded><![CDATA[<p>Questo articolo è un approfondimento di &#8220;<a href="http://phpblog.it/2008/07/21/offuscare-o-proteggere-il-nostro-codice-php-introduzione/" title="Offuscare o proteggere il nostro codice PHP - Introduzione">Offuscare o proteggere il nostro codice PHP &#8211; Introduzione</a>&#8220;, analizzeremo le funzionalità, i pregi ed i difetti di Zend Guard al fine di criptare uno script PHP.<br />
Source Guardian non è l&#8217;unico programma che permette di cifrare uno script in PHP, per la lista completa vi rimando a <a href="http://phpblog.it/2008/07/21/offuscare-o-proteggere-il-nostro-codice-php-introduzione/" title="Offuscare o proteggere il nostro codice PHP - Introduzione">Offuscare o proteggere il nostro codice PHP &#8211; Introduzione</a>.</p>
<h3>Source Guardian</h3>
<p>Source Guardian (250$, windows, linux, mac), tramite un&#8217;interfaccia che lascia un po&#8217; a desiderare vi permette di criptare il vostro codice. Il primo approcio con la versione Demo è stato ottimo, l&#8217;interfaccia scarna del programma è compensata da una semplicità di utilizzo veramente alta. Con pochi clicks guidati potremo visualizzare il nostro sorgente criptato.</p>
<p><span id="more-160"></span></p>
<p><img src="http://172.18.0.13/wordpress/wp-content/uploads/2008/10/encode.jpg" alt="Encode" /></p>
<p>I nodi giungono però al pettine dopo poco tempo: al momento dell&#8217;esecuzione dello script comparirà la richiesta di installazione di Source Guardian loader, dopo una ricerca un po&#8217; macchinosa sono giunto ad una pagina (nei files di installazione di source guardian) che spiega come effettuarne l&#8217;installazione:</p>
<p><img src="http://172.18.0.13/wordpress/wp-content/uploads/2008/10/error.jpg" alt="Error" /></p>
<h3>Prima</h3>
<p>[source:php]<br />
&lt;?php<br />
function isOnline($address=&#8221;localhost&#8221;, $port=&#8221;80&#8243;, $timeout=&#8221;1&#8243;)<br />
{<br />
@$fp=fsockopen($address,$port,$err_no,$errstr,$timeout);<br />
if($fp)<br />
{<br />
return 1;<br />
fclose($fp);<br />
}<br />
else<br />
{<br />
echo &#8220;Errore numero $err_no: $errstr\n&#8221;;<br />
return 0;<br />
}<br />
}<br />
?&gt;[/source]</p>
<h3>Dopo</h3>
<p>[source:php]&lt;?php @SourceGuardian; 1051555483; 2602881255; //v7.0 evaluation<br />
if(!function_exists(&#8216;sg_load&#8217;)){$__v=phpversion();$__u=strtolower(substr(php_uname(),0,3));$__f=$__f0=&#8217;ixed.&#8217;.substr($__v,0,strpos($__v,&#8217;.',3)).&#8217;ev.&#8217;.$__u;$__ff=$__ff0=&#8217;ixed.&#8217;.$__v.&#8217;ev.&#8217;.$__u;$__ed=ini_get(&#8216;extension_dir&#8217;);if(!$__e=realpath($__ed)) die(&#8216;extension_dir does not exists &#8216;.$__ed);if(file_exists($__e.&#8217;/&#8217;.$__ff)) dl($__ff);else if(file_exists($__e.&#8217;/&#8217;.$__f)) dl($__f);else {$__d=getcwd();if(@$__d[1]==&#8217;:'){$__d=str_replace(&#8216;\\&#8217;,'/&#8217;,substr($__d,2));$__e=str_replace(&#8216;\\&#8217;,'/&#8217;,substr($__e,2));}$__e.=($__h=str_repeat(&#8216;/..&#8217;,substr_count($__e,&#8217;/')));$__f=&#8217;/ixed/&#8217;.$__f;$__ff=&#8217;/ixed/&#8217;.$__ff;while(!file_exists($__e.$__d.$__ff) &amp;&amp; !file_exists($__e.$__d.$__f) &amp;&amp; strlen($__d)&gt;1){$__d=dirname($__d);}if (file_exists($__e.$__d.$__ff)) dl($__h.$__d.$__ff);else if (file_exists($__e.$__d.$__f)) dl($__h.$__d.$__f);}if(!function_exists(&#8216;sg_load&#8217;)){die(&#8216;PHP script &lt;B&gt;&#8217;.__FILE__.&#8217;&lt;/B&gt; is protected by &lt;A href=&#8221;http://www.sourceguardian.com/&#8221;&gt;SourceGuardian&lt;/A&gt; and requires the SourceGuardian loader &lt;B&gt;&#8217;.$__f0.&#8217;&lt;/B&gt;. The SourceGuardian loader has not been installed, or is not installed correctly. Please find the required loader in the ixed subdirectory within your SourceGuardian installation directory.&#8217;);exit();}}return sg_load(&#8216;AAQAAAAMAAAABHAAAACABAAAAAAAAAD/MPqWt4A0hGDqoOPTsBY0RZWEFiSW1kqExXhlpjyQDLwnMRC8v35pX6HyAI+7v3Ow8PdnvlntxY0OSjK47/S16KIMnwGoGnn+RS3NZU/IK+RUOGKterxnfOUmdRO7scw5higAnljyrSheIJ9xpznOtXu84okXfng7KaDUJVHQTnexmk67Hv9lmlTeB3qs7S2poluC+X9Orbf3jJUB81Fxq+mlXpAQ6vnsFPbcagkOm1jByfXqIif7NlZDTYjACjsYlN3SYQbDICuZrHrMp5wNgl+SFXGQ4FYaazeuCL3KTKGSOTPN/U4NVJuEl21MhJ+bfETcmKxSaEI4TjGgrp2PjKNelGWkrKCj7zrBo+UrOBXQaKjFvizt1t4pxNNEiKykkyTDN1X0v0+ivxOqBkIjX4hnR0NJpQ0rsdFN5EnnRJsgbxQIsmGHz+fDvPtuOZNenYtFl4/NKnlOJd9GAcnzUW2Vwnw6WsQ7jIERVeXy5m1720krTsE+DutbBGFe8kHgaXUXtUU0S9b8TwIk7rBkDkiOaITzGKdT+Rk7Xw4p8DEjOFDWZ0IA1IJflsNZuN1WZilX8m05xJzni+bc8fmWdHsblHnKtFKdUylX01gONZ11uSHWPMJoGEcp7uGBTGenLrt5AYUHUisEMjXU1muZi0ipz3DybGtaWVwDuQ59tTVGPViyVzXrPoV5dQTPTyY8zXW7xqEtkQBB5wLAcJo5IYJrjEjWS7M8WkssAf+Ib/eyI2JClqqd/ij2eRtd6XekeuQH5VjoenL5QNnP2QklrkncXzlNK4cwhvRy9sj2Zp11zBAcBWL0Ws7V80Sx/LAZf0frzxSwP0co5kWwf/OSDmNITmCWP8z2gXSu1ApmraB4664UdYxPUHTft8fUjaB5&#8242;);<br />
?&gt;[/source]</p>
<p><strong>Conclusioni:</strong> Source Guardian è un po&#8217; difficile da installare, ha un&#8217;interfaccia che di certo non è delle migliori ma pare che decifrare il codice sia più complicato. E&#8217; anche vero che costa molto meno di Zend Guard.</p>
]]></content:encoded>
			<wfw:commentRss>http://phpblog.it/2008/10/08/come-criptare-i-nostri-scripts-in-php-source-guardian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

