ZenCrypt — PHP Encoder

Last night, I was searching the internet for PHP Encoders, I always knew that ZendGuard and IONCUBE are the best. However, I thought of giving others a chance. While searching I came across ZenCrypt. One of the good things about it that it doesn’t need a loader on the server-side. Thus, the scripts are self-decodable. But this makes it easy to decrypt. On thier website, they have two scripts. One is the source, and the other is the encoded script.

My Attempt to understand its way of encoding to see if it worth the USD45.

Source PHP Code:

<?php
/* -------------------------------------------------
               www.ZenCrypt.com
             ZenCrypt simple demo

User Manual: http://www.zencrypt.com/INFO/ZenCrypt_PHP_Encoder.pdf
------------------------------------------------- */

//{{{PHP_INSERT_a1}}}
// Encoded chunk of code will be inserted here by ZenCrypt
// Encoded version - test_encoded.php was generated by running ZenCrypt with this command:
//    php -f zencrypt.php infile=test_plain.php outfile=test_encoded.php enccycles=10 stripcomments=yes
//{{{/PHP_INSERT_a1}}}

// This code client will see
$encrypted_number = 52728;

$resulted_number = ZEN_encrypt ($encrypted_number);
echo "\nEncrypted number=$resulted_number";
$resulted_number = ZEN_decrypt ($resulted_number);
echo "\nDecrypted number=$resulted_number";

//{{{PHP_ENCODE_a1}}}
// This part will be encoded and moved above (in between PHP_INSERT tags).
// We do not want to expose these "super secret" encryption functions to the clients.
function ZEN_encrypt ($input)
{
return ($input+5432);
}

function ZEN_decrypt ($input)
{
return ($input-5432);
}
//{{{/PHP_ENCODE_a1}}}

?>

Encoded Code:

<?php
/* -------------------------------------------------
               www.ZenCrypt.com
             ZenCrypt simple demo

User Manual: http://www.zencrypt.com/INFO/ZenCrypt_PHP_Encoder.pdf
------------------------------------------------- */

$juTSvfNAGsrLGell='=ch/5z/T/fd3E73dPj+i+/rRNYcW/rz/sr6zjSNreaXN+nf/W876jLfWtd9fYXR5F3mtYCRhWNW7dOXGPsM19c920z3acnzSfxYMLFxg/Lz0nIz1FfpnLVdf/xksrTZqs55rpk///93fz27zHki6/oWYz1+9boz693v+vwQE52qDxffRSPNxjIf7xOfHb07GgxXHS/CawCIAXw9xuOY/EVs2KuqrxeJFCM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CDV);

// This code client will see
$encrypted_number = 52728;

$resulted_number = ZEN_encrypt ($encrypted_number);
echo "\nEncrypted number=$resulted_number";
$resulted_number = ZEN_decrypt ($resulted_number);
echo "\nDecrypted number=$resulted_number";

?>

My Attempt to Decode the Code:

<?php
/* ————————————————-
www.ZenCrypt.com
ZenCrypt simple demo

User Manual: http://www.zencrypt.com/INFO/ZenCrypt_PHP_Encoder.pdf
————————————————- */

$juTSvfNAGsrLGell=’=ch/5z/T/fd3E73dPj+i+/rRNYcW/rz/sr6zjSNreaXN+nf/W876jLfWtd9fYXR5F3mtYCRhWNW7dOXGPsM19c920z3acnzSfxYMLFxg/Lz0nIz1FfpnLVdf/xksrTZqs55rpk///93fz27zHki6/oWYz1+9boz693v+vwQE52qDxffRSPNxjIf7xOfHb07GgxXHS/CawCIAXw9xuOY/EVs2KuqrxeJFCMTjEENA0ny6gTRUnndy30KTE/uyY77Pa0TWPVyHmqmYQ98Vf+dgq80ne2FgRkZzz1I103xrDgFjbVdXrcq4coJhOlJwGfXOMVavufyVOwpoIna3qQ5ldM+cVFUwoIHxuEbp3t6HEKKHnhi8rDY6aBfCxM9HkjSCeDP5gWj8GO2zaLsMsrsmLaLw605dRJDxFQZcyTe/X5RDaN9pJ0JTlyEzs0b6ds4cIeRg0uf7/INtfOgFECfah6aJz5Z8WbW5XorpGJZQAk/0H4sxB6GZiXZT44QtxETrhcqSgW5rtxHBxfDN6o8R8m7tbItO7uy3VBIRCi7f1Z+g6qkDoFRh3oiPBehlfbWHOCxdljFFxBjWwZhwOG/tAPA/EtX8LOkw3h04N+Ju7F25yDu6L7itrTU2jJ4dhqbPfBXzXg73fIzmZCyYxdmischnH+1voRzSntcnhxhyLfEriTCyEOhlOlzadH8WzfTUst9O3HBBP0U2JxDBRaLNQUeZjSpFWaDrQGUz3zWFYzBrYHUEtIjENWe0YsQpaFChodc7xDgaegxTTZNNb/il0sihsr6TdlVaq6HCfBywAK92VzCMeIJ7/7TfVgUvBr/zeaZJxuB1JTz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Fe+NS+rZeD5jY9KOe6c4adcJMToZDt7F8mEN4isP9okCSxpN1Wvr8cpj+Rwn6xFslssE60hp54EwDmogCfgu1xz9dLGUCP4hk8BQAEPxCJ3+8KALk/4ry59SEHgAsPZW3QeuBJ1xQWsQQHnvphTU/hFcFApGOYgiqw+P2bHPAtahgbhG4g5twGhSmwIIAggBccUccjnrn9Z2wn+ZbQAB1eN9CTMBQMBEE98OApvjbJ2EAYeui/+/PE0n78g542p9K1FhlIIT7xFwOvff919+OIkX675p2SBB7YNRuCWYXBZyvDISuj3SVb’;$QynVyKBtA_laXYfjkJ=’;))))yyrTYefTNAsiFGhw$(ireegf(rqbprq_46rfno(rgnysavmt(ynir’;$LoMOYHmyNmPlxD=strrev($QynVyKBtA_laXYfjkJ);$lUETluMevSaLCDV=str_rot13($LoMOYHmyNmPlxD);eval($lUETluMevSaLCDV);

//print  gzinflate(base64_decode(strrev($juTSvfNAGsrLGell)));

$str=str_replace(“eval”,”\$str=”, gzinflate(base64_decode(strrev($juTSvfNAGsrLGell))));
eval($str);
print $str.”\n–\n”;
//print “–\n”;
for($icount=0; $icount<17; $icount++) {
$str=str_replace(“eval”,”\$str=”, $str);
print $str.”\n$icount–\n”;
eval($str);
print $str.”\n$icount–\n”;
}

// This code client will see
$encrypted_number = 52728;

$resulted_number = ZEN_encrypt ($encrypted_number);
echo “\nEncrypted number=$resulted_number”;
$resulted_number = ZEN_decrypt ($resulted_number);
echo “\nDecrypted number=$resulted_number”;
?>

Conclusion:

What I see that it doesn’t worth the the USD45. Maybe if it was encoded with ZendGuard or ionCube and produces a file that requires a PHP Loader. Just like PHPCipher.
However, from this attempt. I thought that I will write my own encoder. It will be using the same method, however, the output will be encoded in both ZendGuard and ionCube. Stay tuned!

  • Share/Bookmark

Few days ago, I purchase an iPhone 3GS 32GB

Few days ago, I purchased my White iPhone 3GS 32GB. My History with iPhone is long back when I the 2G. I love the changes in the in the iPhone… Specially the feature that I missed much, Copy-n-Paste Text!!! and the New Push notifications!!

I replaced my BlackBerry with this iPhone. It has been doing it’s job perfectly.

  • Share/Bookmark

A new year arrives and new projects to come

A new year arrived, and new projects are arriving… My friend Marwan and myself started having several projects to be developed for the Maemo powered devices. However, after discussion today, we have agreed on developing stuff to be cross platform. Most of our development well be in Python GTK.

The agreement is that Marwan will do most of the development, I will be maintaining the projects. I will be responsible of the packaging and bug fixing and some development. Marwan will be doing the core of the applications.

We will be registering a new domain and it will be dedicated for our joint projects. We have lots of ideas, so wish us luck!!

  • Share/Bookmark

You have Zero Privacy Anyway — Get over it

I have read a very nice article in OSNews talking about that we have a zero privacy on the Internet. I recommend reading it: http://osne.ws/hfv

  • Share/Bookmark

Rain and accidents

Today was a rainy day. Which we are not used to. So we’d expect accidents. Here is an example taken by my N900

  • Share/Bookmark

Story about Love

Story:

‏​وقع طائر في حب ورده بيضاء وقرر ان يصارحها ولكنها رفضت وقالت انها لا تحبه فظل يصارحها بشكل يومي حتى قالت له الورده البيضاء عندما يصبح لوني احمر سوف احبك ففي أحد الايام اتي الطائر وقطع جناحيه ونشر دمائه علي الورده البيضاء حتي اصبح لونها احمر وحينها ادركت الورده كم احبها الطائر ولكن الوقت قد فات لأن الطائر قد مات لذلك عليك احترام مشاعر الشخص الذي يحبك قبل أن يموت لإجلك

Translation:

A bird fell in love with a white rose, and he decided to tell her how he felt, but she rejected him. He insisted and kept on telling her how he felt everyday, until the white rose told him that she will only love him if her color becomes red. So one day he comes and cuts his wings and spilled his blood over her and her color became red. At that time she knew how much the bird loved her, but it was too late since the bird has died.

Moral of the story:
You have to respect feelings of the people who loves you before they die for you.

  • Share/Bookmark

Nokia N900

On Saturday, I got my Nokia N900… Simply this phone rocks! I love this phone!

Nokia N900 Maemo 5

  • Share/Bookmark

Saturday, 21st November was my birthday

On Saturday, 21st of November 2009 was my birthday. It was a very special day for me. Thanks to everyone to made me enjoy my day, and specially my wife. She took me to have dinner in Pizza Italia and prepared a very nice table for me. I love the Aigner package! Thanks for the special dinner honey!

  • Share/Bookmark

Added a feature to my blog!!

I just installed the plug-in Add to Any on my blog. It allows visitors to be able to share my posts using it rather than copying and pasting the links!

  • Share/Bookmark

Beautiful time in the past, I wish I can go back!

Once upon a time, there was the most beautiful part of my life, when:

When my Dad was the only hero,
When Love was my Mom’s hug,
When my Dad’s shoulder was the highest place on earth,
When my worst enemies were my siblings and cousins,
When the only thing that could hurt was a skinned knee,
When the only things broken were my toys,
And when goodbyes only meant till tomorrow.

  • Share/Bookmark

What a messed up world? — What the hell?

I never imagined that my country will end up like this, I always believed and knew that we were raised well. We where the best among all of our neighbor countries. No one cares in my country, no one has respect, everyone is messed up, it is all screwed up!

To everyone is reading this, I tell you, those people are not Bahraini’s they just lived here to have our Nationality, Bahrainis are known to be the best among everyone and everywhere, those people doesn’t represent us.

This is a new article:
News Article -- Bakistani

Summary of the Article in English:
The court in Bahrain convicted a Pakistani Guy for sexually assaulting Bahraini Girl and he will be in jail for ONE month and then to be exiled from Bahrain. The story is that the girl works in a Cloths shop and the Bakistani is a Barber works in a shop next to where she works, they have exchanged phone numbers and lived a 7 months love story. However, she asked her to go to his house, where she did, and he had sex with her (As in the news, man and wife sex). However, she got upset so he apologized and promised to marry her, and it continued asking her to his house and do the same again and again. Until she knew that he is stalling and he doesn’t want to marry her so she went to police and filed a complain about him sexually assaulting her.

  • Share/Bookmark

Setup unixODBC on Linux for Oracle and Sybase

I have been working this week on configuring a Linux server to connect to Oracle and Sybase using unixODBC to be used by a System running on PHP.

So, I thought of sharing my /etc/odbc.ini and /etc/odbcinst.ini since I had a bit of hard time writing them. It may help someone who is trying to figure out how to connect using ODBC on Linux.

Packages Required on CentOS

httpd php unixODBC

Manually Install Oracle Instant Client 11.1 RPM Packages and Install Sybase ASE from the TGZ File.

For Oracle you need to copy all the libs to /usr/lib

cp /usr/lib/oracle/11.1/client/lib /usr/lib/

/usr/lib/oracle/11.1/client/lib

/etc/odbcinst.ini Contents:

[Oracle]
Description     = Oracle ODBC Connection
Driver          = /usr/lib/oracle/11.1/client/lib/libsqora.so.11.1
Setup           =
FileUsage =
CPTimeout =
CPReuse         =

[Sybase]
Description = Sybase ODBC Driver
Driver = /opt/sybase/DataAccess/ODBC/lib/libsybdrvodb.so
FileUsage = -1

/etc/odbc.ini Contents:

[Oracle]
Application Attributes = T
Attributes = W
BatchAutocommitMode = IfAllSuccessful
CloseCursor = F
DisableDPM = F
DisableMTS = T
Driver = Oracle
EXECSchemaOpt =
EXECSyntax = T
Failover = T
FailoverDelay = 10
FailoverRetryCount = 10
FetchBufferSize = 64000
ForceWCHAR = F
Lobs = T
Longs = T
MetadataIdDefault = F
QueryTimeout = T
ResultSets = T
ServerName = //serverip:port/dbname
SQLGetData extensions = F
Translation DLL =
Translation Option = 0
UserID =

[Sybase]
Driver = Sybase
Server = serverip
Port = serverport
Database = dbname

PHP Script to Test ODBC Connectivity:

<?php

$query = “select * from table_name”;

$conn = odbc_pconnect(“DSN”, “username”, “password”);

if(!$conn) die(“Connection failed”);

if($result = odbc_exec($conn, $query)) {

echo “Query returned : ” . odbc_num_rows($result) . “rows”;

odbc_result_all($result);

}

?>

  • Share/Bookmark

Post using my Storm with wordpress client

This is a post using my storm. Now I can blog at anytime.

  • Share/Bookmark

DynoStorm Results for my VW R32

I was really disappointed with my DynoStorm Restults. I will do another run with nothing inside the car, since I had lots of stuff in the car and a friend.

Car: VW Golf MKV R32 – 2009
Mods:

  • Milltek Exhaust with Magna Flow Resonator  (I will take off this resonator and put back the Milltek Non Res Pipe and have another run).
  • VF Engineering Air Intake

Below is my results:

0-100KPH 6.91 Sec
1/4 Mi : 14.54 Sec @ 166.6 KPH

Peak Power: 180 HP ~ Wheel Power ~ Since no drive train loss was entered.
Dyno Storm Graph

  • Share/Bookmark

Attempt to fix the Storm screen click

I have tried to loosen the screws a bit, and it worked. However, I have to do some tweaking now.. Try to adjust until I get my perfect setting!

  • Share/Bookmark

Purchased DynoStorm

Today I purchased DynoStorm, I will post some graphs of my car hopefully tonight!

DynoStorm: http://www.bunsentech.com/projects/dynostorm/

  • Share/Bookmark

I got my storm from repairs..

I got my storm from repairs.. Yet the screen doesn’t click well!! I think I will try losing the screws as suggested here: http://blackberrystorm.wikidot.com/screen-click-problem-fixed

  • Share/Bookmark

Arabic Fonts for Blackberry OS >= 4.5

I finally have done it, I have been resisting to do an OTA package for arabic support for a long time, but now, when I started getting lots of Blackberries from my friends that doesn’t have arabic support and they wanted arabic support (Reading only)… I thought it would be easier for me to give them a link to download the arabic fonts directly to their BB’s.. So, here is the link for everyone: http://www.almahdi.cc/bb/arabic.jad

  • Share/Bookmark

Waiting for my storm to come back from repairs!

My Storm has been sent to repairs few weeks ago, and I am waiting for it to come back this weekend. Temporarily I am using a Blackberry Pearl!

  • Share/Bookmark

Getting a new DSG Gearbox soon

My Gearbox had few issues lately, we have changed the Mechatronic, but yet it is not shifting correctly! I am having hard shifts from 1st to 2nd. Down shifting is always jerky.. After complaining several times, a new gearbox has been ordered for me!

  • Share/Bookmark

WordPress Themes