Search This Blog

Wednesday, December 30, 2009

Security presentation

Peace be upon you

Today I will not talk to much I have presentation to do I thought that it is better to add first on the blog :), anyways, this should the presentation at "Data Security" subject at the academy I am doing my diploma at, here is the presentation, please your feed back is very important



Thanks for your time.

BR
Ahmed Essam

Monday, December 14, 2009

MARS on iPhone

Peace be upon you

How are you guys? today I am going to show you something I have done as a data security assignment, the assignment was a presentation and application, me and other 3 guys were suppose to write something about MARS and Application, I helped in the Presentation and took the application :D, do you understand anything?

Well, let us begin the whole thing is about encryption algorithm called MARS, developer by IBM, you can find more about it

And here is the presentation


So, the idea is to make application for the ready made code of IBM, so the plane was todo simple application that do simple encryption and decryption, here is snapshots for the application, you can find the code here (Cocoa Touch Objective C project)

Lets see the application.

The application starts with the operation, you have to select wither you want to encrypt or decrypt
Enter the operation Key, in this case the "Encryption key"
Enter the data that you want to encrypt.
Here is the result, and as we use OFB + Random IV, when you reencrypt by just clicking back and next, you will get anther result
HEre is anther result for the encryption due to the IV + OFB
3rd result , Thanks to the OFB and IV
Save the file

Lets do decryption for what we have encrypted
Select Decryption
Then enter the key
Select the file name, you can enter free text in this page.
Now you have got your data


I have added little part for some fun it is the Mode of Operation , you can read more about it here

The mode that I have used was "OFB, output feed back"

I hope that you enjoy the application and the presentation :)
Thanks for your time.

BR
Ahmed Essam

Monday, December 07, 2009

Calling all innovators, The story of Nokia in Middle East

Peace be upon you

How are you guys? Today is not going to be a technical post.

Me and couple of people I consider to be Geniuses made 2 applications and submitted it to Nokia Bel3rabi competition.

I would like to congratulate the First winner "Enpronomics" I know their Marketing Manager, Hany Waziri, and I wish them best of luck

The point today is I want to demonstrate what we have done

1- We did 2 Application Mixing 2 Technologies which is S60 platform and Flash lite
2- Few people dare to take such a step because it takes hell of time to do it

To be able to maintain powerful flash lite application for Symbian it need lots of system services to be able to do what it should do. Based on that we have built a HTTP Server competitive to Kunneri Lite and Janus in Symbian C++ as a way of inter-process communication. The idea was to develop two killer applications and end up with a server API that can be used by the community to enable Flash Lite applications.

Some (not all) things we loaded that server with

1- ADVANCED way to get the location without GPS, We managed to do amazing server that uses cell information and signal strength while you are on the go to get accurate location, this server runs on Symbian device collects information about the Cell towers and Signal strength, using the vector maps, we draw the way that user is taking, after that we can with only, cell tower info + signal strength we can EXACTLY resolve where the user is without GPS. Why we did that because the Location APIs in Symbian used to take so long to get us a location.
2- We did a proxy server, because in certain cases, security restrictions my prevent HTTP request local and to the internet in same time, we beat that by a proxy server that routes the requests from the flash to the internet and returns the response to Flash
3- Sending MMS in the background
4- Record Video
5- Record Audio
6- Advanced web server that do lots of math, Media server (Something like youtube)

But what is our applications about?

1- Ol2ot, this Arabic and English application is a social based application, u can snap photo, video, Audio and send it to our server, SEAMLESSLY in 3 clicks, u can publish a photo with very minimal delay, and it geo tags it for you.

2- Wassal, it is service directory application, this application work in very seamless way, you open the application, select what you want ( food, entertainment, etc ) based on your location you will get results near to you, showed in a map, also there is free text search

Guess what is in the free text search, it is WHOLE new technology, I wish I can talk about but we are working on patenting it, believe me it is something that no one ever done before, reach accurate results

I don't mean anything negative by the next phrase, but the wining app is "Here I Am", send the GPS location using (SMS or Web). It is like one feature of our application. I think that it also sends the message that we live in dangerous country and need a "help button"

From Nokia wiki there is sample for how to get the location using the LBS APIs (it is easy), for the SMS there is sample too, and guess what there is sample to send data over the web. mmm, it has decent interface, it is normal lists and buttons, so almost I can't see anything new. This application can be made by anyone in a few hours and I can extract its functionality from our applications.

For the 2nd place application, I have no comment, it is application that uses lookup tables for calculate the intake calories per day, I can do that in almost week or so

The competition was about Innovation, they calm that they are looking for something new, we have made "new media based social network (ol2ot)", if I knew that they where looking for things like the 1th and 2nd place application, I would do 15 Application like that and post them :D and of course I would get the first and 2nd places :D . But as far as I can tell, Nokia didnt even test our application

At the end, although I am dissapointed, 1st and 2nd place guys did a great job by just submitting, my only problem is, when will we start supporting the things that take vision to see, the things that i really related to innovation. Integration of many complex technologies into usable service that can generate both revenue and valuable data.

I am sorry for the long post and thanks for reaching to this line :-)
Thanks for your time.

BR
Ahmed Essam

Friday, December 04, 2009

Code to monitor your self

Peace be upon you

How are you? today I am giving you piece of code that I think it might be useful for most of us if you care about watching your self.

The code that I am talking about is very simple, the code is just make a snapshots of your open windows and save it in file, it is saved in XML like format, The application collect the open window titles every 10 minutes.

The code uses Windows API called "EnumWindows" to collect all the open window, after that there is a check if this window is in task bar or not, let us see the code, the code has enough comment as I think

Before getting to the code here is link for the full source code, I recommend you build it your self, to avoid any thing bad might come from the binary.

http://cid-e2c1100334a33877.skydrive.live.com/self.aspx/.Public/Code For blog/SanpWindows.zip



// Written by: Ahmed Essam Naiem
// Blog: http://www.ahmed-essam.com
// Summery, The code take snapshoot of the open windows every 10 minutes

// used in the file operations, fopen, wfprintf,fclose
#include
// used in the file exist check,_access
#include

// Public file handle will be used by many functions.
FILE* fileHandle = NULL;

// The function creates the directory that will contain the monitor files
void PrepareDirectoreis()
{
CreateDirectory(L"C:\\MyOpenWindows",NULL);
}

// Call back function for "EnumWindows", the function will get all opened functions
// by their handle, then other operations can be done for that handle
BOOL CALLBACK WindowsEnumerator(HWND hWnd, LPARAM lParam)
{
// Allocating space for the window title buffer
// I did it very large to avoid any lose, also
// I prefer stack variable to avoid memory fragmentation
// in Replacement for that u can use GetWindowTextLength
// then dynamiclly allocate the memory in the heap then do
// what ever with the buffer then deallocate it at the end
// at the end of the function
TCHAR strBuffer[256];
// Clearing memory to avoid memory rubbish
memset(strBuffer,0,sizeof(strBuffer));
// Get the window text in the buffer that we have prevoiusly
// talked about, You will notice that I have used the buffer
// with 1 character less, this kept for the string terminator
GetWindowText(hWnd,strBuffer,255);

// Check if the buffer has something, also check if the window
// is visiable window, without IsWindowVisible we will have TONS
// of windows that we actually don't need
if(wcslen(strBuffer)>0 && IsWindowVisible(hWnd)){
// This line put the buffer in the opened file, with
// XML like format.
fwprintf(fileHandle,L"\t\t\n",strBuffer);
}
// The function return true to keep the getting window handles.
return TRUE;
}

// The main application function, "the Entry Point"
int APIENTRY _tWinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPTSTR lpCmdLine,int nCmdShow)
{
// Preparing the directories that will hold the monitor fiels.
PrepareDirectoreis();
// Getting the current time
SYSTEMTIME sysTime;
GetLocalTime(&sysTime);

// Generating monitor file name that is based on the current date (Day, Month, Year)
char strFileName[256];
sprintf(strFileName,"C:\\MyOpenWindows\\MyOpenWindows[%02d-%02d-%02d].xml",sysTime.wDay,sysTime.wMonth,sysTime.wYear);
// Loop for ever
while(true)
{
// Get the current time to create the monitoring entry ( Hours, Moments )
GetLocalTime(&sysTime);
bool doAddHeader = false;

// Check if the file exist or not, to set a flag to construce XML hearder
if(_access(strFileName, 0))
doAddHeader = true;

// Open file for append, this will help us keeping the old data
// The file handle is a public variable this will help the other
// functions to use this handle
fileHandle = fopen(strFileName,"at");

// Check if the application need to have a header
if(doAddHeader)
fwprintf(fileHandle,L"\n\n");
// Add the entry to the file, it is added with the current time (Hour, moments)
fwprintf(fileHandle,L"\t\n",sysTime.wHour,sysTime.wMinute);
// Enumerate the opened windows.
EnumWindows(WindowsEnumerator,0);
// Close the entry
fwprintf(fileHandle,L"\t\n");
// Close the file, this will allow other applications to see the latest update,
// also will give chance to delete the file (in case u don't like it :D)
fclose(fileHandle);

// Sleep for 10 minutes, of course u can change this intervale
Sleep(1000 * 60 * 10);
} // While closure.
return 0;
}

Sunday, June 28, 2009

Tethering iPhone over any network

Peace be upon you
I have figured out away to tether your iPhone with any mobile network, let us start

The first thing we will need is to write the configuration file, Here is link for sample configuration file, actually it is working for Egypt Mobinil users

http://cid-e2c1100334a33877.skydrive.live.com/self.aspx/.Public/MISC/eg%7C_mobinil.mobileconfig

Now, for each network it will need little bit of effort to make it work, we have to edit the configuration file, here is snapshot for the keys that is going to be modified


"APN" , this is the string that has the Access Point Gateway, you can get this from the operator, or u can get it from any phone with internet capabilities ,


"password" , This is the access point password, get it from the Operator


"Username", This is the access point username, get it from the Operator

"PayloadIdentifier", becareful with this one, because it may change something that u don't deser, I recommend for this one is to be like this pattern "..profile.apn"


for instance

eg.mobinil.profile.apn

This keys is the keys that have effect and will make your tethering work.


After that, put the file on a Web Server and log to it from Safari mobile and install it













Happy tethering :)


Thanks for your time.


BR

Ahmed Essam

Sunday, June 07, 2009

Cheap way to develop for iPhone

Peace be upon you

How are you guys? I am sorry for not posting a lot.
Today I am gonna write how to start iPhone development in a very cheap way, first let us talk about why, I thought about that.
In Egypt we have don't have Apple it self, we have punch of people who has the reseller logo, they offer SUCK service, high prices for nothing, they are even not cool in manner of human treatment, it is like "we sell Apple products, we are from heaven (YAKHHHHH)"
anyways, I have noticed that people likes the idea of developing for the iPhone and how it can get quite good money for simple application, this is happen because of the huge number which is use 1 place to shop for software "App store", the only thing that makes people step back is the prices of the Apple machines, in Egypt we pay double prices so there is always something to be done to get out of this CRAP, high price and need of equipment, so I have started messing around the netbooks as a low end machines that can do HELL of things (little monster)

so what do u need to start?
 - MSI Wind U123x
 - Externel DVD reader
 - Mac OS X (10.5.2 (this what I have tried) or higher) -> Kalyway (get it from http://wiki.osx86project.org/wiki/index.php/Main_Page )
 - Combo Update to (10.5.3)
 - iPhone SDK (get it for free from http://developer.apple.com/iphone )
 - Chain0 (get it from http://wiki.osx86project.org/wiki/index.php/Chain0 )

Here is snapshots for what the operation 

Insert the Mac OS X Kalyway DVD and boot

From the customize screen select the proper kernel and VGA driver 
Now after installing the combo update (VERY TRICKY to be installed) and installing the XCode and iPhone SDK everything up and running and 100% running 

Screen shot from the MSI Wind U123x after having a simple trail.

I will post in detail how to make everything running, I have exams this days so pray for me and I hope that I have much time for my BELOVED blog and BELOVED readers, I really miss the nice feeling when I write something

Thanks for your time.
BR
Ahmed Essam

Saturday, May 09, 2009

NSOpreation

Peace be upon you

How are you guys? I am sorry that it has been long time since last post, but I have exams, work and my beloved iPhone projects.

Now, let us get to the point of todays post, it is about something called NSOpreation and NSOpreationQueue, this classes are part of the "iPhone Threading programming", which means that this things are mostly used when u do some threading in the iPhone app

The point here that makes me really get stunned was that this thing manages that queue of tasks, it is really critical to have something like that done for you, this thing manages that threads combined with locks combined with queue management, imagine that you have some kind of big thing, I will never have example better than Standford CS193p sample, flicker, imagine that you get some list of information from flicker and u wanna display it, considering that it is coming from the web, it will take some time, so there will be a need to handle it really wisely to make user feels Ok and don't get bored from your application, if I am going to do it on Windows, I may use "Threads", "Locks" to handle it and I think it will be a bit headache.

In the iPhone development "as far as I know such class is not exist for Mac OS yet", this classes will save all that time that will be sucked by implement this stuff, I really recommend downloading the sample and check it out, it is available online on the CS193p page, I really wish that I have some time to write example to show you how much it can be efficient to use such thing.
ohh, I forgot to mention that iPhone considered a subset of unix, which means internally it uses the pthread, I think it has all the POSIX , can u imagine that this little device runs UNIX :D

anyways, it was nice writing to you :) and I hope u like it as I do ;)

thanks for your time.

BR
Ahmed Essam

Tuesday, April 14, 2009

Arabic in iPhone Safari Sourcsecode

Peace be upon you

This days, I have forward my focus into iPhone development, actually I have figured out too many things that I miss by not working for Mac :D
I am not going to get into debate or something like that but all I am going to say is "Apple definition for the word 'Framework' is much much much much better than anyone else"
Let us get to what I am coming to say today.

Today I would like to demonstrate some stuff related to Arabic inside WebKit which the core of Safari
I will sort then explain, as I don't have much time I will explain in hurry :D
First, to get the code , you have to download it from Apple Opensource section, here is link
http://www.opensource.apple.com/darwinsource/iPhone/
in the Article I have used the 2.2.1
so let us start with BiDi related function , this function called BidiCharacterRung, I put it here because I have noticed that it has some kind of detection for the Right To Left issue



shapeArabic, If you know about Arabic representaion, the reshaping is the phase which make the Arabic readable by the user

This line I like very much, this code prevent from showing "boxes" if the font is not exist


The function related to previous figure


  1. The first image shows that the Arabic is really solved in manar of character direct, this doesn't mean RTL, you can notice that in Safari because actually it showes Arabic is resolved and corrected but not Shaped
  2. The code showes that there is some work done in many levels, there is some code also to solve Arabic in the SVG render engine, which means that it is ready, I don't know why they didn't use it, may be it is little buggy
  3. I like this part very very much, in OS X, when you use font that doesn't have the glphy"the shape of the character" of the character, it will find anther font that does have a font containe the character, why this thing is very important, it think it is better to see the character than seeing squares :D, you can easily see this in Windows mobile if it doesn't has Arabic support by 3rd party
What do I think about this code is, this code is somekind of memory conuming, as I understand that the code doubles the buffer to manage to solve the bidi issue
I think it should be optimized some how.
anyways, I like the code it is very well commented, I really recommend you to review it,
it doesn't require any thing from Apple products to review this stuff.

I hope that anyone correct me if there is anything wrong

Thanks for your time.

BR
Ahmed Essam

Thursday, March 26, 2009

iPhone OS 3.0 Has full Arabic Support

Peace be upon you
As you know that I have started my tries with the iPhone and I was very annoied because there is no Arabic Support for this Amazing device, now with iPhone OS 3.0 (the used to call it OS X now they call it iPhone OS) you can read Arabic , check out the images 


Arabic in the local application, it means that the strings are in the application, there is nothing I have done more than showing the string.


in the settings you will see that there is Arabic Key board

Now I have tried to use the Arabic keyboard and it is working "I liked it, but it didn't give right to left"

The best of all "Safari" now the browser supports the Arabic and it is working very nice, it is really nice experience to have.

I will not be able to talk much about the iPhone OS 3.0 because of the Agreement.

I am sorry for the low rate of posting but I promise I will be focusing in the blog soon

Thanks for your time.

BR
Ahmed Essam

Monday, February 02, 2009

Meizu M8, The area that no one tries before

Peace be upon you

Today I am going to show you something that is really make me very excited, it is new device, people call it "iPhone clone" but I don't think it is like that, it has the same them but not the point that we call it clone, anyways
first u have to see the device



as you can see, :D it is very much like the iPhone, but it has some extra buttons

here is link for the web site
http://en.meizu.com/


This is the loading window




Desktop or whatever they call it :D


File Manager, it is in some east Asia language that I don't know


File Manager, I meant to show anther photo for it to show you the left side "path Navigation"

Normal "Windows Mobile Application", sure there is no fancy interface because I don't use their libraries

Calender "Looks very cool"

The keyboard, it is VERY much like the iPhone one

When you start writing the "Auto Complete" will help you "Nice feature".
The stop watch :D, Cool application

After pressing the start button, very nice interface interaction


The calculator
I didn't get this device all I have done is I just downloaded the SDK that they provide and I start it simple and clear, here is the link for the SDK
The nice thing is, that this device is "Power by Windows mobile", for all this years there is lots of vendors work on Windows mobile but they never do something like that, this proof that the "Windows Mobile" is very flexible and can do too many things, the nice thing that Windows mobile supports many "Architecture" which is "more than good", this guys "MEIZU guys" have done great work and I really think that they are very professional,
Anyways, I was just trying to show you how much this thing is amazing, by the way, to have the fancy interface you will have to use there library, which is very complex to use regarding to the documentation that is written in Chinese "Please don't tell me to use google to translate it, it is SUCKS + sometimes it gives strange statements"
Thanks for your time :)
BR
Ahmed Essam

Sunday, January 18, 2009

Converting assembly to machine code

Peace be upon you I am sorry because I am not posting to much enough in the last period, I am working on my diploma and eats all the time. Here is something good I have got from this diploma, it is assignment to convert assembly program into machine code. here is the link for the manual that I have used to convert the assembly code into machine code http://cid-e2c1100334a33877.skydrive.live.com/self.aspx/.Public/Manuals/intel%7C_manual.pdf and here is the presentation 

   Thanks for your time, I hope that it is useful.