Saturday, February 10, 2007

Am I an engineer?

The most appropriate heading would be "Are software engineers really engineers??". I'll get to that in a minute. According to Wikipedia:
Engineers apply established principles drawn from mathematics and science in order to develop economical solutions to technical problems. The work of engineers is the link between perceived social needs and commercial applications. Engineers consider many factors when developing a new product.
There in another word, CRAFT... according to the Wikipedia again:
A craft is a skill, especially involving practical arts. It may refer to a trade or particular art.Crafts practiced by independent artists working alone or in small groups are often referred to as studio craft.
The only thing that distinguishes craft from engineering is objective logic and intuition. There is no place in engineering for the "feel good" factor. It just a simple cold manifestation of science in a practical form, which in turn is just simplified mathematics represented in language understandable by humans.

So why is software development a feat of engineering? and not a craft?
Now there is nothing wrong with it being a craft. New craftsmen are trained by a master craftsman (something like internship/co-op).. they mimic everything the master does to achieve the end result. This works for general arts and used to work for medical science too few decades ago. So if you were to learn software development as a craft from the "experienced" developers, you would mimic everything they do... even if it involved throwing a dead frog after declaring each variable in a file, and it will not lead to a catastrophe until you are copying everything that the master developer does.

Advancement in technology has given so much slack to us "Computer scientists/engineers" that we do not evaluate the consequences of our action. We do not look at a problem as an engineer in other field would. Take an electronic or mechanical engineer for an instance. How many time have you known that they designed a system that failed or had a bug? Bugs are a commonplace in software engineering. Infact it is widely acknowledged that a shipped software will have bugs.. then there will be an upgrade or a patch released to fix that bug.. and then another..and another ...and so on. This is mostly due to the fact that most software rarely effect human life... but when a "crafty" software developer does write a such a software, we are in for some serious trouble.

Not all the software development fraternity works this way. There are certain organization that are required to develop 99.9% bug free software or risk loosing a million dollars or a million lives. NASA is one such company, a bug in code would mean loss of over a billion dollars.. and guess what! they don't do version upgrades on space vehicles. It does what it is supposed to do. No one is perfect though, the MARS land rover running Linux had a small race condition and that had jeopardized the whole multi billion dollar project... and imagine the mental state of the computer programmers who had the whole world looking over their shoulders, ready to point fingers should anything go wrong. Fortunately they recovered with minor losses. Boeing is another one, from auto pilot to auto land, everything depends on the software... a small bug would not only cause the death of many lives aboard the plane, but would also lead to the destruction of the multi million dollar equipment. Forget the biggies, the real time and embedded software developers are also better engineers because their software control the expensive machineries. Then we have the financial developers like Bloomberg... the whole money making fraternity depends on them, from Goldman Sachs to JP Morgan. A simple miscalculation can lead to a loss of billions of dollars.

I am an engineer/scientist by education, but its my profession that will decide what I really am;an engineer, a scientist, a blue collared programmer or a craftsman. After all as Batman said..
It's not who I am underneath, but what I do that defines me.

Thursday, February 01, 2007

EFS on Minix: Design Issues

I am implementing an encrypted file system(EFS) on Minix3.1.2a. Although the implementation is not all that difficult (infact it is really easy), the design is certainly not trivial.

Lets assume a simplistic case of one user per system and lets assume that his key(or password ) will never change. In such case, the only thing that needs to be done is
  • Reading a block from the disk and decrypting it before placing it in the cache/queue/routine.
  • Encrypting the data before writing it back to the disk.
In Minix3.1.2a, rw_block() is the only function that needs to be modified (I mean the meat of the implementation goes here). This is not a difficult task to accomplish, but the key management and the group management issues are really tricky. Here are some of the issues:

  • A user X has key Kx. His 25000 (say) files are encrypted using Kx. Now a computer savvy guy that X is, decides to change his password. What would the system do now? Decrypt all his files and re-encrypt them using his new key?
  • Here's a solution: Suppose X has two keys K1 and K2. K2 is used to encrypt his files and K1 is used to encrypt K2, so when X logs in, he is able to unlock K2 and read his file. His encrypted K2 is, of course, stored on the disk. Now thats a file too... how will that be encrypted? Who will encrypt it? Remember that the whole purpose of an EFS is to protect the data on a hard disk on an event of physical compromise of a system... and you cant make that file, not follow a rule.
Now X encrypts his file using Kx. Then he joins a software company and is asked to collaborate with other employees. The system admin puts him in a group, the member of his group are his colleagues who share the files. How will other's read his files which are encrypted with his password??

The future looks bleak now... there certainly have been many attempts to solve this seemingly easy problem with no avail. Microsoft provides an ad-hoc solution by allowing individual files to be encrypted. Group access cannot be added although individual users can still be added. This leads to an elongated file header and I don't find this design all that attractive or well thought out. One solution, that looks a bit futuristic, used a smart card but that is not an option in my case .

Hmmmm..... its an interesting problem. Think about it. I will...

PS: There will be few solutions on the wiki pages that I have linked to. They are too complicated to be correct and lack of libraries to do those stuff on Minix will make my life hell if I choose to mimic them... nevertheless it should not deter me from implementing such a system on Minix. And after all as my Professor Per Brinch Hansen says :"Simplicity is intelligence, multitude is stupidity"