Wednesday, October 24, 2007

Just a thought on hashing..

Hashing is a really powerful tool that can be used to hide data such as passwords.. Hashing is one way, meaning once you hash it, you can't derive the original word from the hashed word. People might ask why hash it if it can't be brought back? Hashing can really be a good tool for passwords, people may have 1 password for all his/her accounts so if someone gets in the database and sees the password, he might be able to access that person's other accounts (bank, email, etc).. that is why passwords are hashed, then how can you compare a hashed password to a not hashed one? It's simple, just hash the "not hashed one" with the hashing that you used in the "hashed one", then compare the 2, if is equal then the password is correct.

I believe that hashing is really one way..because of the algorithm that it uses, but there is one thing that can "cheat" that. Lets say a password is from 6-10 characters long, so create a script that hashes and saved all possible combinations from 6 characters - 10 characters in a table

ex

Table hashtable

normal hashed(SHA1)
000001 0a620481ca00b00de7eedb407a68b9163dcabae3
000002 86dfb043360b0e9ef7767e6ea7ad09fb7fb81537
... ...
... ...
... ...
d3nn1s 7b7edb6fda80187ac8a3f18b2c2b9bfef7a95acc
... ...
ZZZZZZZZZX 3ae4c15d5da68511a49a6171d0df2f7e51207fa6
ZZZZZZZZZY 27fb26c695b91422e048b7ccd2557209472d7fbc
ZZZZZZZZZZ 5df31df13a3fe267e1ae0a35f71bdc70b0249d35

and if your script saved all these in a table, just search for example..

SELECT normal
FROM hashtable
WHERE hashed="7b7edb6fda80187ac8a3f18b2c2b9bfef7a95acc";

by that, you will surely get the reverse of that hashed word..which is d3nn1s, also, hash functions have a fixed length

MD4 = 32 characters
SHA1 = 40 characters

so it gives you a big clue on what hash function was used..unless if you do character stuffing..
and it is also a proof that hasing is one way (before the brute force), for example you hash this string using SHA1 "ang mantech na subject ay napakasayasayasayasayasaya talaga!", the result would be "5df31df13a3fe267e1ae0a35f71bdc70b0249d35", obviously, the string that you used is longer than 40 characters, and the end result is only 40 characters, so how can you derive a combination of 60 characters from 40 characters..it can only be done by "brute force" (hashtable)

Sunday, October 7, 2007

Attack!

The videos that were shown during our class were very interesting for me because creating web based programs is something that I do and the topics that were discussed in the videos were mostly on web based programs.

I have heard of SQL injection before but I didn't know how much things an attacker can do using SQL injection. For me, there are many ways on how to prevent this, or at least minimize the damage (if ever an attack happens).
  • the most basic thing to do is to create a separate user with limited privileges which the web application will use (only the privileges that the application will need, no more) so that if an attack like DROP TABLES is used, the command wont work, unless a drop privilege is given to that user.
  • Second, to avoid getting information about/from your database from a public page, don't put a code that would print information that your database server returns, because if you do that, and an attacker discovers that he/she can inject an sql code, that page would be like a sql client for him/her.
  • This I think is the safest but i think is not practical (last resort), when getting information from forms, encrypt it before connecting it to the sql code, because if you put a textbox on a page and will directly use the string that will be typed in the text box and will put that in your sql code, a hacker can easily inject a code. Surely, when the information from a form is encrypted before inserting that into the code, an attack would be almost impossible but it is impractical because when you view the contents of the database, it will all be encrypted.
Second, I didn't expect that Javascript can be harmful to a web based system. First of all, javascript is only client side and the code does not run on the server, but i didn't think that it can be used to extract cookies from a client, and use that cookie to appear as if you were that person from whom you stole that cookie from.

Lastly, the thing that the guy from microsoft discussed about the attack on IIS, I think that this is really a problem when running a web server on winows. You can easily access files even from other folders by using "../", so if you use the "../" and know the folders of that server, you can traverse the folders of that server and steal some files. I think that this is not applicable in linux, in linux, you can set the permissions of folders. So if you plan to run your own web server, use linux :)

Wednesday, October 3, 2007

Taking advantage..

Viruses for me are okay. I think that this is the fault of software makers. Viruses can be made by people who know a flaw/bug in a software. If this flaw/bug is not fixed, people can do something and take advantage of that flaw/bug.

It is like leaving a 500 peso bill on the ground, surely someone see it and someone would pick that up. Same with these softwares, if you leave a hole open, in time, people will discover these holes and someone would also create something that can take advantage of that hole... So.. if in time, it will be discovered, I believe that viruses are just one of the ways to speed up the discovery of the bug, and is a great reason why they should fix it right away, thanks to the people who make them.

I think that it is one of the responsibilities of computer users to protect themselves from these viruses.

Sunday, September 30, 2007

How much will you charge?

Before I talk about pricing (latest discussion), I just would like to share a thought that I just had. Last week, 2 of my hard drives failed (from seperate computers). Both happened within 1 week, the other pc only had an IDE connection, the other had both IDE and SATA. It was hard for me to decide whether to get a SATA drive or an IDE drive, because for me I dont see any difference in performance between the 2, and I am used to pluggin in IDE devices. I got the SATA because of the reason, that I have entered the IT world, it is something wherein you can say that the only thing constant is change. If I still use IDE, in time, maluluma lang ako..we just have to accept the changes in technology. (kailangan pakisamahan si Pagbabago)

Okay, back to pricing. About a couple of months ago, a friend of mine asked me if I could create a website for their school. They said they'll be in charged of hosting and domain, they just needed the design and the pages, and they will give me a list of things to put in the site. I have done a few websites before but for free so I didn't have any idea how much I'll charge them for this website. I was thinking of charging them 2-3 thousand for the design and pages because I felt that it was really simple. I got surprised that they offered to pay me 9 thousand for a simple website.

When you think about pricing, these are the things that I think you should consider.
  • Intensity of work - how hard will that project be?
  • Materials used - will you buy software/hardware for that project?

and these are additional things you may want to consider..
  • Your/company's name - pag sikat, mas mahal. I think it's a pride thing. When you're known to do something great, you wouldn't want to keep your prices low because you'll look "cheap".
  • You clients name - Like the school that asked me to do the website, It's a small school, but a school that has a lot of money. (i guess, dahil conio ang mga estudyante doon, mga foreigners eh hehe)

I believe that there are a lot more factors for pricing, but I think that these factors are one of the basic things to consider when you're estimating the price for a proposal.

Wednesday, September 26, 2007

Memories...

Its funny when you try to remember what you used to use before.

This is an external zip drive, I couldn't find the disk anymore, it looks like a normal diskette, it's a little bit thicker and the metal cover that opens is smaller.















Who thought that parallel ports (printer) can't be used for drives?














What's inside it? The insides look like the insides of a floppy drive.














If you look at the head, It is also magnetic, not optical.














We got this external zip drive, because when we bought a PC before that was bundled with an internal zip drive, but it was useless because we couldn't use the zip disk it to transfer files from that PC to another PC (hindi pa uso network dati pero may internet na mabagal). I think that this is one of the reasons why ZIP and JAZ failed.

I was thinking of a reason why some memories/disks that come out of the market succeed and some fail (in terms of sales & users).

Lets look at some examples of the disks/memories that became successful. CD writers came long after CD players and VCD players came out. DVD writers came out after a lot of people had DVD players in their homes. USB flash disks came out when computers already had USB ports and a lot of USB peripherals were already being used.

I felt that if manufacturers create a product that uses something that everyone already has instead of creating their own "trend", it has a great chance of being successful just like what I mentioned above.

So this puts another question in my head..Blue ray isn't that popular yet. Most of the people, I think, do not have blue ray players at home, and they are already introducing blue ray writers, and disks in the market.. will blue ray be successful? only time will tell..

Sunday, September 23, 2007

Mantech 3rd Blog

About a month ago, i was trying to look for a DDR ram, because my girlfriends computer was so slow and i found out that it only had 256mb of ram, and the hard disk was full of bad sectors. I am not very familiar with the parts, i know what they are but i dont know the specifics. I went to PC Express, i thought that i could find any computer part here, but the guy said that they don't sell DDR's anymore. I was surprised, for me, DDR's are still new because the PC that i'm using still uses one (old school) and it's just 3 years old. So i went around town center and went to the 4th floor where most of the computer stores are, I checked every store and they didn't have even a stick of DDR, and they all referred me to the store in front of CD-R king. This store had every kind of RAM and a lot of chop-chop parts. I asked the lady if they had a DDR, she said yes, and i asked how much she said P4,300. It's ironic that something that is older and slower is much more expensive than the ones that are being used now (Branded DDR P4,000 vs Branded DDR P1,500). It wasnt the first time that this happened to me, when i went to PCX about 2 years ago, i was trying to look for an RD ram for my 6 year old pc (mga unang p4), the guy literally laughed when he saw me holding that kind of ram. I couldnt believe it, because during that time, there was no core 2 duo or even a core duo, it was still the time of pentium 4 but there was no parts for it.

This story reminded me of our research about IBM, we really should take into consideration the availability of parts when we buy a PC (used or brand new), because if you wont be able to buy upgrades for your pc, you just wouldnt be able to catch up with the requirements of the programs that are released in the market and your pc, in time, will just end up as junk.

Thursday, September 20, 2007

Second Blog

If Charles Babbage had finished the Analytical Engine.....

I believe that the computers now would really a lot more advanced.

But there's one thing that amazes me. If you look at the Analytical Engine, it is mostly (if not all) mechanical. Who could ever think that by turning some wheels, you can yeild some answers.

There are some things in the Analytical Engine that I think can be related to the parts of a modern computer.

  1. First, the rod where the wheels are connected (bottom of the machine), i think that in the computers now, this is the clock. The faster this wheel turns the faster the computer can process data, also all the wheels are attached to it, it keeps the parts synchronized.
  2. The wheels on that rod, I think that the wheels on that rod has some grooves so that when it turns, it can "compute" for the answer or it can be conditions to either change the positions of the flat metal parts on the top, so i think that in modern computers, this is the ALU or the arithmetic logic unit which contains the basic operations and some conditions.
  3. and the last thing i could see that can be related to a modern computer are the flat metal sticks, notice on the left part of the engine, some of those flat metal parts are either pushed or pulled by the wheels, i think that this holds the data, so i can say that in modern computers, this is the flip flops, each metal part can hold 1 bit of data

This is mechanical, modern computers are purely electronic, how did this help in developing modern computers? First of all, i think that if Charles Babbage had created a machine that Automates jobs, it just proved that it can be done. Second, when we solve a problem, it is easy for us to solve something because we understand what the problem means, but a computer doesnt understand that, so he represented the data (numbers) into something that can be manipulated by a machine in order to come up with an answer.

I know that the older computers (older than analytical engine) like the abacus had a way to represent data (used balls to represent numbers), but in order to get an answer, someone should move the balls to get an answer, Charles Babbage was able to make that automated.