Christian's Bloghttp://christianbeikov.at
This is the blog of the Main-Programmer of Blazebit, Christian BeikovMon, 15 Feb 2010 07:58:43 +0000enhourly1http://wordpress.org/?v=3.0Design Patterns – Abstraction with PDOhttp://feedproxy.google.com/~r/ChristianBeikovsBlog/~3/aAuVlqjxkAc/
http://christianbeikov.at/2010/01/design-patterns-abstraction-with-pdo/#commentsTue, 12 Jan 2010 09:58:42 +0000Christian Beikovhttp://christianbeikov.at/?p=130Today I want to write about some design patterns. There are really many out there and I want to summarize them a bit for you.
I will not write about design patterns of a specific language but for general. Many of them are really usefull!

Don’t you have sometimes the problem that you don’t know how to begin when you are programming a class or so?
You are thinking and thinking of how you could design the class or class hierachy (Polymorphism) that it is easy to understand, lightweight, not so much time consuming to implement it and so on…
Then after hours of thinking you have a solution but you are never sure if it’s really okay like that. You just implement the class and if something does not fit you have to change it.
But now think of it, is that really reasonable? You put so much time into designing a class or class hierachy but for what? That you can change everything in let’s say 200 files where you used that class? That shouldn’t be!

As an example we take a communication with a database. The standard in PHP is to use MySQL, that’s okay but what happens if you want to use PostgresSQL now? You maybe will have to change every query statement because it can be case that in this dialect something is written different than in the other. So it’s hard for use to change the database system just by replacing the connect call to a new one. We not only have the problem with the SQL statements, but you have to change the calls of the SQL statements too.

Here we don’t have a problem with the SQL statement, but what happens if you use the function mysql_query for about 500 times in 200 different files? Try to change that! Somebody will probably say now that there are tools which you can use to make such mass operations, but that’s not the point! What do you want to do now if we have a SQL statement that is not compatible to other SQL systems? You have to change nearly everything in your application to correct that. It’s really time consuming, so we should try to get to find a solution.

First of all think about something like a DAO class. DAO (Data Access Object) is really nice and saves you a lot of time. In a DAO class you make methods which give you back objects as result. Let’s say you have something like showing news on a website. Then make a method getNews() and just use that method everywhere you need the news. You can define parameters for that method and so on but you always get let’s say an array of news objects from that method. That’s really nice because you don’t have to think about what the name of the column was and so on, your IDE will suggest the methods and variables. This kind of system is very simmilar in some points to an ORM (Object Relation Mapping) system which don’t has any foreign keys but the objects which is related to the foreign keys. Of course you still have to implement data classes for each table but this will help you a lot.

So now we have a DAO object which handles the connection to the database and provides methods which give us arrays of objects but we still have the compability problem to other systems, for this I suggest to use PDO (PHP Data Object) in PHP. In Java we have JDBC, in .NET Linq and so on. With PDO you have only one class which uses drivers to communicate with the database systems, you only have methods like query() and fetch() so we don’t have to rename the calls any more.

As you can see, it’s easy and the best is, if you change the database system, you just have to change the connection string!

I hope you enjoyed this article and you will go on reading my texts about design patterns!

]]>http://christianbeikov.at/2010/01/design-patterns-abstraction-with-pdo/feed/1http://christianbeikov.at/2010/01/design-patterns-abstraction-with-pdo/Blazebit CMS Presentationhttp://feedproxy.google.com/~r/ChristianBeikovsBlog/~3/JeFiezsDVmQ/
http://christianbeikov.at/2009/10/blazebit-cms-presentation/#commentsWed, 21 Oct 2009 16:46:03 +0000Christian Beikovhttp://christianbeikov.at/?p=161I finally got the OK of my teacher! The CMS is still in development but I hope that it will be completed for the “Day of the open door”!
If you are interested and you are from Austria you can watch the presentation live!
Otherwise I can offer you to check the CMS yourself online with a demo account.

If anyone is interested in watching the live presentation just make a comment then I will post the address and when the presentation will be!
Here again the account for testing the Blazebit CMS.

The CMS will change a lot in the next weeks so don’t wonder when we get a new design and new functionalities!

]]>http://christianbeikov.at/2009/10/blazebit-cms-presentation/feed/0http://christianbeikov.at/2009/10/blazebit-cms-presentation/Presentation of Blazebit CMShttp://feedproxy.google.com/~r/ChristianBeikovsBlog/~3/nnZskOansKs/
http://christianbeikov.at/2009/10/presentation-of-blazebit-cms/#commentsMon, 19 Oct 2009 19:23:13 +0000Christian Beikovhttp://christianbeikov.at/?p=141In school we have a day on which everyone can come and take a look of how that school is and so on. Translated into English it’s called, “the day of the open door”.
There we, Bernd Artmueller and I, are probably allowed to present our Blazebit CMS to the visitors.

We are really proud of it and when we get the final decision about that I will try to complete the CMS until that day. The CMS will get redesigned by Bernd Artmueller and we will also get a new Webdesign for our portfolio.
There will be many companies to look at how the students are doing and with that CMS we will be probably the stars of the day

So in the next days I will let you know how it is going on.
By the way you can test and check our CMS if you want to.

At the moment we are changing the structure a bit so there will be major changes to the CMS.

I hope you like it and maybe give me some feedback of what I could change!

]]>http://christianbeikov.at/2009/10/presentation-of-blazebit-cms/feed/0http://christianbeikov.at/2009/10/presentation-of-blazebit-cms/Cracking Hasheshttp://feedproxy.google.com/~r/ChristianBeikovsBlog/~3/3L2si52ye1o/
http://christianbeikov.at/2009/10/cracking-hashes/#commentsSun, 18 Oct 2009 22:01:52 +0000Christian Beikovhttp://christianbeikov.at/?p=68Today I found a website which really scared me! I want to share that with you because I think it’s important for everyone who ever dealed with passwords.
I looked for something like a SHA256 Cracker on google to be sure that it’s not crackable.

First of all some information on SHA256, it was developed by the NSA (National Security Agency). SHA is the abbreviation for Secure Hash Algorithm and is one of the most secure hash algorithms.
A SHA256 hash has 64 hex characters so if you want to save that into you database you will need a 64 byte for a hash. With growing technologies like GPU Computing you as a programmer have to use more complex algorithms to be sure that the hashed passwords can’t be cracked.

Now to the point, LM Reverse and Hash.Db.Hk have big databases which contain already many SHA256 hashes. Mostly they can only crack simple ones but the new technologies will help the crackers to guess or maybe even reverse hashes.

I would really recommend you all to use SHA512. Performance should not be a reason for you to not use SHA512. Here is a little comparison between the hashes, all calculation times are in milliseconds. The times were measured on a laptop, so on a productive webserver it is even faster!

Hash

Calculation in ms

md5

6.89

sha1

8.88

sha256

19.02

sha384

45.10

sha512

45.65

These calculation times are from PHP.NET so as you can see SHA512 takes twice as long as SHA256 for calculation but your applications will be more secure! SHA512 has 128 hex characters and I haven’t found any database yet which you can use to get the plaintext from a hash. The only way to crack a SHA512 is by using a password dictionary and for this I would recommend you to use a SALT.

The SALT should contain special characters like ‘$’, ‘%’, ‘&’ and so on. With the special characters it is much harder for a cracker to crack the hashes with dictionaries!

Nice heh? 128 hex characters! =D
I hope you enjoyed this article and you will try to use SHA512 instead of MD5, SHA1 or SHA256!

]]>http://christianbeikov.at/2009/10/cracking-hashes/feed/0http://christianbeikov.at/2009/10/cracking-hashes/Calling via TAPIhttp://feedproxy.google.com/~r/ChristianBeikovsBlog/~3/8jFGySx3BqU/
http://christianbeikov.at/2009/10/calling-via-tapi/#commentsWed, 14 Oct 2009 13:17:13 +0000Christian Beikovhttp://christianbeikov.at/?p=66Some days ago i finished a project which was about using the TAPI. I will give you a short introduction into TAPI and give my example for that project.

Here a short description about what TAPI is.
The Telephony Application Programming Interface (TAPI) is a Microsoft Windows API, which provides computer telephony integration and enables PCs running Microsoft Windows to use telephone services.
With it you can control a telephone which uses this TAPI. You can listen for calls, make calls and many other things.

For this project I only needed to make a call by clicking on a number in the browser, of course it should work in every browser.
First of all we will check how to get the number from the browser to the telephone. A client has installed the telephone so we need a client solution. So what can we do on the client to pass a number as parameter via TAPI to a telephone? Probably via desktop command line application which is using the TAPI-Library.
Okay now we know how will communicate with the telephone, but how will that application get the number from browser?
On way could be via Javascript, which is probably not realizable. The other choice and I think that’s the last option we have is to register a new protocol, like HTTP. So we have for example something like “phone:0123456789″ instead of “http://…”.

How can we register such a protocol now?
I don’t know how to do that on UNIX Systems but on Windows we just need a registry entry!

This batch file creates the directory TAPI on C: and copies the files which are needed and finally executes the regedit file.
Now we just need the program which sends the number to the TAPI-Device.
I decided to use C# because I found a TAPI Library for C# and of course because I know C# really good.
It is easy to make programs with C#, you can be really fast and the community is really big.
I used an example from Codeprojects to test the dialing process and the final solution look like that…

Here you can see the main method which takes the main parameters and parses it.
Don’t forget to include the TAPI-Library.

Finally the call method which takes the number as string. Here i use the line which name contains “Agfeo” because the TAPI devices are from Agfeo.

When you click on a link now which has the value phone:123456 in the href attribute the program sends the number 123456 to the TAPI device to and starts the call.
This is a browser independent solution of using your own protocol on a windows machine via browsers.
I hope this helped you a bit if you try to make something like that.

The Visual Studio Project is in the source files which you can download here.

]]>http://christianbeikov.at/2009/10/calling-via-tapi/feed/0http://christianbeikov.at/2009/10/calling-via-tapi/Secure Session is pendinghttp://feedproxy.google.com/~r/ChristianBeikovsBlog/~3/tsyVpeta-Mo/
http://christianbeikov.at/2009/10/secure-session-is-pending/#commentsMon, 05 Oct 2009 20:23:55 +0000Christian Beikovhttp://christianbeikov.at/?p=55Again you guys have to wait for my new tutorial to get posted on Nettuts. This time we I will explain you how to set up Secure Sessions with an little example. I don’t want to tell you too much, look forward when it gets posted!

By the way it uses the Crypter Class, so if you have not read that article so far check it out here.

]]>http://christianbeikov.at/2009/10/secure-session-is-pending/feed/0http://christianbeikov.at/2009/10/secure-session-is-pending/Writing a Diploma in Programminghttp://feedproxy.google.com/~r/ChristianBeikovsBlog/~3/MUfQBx1z0mI/
http://christianbeikov.at/2009/09/writing-a-diplom-in-programming/#commentsSat, 26 Sep 2009 17:42:43 +0000Christian Beikovhttp://christianbeikov.at/?p=49Reporting in the project SAS III
SAS (School Administration Software) is a big program for schools in Austria.]]>Hey guys out there!

I wasn’t active for a long time now. I had really much to do so far.
I worked a lot in my school holidays in Graz which is located in the south of Austria (Styria).
3 weeks ago the school started and now I will write a diploma in programming.
Because I have to document all the stuff I do I will keep you update of what I am doing.

Here a short introduction of what I will do…

The project is called, Reporting in the project SAS III
SAS (School Administration Software) is a big program for schools in Austria.
Many schools use this to manage all things they need for a school year, for example managing data of students, teachers, other personal, generate lists of classes and so on…
There are really many functions. You can’t imagine how big it is.
Yeah and my job is to make the reporting for that system.

It’s not easy because at the moment there are about 200 different reports, and these reports have to be available in formats like, XML, CSV, PDF and many more.
So it’s a hard thing to write those Reports all by hand. That’s why we will use JasperReports!
I will tell you more soon, now we will make a kind of study about the topic Reporting.

]]>http://christianbeikov.at/2009/09/creating-a-crypter-class/feed/0http://christianbeikov.at/2009/09/creating-a-crypter-class/Waiting for my tutorial to get postedhttp://feedproxy.google.com/~r/ChristianBeikovsBlog/~3/upjrMUZEoNw/
http://christianbeikov.at/2009/06/waiting-for-my-tutorial-to-get-posted/#commentsTue, 16 Jun 2009 06:01:32 +0000Christian Beikovhttp://christianbeikov.at/?p=29At the moment I am waiting for Nettuts to post my tutorial which is called, ‘Creating a Crypter Class’. I hope you will read it when it is published, I will post you the link to it as soon as I get the information that it is posted. It is about encryption and decryption of any data with a given password.

Special thanks to my good friend and classmate Bernd Artmueller (www.berndartmueller.at).He designed this WordPress Theme and gave it to me for my blog. It is really nice and I know that he has a lot of potential! Great work mate, as go on like that!

Well now something about me and my wonderful life! My name is Christian Beikov and I am 18 years old. I currently live in Boeheimkrichen in Austria, but I will move soon to Kapelln, which is located just a few kilometers away. I have a girlfriend called Alex and I really love her, I think she is the one I want to marry someday, nah I am absolutely sure that I want to.

I started with project oriented programming about 2 years ago. A schoolmate and I wanted to make a game programmed in C#. We learned how to work together and finally decided to set up a new project after we succeeded our game project. That was a simple website for his uncle and we did a really nice job! I made a simple CMS for his specific content which was realized with the Dojo-Framework in the Frontend.

Now we want to found a company and sell our software. You can visit our site here: http://www.blazebit.com. And now we’re currently working on our own CMS and searching for new clients.

I will try to post at least every week a new tutorial about PHP classes or some other topics related to programming (including the source files).

I hope you will like my tutorials and would be really pleased if you visit my again!