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.

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.

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.

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. For blog/

// Written by: Ahmed Essam Naiem
// Blog:
// Summery, The code take snapshoot of the open windows every 10 minutes

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

// 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()

// 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
// 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

// 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.
// 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.
// Getting the current time

// Generating monitor file name that is based on the current date (Day, Month, Year)
char strFileName[256];
// Loop for ever
// Get the current time to create the monitoring entry ( Hours, Moments )
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
// Add the entry to the file, it is added with the current time (Hour, moments)
// Enumerate the opened windows.
// Close the entry
// 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)

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