Archive for November, 2009

Cryptographical Analysis Tool

Tuesday, November 24th, 2009

Hello  everyone.
Recently I have “Computer Communication and Security homework” to do. They consist of many problem involving encryption/decryption algorithm. One problem let you try to decipher all the text, it’s an english prose.

vcwpc kwblm smljy glbgu gbtwj jyats
lwsgm lwjjy vcrfc rikwl qjwte fscpw
lbgqm jwscb ktpbc pqats vfwsm dvwpw
lbsfc ktrfu wtlsc brpgk cmdqj wtefs
cpgle vfmjc ncmnj cq

After seeing this kind of problem, I thought to myself, I gonna break its code in no time. Ha ha ha, you know that up until now, I even don’t break it yet.

What I start to take the approach here is as follow.
1. Character/Word analysis
2. Algorithm analysis

Up until now, working on 2 days ago, I am at the first stage.
By trying to catch the pattern of the words that most frequently appear in the english literature such as ‘the’. And similar word that you should be fimilar with. Not quite close to target now, but along the process I have created a tool to analyze the encrypted text. Note that all of programs below will operate on only plaintext.
They are
- charCount, the program to report the frequency of english plaintext character, it can report in absolute value, relative value, or percentage
- patternCountN, the program to report about the pattern found in the encrypted text, the occurrence for each pattern must be at least 2 or above in order to treat that one as significant. Also we can specify the number of maximum number of individual pattern to find in such encrypted text too.
- simpleSwap, the program to swap the character as user defined via config file.
- caesar-d, the program to decrypt the caesar algorithm, it accepts ‘key’ as parameter in order to decrypt differently with each specify key (usually from 0-25)
- testCaesar, the wrapper program to execute caesar-d program to generate report for all 25 keys possible to decrypt.

All of those programs are created with DevC++ 4.9.9.2, under gcc compiler. I use combination of C/C++ to create.
They are tested primarily on Windows 7. But it requires much less modification of codewhen porting into Ubuntu.

When working with C/C++ language I feel the power of them, and the low level in which you must do almost all the task by yourself. So you should know just everything. In fact it can’t be true. But at least it can help us out to build the firm ground right?

I included all the sourcecode which you can look at, modify, and learn by yourself later without any license!

Each program also accepts some parameters too. Just look at the comment above in the sourcecode.
I point out to you below anyway.
- charCount
   charCount [-r, -p] <input file>
   -r, will generate the result in relative frequency
   -p, will generate the result in percentage
   <input file>, is the input text file

- patternCountN
   patternCountN <input file> <output file> <N>
   <input file>, is the input text file to find patterns
   <output file>, is the output file for report to be generated
   <N>, integer number defined the maximum number of character for individual word to be find in pattern

- simpleSwap
   simpleSwap <config file> <input file>
   <config file>, is the user’s config file defined for characters to be swapped
   <input file>, is the input text file

- caesar-d
   caesar-d <input file> <k>
   <input file>, is the input text file
   <k>, is the key used in the caesar decryption algorithm (possible is in range of 0-25)

- testCaesar
  
no parameter for this program.

Okay, I think you might want to have a hand on those tools already.
Please enjoy, and let me know if you like or dislike!!

Download Section
- charCount, sample of output file (copy from stdout)
- patternCountNsample of report file
- simpleSwap, sample of config file
- caesar-d, testCeasar
- sample of encrypted text file (cut out space)

Give me that low level of control

Saturday, November 21st, 2009

After fully 1 year and a half for that of object oriented game programming with C#, XNA, it turns out that I can develop game with pace, and quite clean in architecture.
Newcomers should be able to create game in no time with XNA framework. But one interesting point is that “how well they know the underlining world powered what you see?”. That’s one kind of tedious question, and if you try to answer it, it can block down your step and scare you not to further develop your game with your high level of programming -> it’s just the case for me now.

I never learn the formal basic of multimedia graphics before I have coding those fancy engine that released out to your eye. It’s some kind of big jumping with no firm in the base. Right now, I just realize that I really want to back and build my base as firm as possible before I go next further.

This will not be the case for others to follow, but at least for me here, so you should listen to what I said with one ear open.

My choice to revive my firm base is OpenGl, it’s opensource platform for graphics library.

It’s not quite equal in flexible as DirectX to work with, and this is the reason that I choose it to draw my path down into detail. I started to think that if I can understand low level as much as possible, then I can adapt it and build or extend from it to bigger thing later on. Range from the matrices stuff, work it in detail not from the automatic method to generate one for you (at least it’s close enough for OpenGl.), others stuff like integrated others opensource library into use with your own graphics engine to form the full-house game engine is the way to go for opensource approach.

Recently, I got an idea on integrate scripting component like Lua library into engine, integrate sound system into use (manually bind them yourself), and manually develop the self AI system embed into engine itself too.

I should cut it now and say that my plan in this period of time is to create an opensource game library for 2D (or 3D if the time is not that tight) stuff (of course benefit me for learning and others if they find useful to use). And let’s see how it going in the next 6-12 months plan.

I didn’t mean that OpenGl is superior. What I mean is that, for some reasons you should choose the possible-best one that suit you most, and can drive your passion along with motivation apart from flexibility and pace. Thus you can get what you got in the previous approach and make use of it in the next move, just as I will do mine now.

Sorry if you can’t understand what I mean here with this post.

Now it’s time to get down into it!!!!

*I will keep you update about it along the way.

RealKo Engine updated

Wednesday, November 11th, 2009

Hello you guys.

I have updated RealKo Engine to fix the issues proposed by users at

Aeronautical Radio of Thailand LTD.
There are major 4 issues as follow.
1. Lots of resource being loaded is too large, slow loading process should be avoid
2. Changing the new offset of airport should affect others transportation object (airplane, cars, etc)
3. Be able to flexibly add new type of airplanes.
4. Option to enter the test scene, for fast debugging and testing simulation
I have written the possible solutions into text files which you can download it from the link below.
Issue 2, 3, and 4 are already fixed but left 1 as the long process to tackle down.
If you want to see more detail about how I tackle those issues, please those downloadable file below.
[Brief]: For what I can say to you now is that, RealKo Engine can now flexibly add new type of airplane. In fact, I have changed the name, and internal format of airplane to transportation object to let it be more generic and support wide range of objects in the simulation. So they can be airplanes, cars, helicopter. Ha ha, thus now very flexible to use.

For a little more detail, the transportation object now consists of 3 rotateable meshes, users don’t need to specify them all in the config file, but they are all optional. This way, by becoming more and more generic in the format, the good is given to users. You can see the detail of format of transportation of config file from the same solution file below.

The main problem is the resource management and loading. I have tested it, and it requires at least 2GB to handle those models, airplanes, and etc. Note that those model of airport and airplane is the most complex one that will be really use in the simulation, it’s Suvarnabhumi Aiport. So if I can tackle and find the way of rewriting the content management to be more efficient then it will cover all others airport. :)

And I want to say that from now on, a changelog will be available so you can see what’s updated.

See you next time.

[Download: Solution File
, ChangeLog]