Friday, October 3, 2008

Steganography, Hide your secrets ( Part 2 )

Welcome back :-)



Free Image Hosting at www.ImageShack.us


In this article we are going to built a simple tool for implementing steganography by hiding a text message within a bitmap image.

to be able to do so, we have to have a closer look at the bitmap file format structure.
In brief bitmap files can be broken into two sub-blocks which are the Bitmap header and the Bitmap data.the Bitmap header is used to identify the file as a valid Bitmap file.
the length is the header block is usually 54 bytes ( to get more Info. about the header , you can visit this page. )
After the Bitmap header comes the Bitmap data block which is the part we are concerned with in the rest of this article.
The Bitmap data block includes the actual image stored as pixels. In 32pbpARGB format ( which is the most common format ) each pixel is stored as 4 bytes ( byte for Blue ,Byte for Green , Byte for Red, and a Byte for the Alpha component of the Pixel color ).
Each component value of a pixel is stored as 8 bits ( which gives range between 0 and 255 ).
If the value of a component is changed say from 60 t0 61 the change will be really hard to be noticed by the human eye. and this is the trick we will be using.

Now, let's put hands down and start to work ;-)


To start manipulating the Image data block we need to convert the Bitmap image to and from a byte array.

so we are going to write a class called "BitmapHelper" which includes to static Methods:






  • getBytes(Bitmap) : which is used to convert a bitmap image into a byte array



  • getBitmap(Byte[]): which is used to convert a byte array into a Bitmap Image.





class BitmapHelper
{
public static byte []
getBytes(Bitmap imgSource)
{
MemoryStream ms = new
MemoryStream();
imgSource.Save(ms, ImageFormat.Bmp);
return
ms.ToArray();
}
public static Bitmap getBitmap(byte []
arrData){
MemoryStream ms = new MemoryStream(arrData);
Bitmap bmp = new
Bitmap(ms);
return bmp;
}
}

Now we can have the Bitmap block data as byte array ready for manipulation .
Now we're going to write a Library called SteganoLib which has two methods:





  • HideText : which is used to hide text in a given bitmap and return the resultant bitmap



  • ExtractText: which tries to extract a hidden text from the Given Bitmap otherwise it will throw an Exception.




Let's start with the HideText method:

a Text is hidden by making use of the LSB of the R,G, B components of each pixel.

If we wanna for example store the letter A which is represented as ( 01000001 ) and we had the following values of two successive pixels in the image .
01001001 -------> 01001001
011111111 -------> 011111110

10001000 --------> 10001000

10101101 ---------> 10101100

01011101 ---------> 01011100

00101101 --------> 00101100

11001011 --------> 11001010

01101010 -------> 01101011

01011111 --------> 01011110

It can easily be noticed that the changed bits ( red bits ) represent the value of letter 'A'.

you can download and try our tool from here.

Friday, September 26, 2008

Top ideas for Microsoft Imagine Cup 2009 competition

If you need ideas for your Imagine Cup 2009 project, take a look here and see the list of 7 ideas for Imagine Cup invitationals. This year’s theme is “Imagine a world where technology helps solve the toughest problems facing us today.” and I’d like to try and help you with some suggestions.As you can see theme is very broad. How to step up to the challenge and pick up the theme?Here are just few suggestions you can try experimenting with:

World poverty - Explore some new business models targeted at deprived parts of Earth, think about revenue sharing models, micro-credits…

Hunger - Develop and think about new concepts appropriate for smaller communities in areas with lack of water and other resources, how can they produce and sell their products and make a decent living from that?
Sustainability - How to develop community and society in general but without making harm to environment and other resources (think about small farms, recycle ideas, responsible usage of resources, fight against erosion and mudslides with some planning, urban development…). Gender equality - How to empower both genders in all areas of human work, try searching for comparative advantages from both genders, inspire yourself with great figures from history, develop resources for education on this matter…

Fight against HIV/AIDS, malaria and other diseases - This is a big one. Of course it is not expected from you to deliver the whole solution by yourself alone, but think about tools that might ease the work of doctors, improve the quality of service at hospitals, engage patients in their healing process, think about mathematical models for suppression of diseases, play with numerical methods and see how to visualize them and present them in great manner that is both easy to use and to understand.

Climate change and challenges related to that - Mathematical and (geo)physical models, simulations or just awesome education tools for raising global awareness. Think about virtualization and all challenges that might bring in in reducing power consumption but in increasing computing power and development. (I would go and bet on that virtualization thing if I could compete again this year). Anything else that you just think it is great no matter it is not mentioned here (after all this is only my personal list shared with all of you - feel free to add to it in comments and I might event post follow-up on this one).

Bonus hint: Do not try to invent or to create problem - just find solution to existing one. Best tip I can share with you from my personal experience - talk with real people about their real problems and challenges they are facing. Go to NGO’s. eco and environmental organizations, local governments, hospitals. Talk to each and every person or organization you might find interesting. And always, really always, listen to them, and even if their problems might not look as appealing to you as you might expected - think about them more than once. Develop the idea, draw some sketches and then again - talk with them.The United Nations has identified some of the hardest challenges in the world today in its Millennium Goals - look for links and other resources at the end of this article. Take a look at their United Nations Development Goals webpage.This year is bringing some new invitationals: Mashup and Design.

Design is new, you say?

Well, at first, user interface design invitational for Imagine Cup 2009 was cancelled. And now, Microsoft is bringin’ design competition back. Design students from all over the world are happy again, and they can engage in some brainstorming and preparation of their designs. Since UX is my passion, you can be sure I will be keeping my eyes on everything that is happening in this particular invitational.Just to share interesting news with you - I have heard that team Maksuz form Croatia is looking into creating some resources that they might end up sharing with other students into this competition - UXPassion.com will see what is going on and let you all know.

Source: http://www.uxpassion.com/

( Thanks for Abdelmonem Abdelhamid )

Tuesday, September 23, 2008

Steganography, إخفاء المعلومات


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

الأولي




الثانية



..............


.....


...


............


......


...


.


الحقيقه أن الصورتين لا يوجد بينهما أي فرق سوى ان الصورة الثانيه تتضمن بداخلها النص الكامل لرواية دان براون الشهيره " الحصن الرقمي " و المكونة من أكثر من مئة صفحة و تم أخفائها ببراعه بحيث ان يستحيل اكتشافها دون ان تعرف كلمة السر اللي تم استخدامها في عملية التشفير و الاخفاء و للتعرف أكثر على التقينة المستخدمه في هذه العملية يمكنك قرائة هذا المقال


منذ قديم الزمان و كثير من الناس يهمهم الحفاظ على رسائلهم بصورة سريه و قد تم ابتكار و استخدام العديد من الطرق لتشفير هذه الرسائل حتى لا يستطيع أي شخص الاطلاع على محتوى الرساله دون أن يكون على دراية بالطريقه المناسبة لفك هذا التشفير و هذا هو ما يعرف بال Encryption .

أما الطريقه الاخري للحفاظ على سرية المعلومات فتسمي بال Steganography او Information hiding و هي تعتمد على إخفاء حقيقة وجود المعلومه أساسا بحيث لا يستطيع أي فرد من الافراد الغير مرغوب فيهم من رؤية المعلومه حتى و هي مشفرة و أصول هذه الطريقه قديمه و في الماضي تم استعمالها بطريقه ظريفه من قبل الفرس حيث كان يتم حلق شعر أحد الجنود وكتابة الرساله على فروة رأسه

ثم تركه 3 اشهر حتى ينمو شعره ثم ارساله الى المرسل اليه حيث يتم حلاقة شعره مره أخري و قرائة الرساله هناك

و في العصر الحديث و مع تطور و انتشار الحاسبات عادت ال Steganography مره أخري الى الظهر في عام 1985 وتم إثبات كفائتها في إخفاء المعلومات داخل الصور أو ملفات الصوت و الفيديو., تقوم هذه البرامج بتشفير البيانات اولاً ثم إخقائها داخل الملف الذي سوف يقوم بحملها و الذي غالبا ما يكون ملف صورة أو فيديو.أما عن طريقه الاخفاء فعلى فرض ان كل pixel في الصورة يتم تمثيلها ب عدد 24 bit فانه لوحظ انه لو تم تغيير مثلا 2bits من هذه pixel فان التغير في اللون لا يكون ملحوظ للعين المجرده لذا يمكن استخدامها في تخزين النص المشفر و هذا هو المبدأ المتبع في عملية الاخفاء.فيكفي لأي من يريد نشر رساله سريه على الانترنت ان يقوم بإخفائها داخل صورة و نشرها على مدونته و إعطاء كلمة السر فقط للاشخاص المسموح لهم بالاطلاع على هذه المعلومات .

To be Contd.


Monday, September 22, 2008

Hi, I'm MSP!

Dear MSPs 2009,

It pleases me much to write to you. Happy New Academic Year 2008-2009 and Congratulations for being chosen as MSPs for your universities.

In this section, we're going to introduce each others so that we can keep in touch in both technology and lifestyle sides wishing that we'd become all forever friends!

I'm Ahmed Mahdy, student at the final year Computers Engineering & Automatic Control, Faculty of Engineering, Tanta University. I'm 21 yrs old. I was chosen for MSP for Tanta University http://sites.google.com/a/eng.tanta.edu.eg/msp since March 2006 when I got nominations for the Microsoft MVP Award and was pleased to contact Microsoft Egypt's ADE/MVP/MSP Mohamed Wahby. Accross very long days of Microsoft based activites, sessions and promotions at university, I was finally nominated for the MSP position as the first generation of MSPs at Tanta University and what's known as MSP Tier 2. I wasn't lucky that I didn't receive the inivtaion mail from Wahby to attend the first MSP session to meet you, guys! Well, I had an early peer to peer meeting with him last month, maybe he doesn't want to meet one person twice a month ;-)

My alias is: ahmed.mahdy (at) student-partners.com
My blog: www.ahmed-mahdy.com
My user group: www.nativedotnet.net
Anyone want my facebook? Search me or e-mail me ;-)

Note:- Since we are Microsoft Official Representatives, it's not good to use Google Blogger as our main gateway ;-).

Regarding MSP Egypt, there is an under construction site"http://mspegypt.com" created by former MSP "Ahmed Fathy", MSP Alexandria (He is MSP 2009 again?) and if not possible to host it, I have my subscribtion in Windows Server 2008/IIS7/.NET 3.5 SP1 host I use for my user group to host our MSP Egypt official site ;-)

Well, I won't add longer biography about me right there, I'll let you the chance to edit this post to add your introductory information and notes.

Wednesday, September 17, 2008

.NET application now available on Symbian










on






.Net developers can write mobile applications easily using C# or VB.NET but those applications can only run on devices that are running using Windows Mobile.
Unfortuantely , those applications can't run on the most popular phones like Nokia,Sony erricson,...etc. as there's no implemention for the .net compact framework on those devices.
A 3rd party company called redfivelabs has released an implemention for .Net CF that can be installed on Symbian devices and this is supposed to enable .NET mobile applications to run unchanged on Nokia & sony erricson phones.



.NET CF applications are compiled to Intermediate Language code by language compilers such as those included in the Microsoft Visual Studio suite of IDE's. Similar to the intermediate step performed by the Java Virtual Machine, the Red Five Labs .NET Compact Framework just-in-time compiles the Intermediate Language (IL) code into Symbian OS native code (supporting the ARM architecture based microprocessor) for on device execution.

for more info:

You can download the Data Sheet for Net60 from here & order the trial version of net60 from here

I hope it will success and the .net CF will be included on the rom of those devices, since this will open alot of opportunities for .NET developers .