Sunday, November 2, 2008

::Basic Java Cryptography, How to Program::

Bijairimi Abdul Awal, Romain Babel: DSV KTH, 2006


Intro

This article is about basic message confidentiality. When we talk about confidentiality, we would eventually run into cryptography, which involves two processes; encryption and decryption. In this article I write a code that implements two cryptographic algorithms; DES and RSA, together with Base64 encoding standard which is used to encode data traverses over the Internet.

Selected algorithms

Secret key cryptography

DES stands for “Data Encryption Standard” and is the archetypal block cipher; which means that the algorithm takes a fixedlength string of plaintext bits and transforms it through a series of complicated operations into another cipher text bit string of the same length. The transformation is performed thanks to the secret key. Then the sender and the receiver will share the secret key. This key has both encryption and decryption feature.
Public key cryptography

RSA is named after its creator Dr. Ronald L. Rivest, Dr. Adi Shamir, and Dr. Leonard M. Adleman. The public key cryptography use two keys; public and private. The sender messages will be encrypted by using the target/receiver's public key and only can be decrypted back by the receiver, by using his/her private key. The security of the public key cryptography lies on the difficulties of factoring large numbers.

Base64 encoding

Base64 encoding/decoding is used to encode the arbitrary data into the plain ASCII text, and to decode the plain ASCII text back into the original form of data. By using Base64 encoding, all types of data are possible to be sent through email via the Internet. Base64 encoding is very important to make sure the arbitrary data that is generated and been sent from one platform of system such as Unix, is readable and accessible by the receiver which might be use a different kind of system such as Windows.

Implementation and description of the code

Both, DES and RSA encryption code is compiled and built on Sun Java 1.5 and eclipse platform version 3.0.1 and for Base64 encoding, I use an already written public class Base64 by Robert Harder.

DES

First the secret shared key is generated,

key = KeyGenerator.getInstance("DES").generateKey();

and then stored into the value key. Now select DES algorithm, CBC mode and PKCS5 padding for ecryption and decryption:

Cipher.getInstance("DES/CBC/PKCS5Padding");

A Cipher object obtained from getInstance must be initialized in one of the two modes (encoding or decoding), which is defined like final constant integer in the Cipher class. The reference name for these modes are:

  • ENCRYPT_MODE
  • DECRYPT_MODE

Each method of initialization takes a parameter mode (opmode) and initializes the Cipher object for this mode. Other parameters include the key (key) and parameters of the algorithm (params):

encrypt.init(Cipher.ENCRYPT_MODE, key, paramSpec);
decrypt.init(Cipher.DECRYPT_MODE, key, paramSpec);

Now we can use those variables to write the encryption code which will retrieve cleartext data from an input file and convert it into ciphertext and write it into an output file:

public void encryption(InputStream cleartext, OutputStream ciphertext) {
try {
ciphertext = new CipherOutputStream(ciphertext, encrypt);
int numRead = 0;
while ((numRead = cleartext.read(buffer)) >= 0) {
ciphertext.write(buffer, 0, numRead);
}
ciphertext.flush();
ciphertext.close();
} catch (java.io.IOException e){
}
}

The decryption it is the same as the encryption. The method reads each character, decrypt it, and write the decrypted text into a file (the file name is “cleartext”):

public void decryption(InputStream ciphertext, OutputStream cleartext) {
try {
ciphertext = new CipherInputStream(ciphertext, decrypt);
int numRead = 0;
while ((numRead = ciphertext.read(buffer)) >= 0) {
cleartext.write(buffer, 0, numRead);
}
cleartext.flush();
cleartext.close()
} catch (java.io.IOException e) {
}
}

In my test function, first apply the Base64 encoding standard

InputStream in = new Base64.InputStream(new FileInputStream("desCleartext.txt"), Base64.ENCODE);
FileOutputStream out = new FileOutputStream("desEncodedStream1.txt");
int numRead = 0;
while ((numRead = in.read(buffer)) >= 0)
{
out.write(buffer, 0, numRead);
}
out.close();

then encrypt the encoded file using DES algo:

des.encryption(new FileInputStream("desEncodedStream1.txt"), new
FileOutputStream("desCiphertext.txt"));

Now it's done! the base64 encoded data is encrypted using DES algorithm and the file (desCiphertext.txt) is ready to be sent over the network.

On the other hand the decryption is a backward of the encryption process: it means that the receiver decyrpts the file using the same algorithm and then decode it back using Base64 encoding:

des.decryption(new FileInputStream("desCiphertext.txt"), new FileOutputStream("desEncodedStream2.txt"));
try
{
InputStream in = new Base64.InputStream(newFileInputStream("desEncodedStream2.txt"), Base64.DECODE);
FileOutputStream out = new FileOutputStream("desDecodedStream.txt");
int numRead = 0;
while ((numRead = in.read(buffer)) >= 0)
{
out.write(buffer, 0, numRead);
}
out.close();
}

RSA

The public class and the main method is written in two separate files; RSAencryption.java and testRSAencryption.java. To program the RSA in java, we use the java.security package.

The main method is located in testRSAencryption.java file. In this main method, a key pair (public key and private key) will be created by using generateKeyPair() method. The step of creating a key pair is shown as
below:

KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
keyGen.initialize(1024);
KeyPair key = keyGen.generateKeyPair();

Then the key pair is passed to the public class RSAencryption to be used in encryption and decryption process.

RSAencryption rsa = new RSAencryption(key);

After creating a key pair, we encode the arbitrary data using the code below:

InputStream in = new Base64.InputStream(new FileInputStream("rsaCleartext.txt"), Base64.ENCODE);
FileOutputStream out = new FileOutputStream("rsaEncodedStream1.txt");
int numRead = 0;
while ((numRead = in.read(buf)) >= 0) {
out.write(buf, 0, numRead);
}
out.close();

This code will call the InputStream() method in the public class Base64. The input file rsaCleartext.txt, and the encoded data will be saved in the output file rsaEncodedStream1.txt. Then, the encoded data will be encrypted using RSA algorithm, and the encrypted data will be written in the output file rsaCiphertext.txt.

rsa.encryption(new FileInputStream("rsaEncodedStream1.txt"), new FileOutputStream("rsaCiphertext.txt"));

The encrypted data then will be decrypted and the result will be saved in the output file rsaEncodedStream2.txt.

rsa.decryption(new FileInputStream("rsaCiphertext.txt"), new FileOutputStream("rsaEncodedStream2.txt"));

The contents of both file rsaEncodedStream1.txt and rsaEncodedStream2.txt must be same. To test this we run the diff command. Finally, the encoded data will be decoded back to its original data:

InputStream in = new Base64.InputStream(new FileInputStream("rsaEncodedStream2.txt"), Base64.DECODE);
FileOutputStream out = new FileOutputStream("rsaDecodedStream.txt");
int numRead = 0;
while ((numRead = in.read(buf)) >= 0) {
out.write(buf, 0, numRead);
}
out.close();

Sample codes:

DesEncryption.java

import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.CipherOutputStream;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import java.io.*;
import java.security.spec.AlgorithmParameterSpec;
public class DESencryption {
private Cipher encrypt;
private Cipher decrypt;
private SecretKey key;
private byte[] buffer = new byte[1024];
   public DESencryption() {
try {
key = KeyGenerator.getInstance("DES").generateKey();
} catch (java.security.NoSuchAlgorithmException e){
}
      byte[] iv = new byte[]{
(byte)0x8E, 0x12, 0x39, (byte)0x9C,
0x07, 0x72, 0x6F, 0x5A
};
      AlgorithmParameterSpec paramSpec = new IvParameterSpec(iv);
try {
encrypt = Cipher.getInstance("DES/CBC/PKCS5Padding");
decrypt = Cipher.getInstance("DES/CBC/PKCS5Padding");
encrypt.init(Cipher.ENCRYPT_MODE, key, paramSpec);
decrypt.init(Cipher.DECRYPT_MODE, key, paramSpec);
} catch (java.security.InvalidAlgorithmParameterException e) {
} catch (javax.crypto.NoSuchPaddingException e) {
} catch (java.security.NoSuchAlgorithmException e) {
} catch (java.security.InvalidKeyException e) {
}
}
   public void encryption(InputStream cleartext, OutputStream ciphertext) {
try {
ciphertext = new CipherOutputStream(ciphertext, encrypt);
         int numRead = 0;
while ((numRead = cleartext.read(buffer)) >= 0) {
ciphertext.write(buffer, 0, numRead);
}
ciphertext.flush();
ciphertext.close();
} catch (java.io.IOException e) {
}
}
   public void decryption(InputStream ciphertext, OutputStream cleartext) {
try {
ciphertext = new CipherInputStream(ciphertext, decrypt);
         int numRead = 0;
while ((numRead = ciphertext.read(buffer)) >= 0) {
cleartext.write(buffer, 0, numRead);
}
cleartext.flush();
cleartext.close();
} catch (java.io.IOException e) {
}
}
   public static void main(String args[]){
try {
DESencryption des = new DESencryption();
         byte[] buffer = new byte[1024];
         // Encode the cleartext to Base64 encoding
try {
InputStream in = new Base64.InputStream(new FileInputStream("desCleartext.txt"), Base64.ENCODE);
FileOutputStream out = new FileOutputStream("desEncodedStream1.txt");
            int numRead = 0;
while ((numRead = in.read(buffer)) >= 0) {
out.write(buffer, 0, numRead);
}
out.close();
}
catch (java.io.FileNotFoundException e){}
catch (java.io.IOException e){}
         // Encrypt the Base64 encoded data
des.encryption(new FileInputStream("desEncodedStream1.txt"), new FileOutputStream("desCiphertext.txt"));
         // Decrypt the encrypted Base 64 encoded data
des.decryption(new FileInputStream("desCiphertext.txt"), new FileOutputStream("desEncodedStream2.txt"));
         // Decode the Base64 encoded data
try {
InputStream in = new Base64.InputStream(new FileInputStream("desEncodedStream2.txt"), Base64.DECODE);
FileOutputStream out = new FileOutputStream("desDecodedStream.txt");
            int numRead = 0;
while ((numRead = in.read(buffer)) >= 0) {
out.write(buffer, 0, numRead);
}
out.close();
}
catch (java.io.FileNotFoundException e){}
catch (java.io.IOException e){}
} catch (Exception e) {
}
}
}

RsaEncryption.java

import javax.crypto.Cipher;
import javax.crypto.CipherInputStream;
import javax.crypto.CipherOutputStream;
import java.io.*;
import java.security.*;
public class RSAencryption {
Cipher encrypt;
Cipher decrypt;
   public RSAencryption(KeyPair key) {
try {
encrypt = Cipher.getInstance("RSA/ECB/PKCS1Padding");
decrypt = Cipher.getInstance("RSA/ECB/PKCS1Padding");
         encrypt.init(Cipher.ENCRYPT_MODE, key.getPublic());
decrypt.init(Cipher.DECRYPT_MODE, key.getPrivate());
} catch (java.security.NoSuchAlgorithmException e){
} catch (javax.crypto.NoSuchPaddingException e) {
} catch (java.security.InvalidKeyException e) {
}
}
   byte[] buffer = new byte[1024];
   // do the encryption
public void encryption(InputStream cleartext, OutputStream ciphertext) {
try {
ciphertext = new CipherOutputStream(ciphertext, encrypt);
         int numRead = 0;
while ((numRead = cleartext.read(buffer)) >= 0) {
ciphertext.write(buffer, 0, numRead);
}
ciphertext.close();
} catch (java.io.IOException e) {
}
}
   // do the decryption
public void decryption(InputStream ciphertext, OutputStream cleartext) {
try {
ciphertext = new CipherInputStream(ciphertext, decrypt);
         int numRead = 0;
while ((numRead = ciphertext.read(buffer)) >= 0) {
cleartext.write(buffer, 0, numRead);
}
cleartext.close();
} catch (java.io.IOException e) {
}
}
}

testRsaEncryption.java

import java.io.*;
import java.security.*;
public class testRSAencryption {
   public static void main(String args[]){
try {
KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
keyGen.initialize(1024);
KeyPair key = keyGen.generateKeyPair();
         RSAencryption rsa = new RSAencryption(key);
         byte[] buf = new byte[1024];
         // Encode the cleartext to Base64 encoding
try {
InputStream in = new Base64.InputStream(new FileInputStream("rsaCleartext.txt"), Base64.ENCODE);
FileOutputStream out = new FileOutputStream("rsaEncodedStream1.txt");
            int numRead = 0;
while ((numRead = in.read(buf)) >= 0) {
out.write(buf, 0, numRead);
}
out.close();
} catch (java.io.FileNotFoundException e){
} catch (java.io.IOException e){
}
         // Encrypt the Base64 encoded data
rsa.encryption(new FileInputStream("rsaEncodedStream1.txt"), new FileOutputStream("rsaCiphertext.txt"));
         // Decrypt the encrypted Base 64 encoded data
rsa.decryption(new FileInputStream("rsaCiphertext.txt"), new FileOutputStream("rsaEncodedStream2.txt"));
         // Decode the Base64 encoded data
try {
InputStream in = new Base64.InputStream(new FileInputStream("rsaEncodedStream2.txt"), Base64.DECODE);
FileOutputStream out = new FileOutputStream("rsaDecodedStream.txt");
            int numRead = 0;
while ((numRead = in.read(buf)) >= 0) {
out.write(buf, 0, numRead);
}
out.close();
} catch (java.io.FileNotFoundException e){
} catch (java.io.IOException e){
}
} catch (Exception e) {
}
} // end public static void main
} // end public class testRSAencryption

::An analysis of Internet Explorer Vulnerability Report applying Systems Theories::

Bijairimi Abdul Awal, Romain Babel, Zoran Milinkovic: DSV KTH, 2005

Introduction

Nowadays, there exist an undefined number of systems: systems could be living as human and animal, organization as a company and social society, or machine as a computer. But in what is system made of? And how could we describe it in order to make the definition easier to understand? In this report we will define what a system is and take a concrete example which could explain more precisely its theory. For it, we will approach our study on a web browser system weakness: system's vulnerability which permits numerous exploitations such as DDoS attack, viruses, worms or other kind of risks. For example the Internet Explorer is particularly exposed to those kinds of attacks. How could it be applied to Systems Theory?

Definitions

Web Browser

A web browser is a software application that enables a user to display and interact with HTML documents hosted by web servers or held in a file system.

Systems

A system is a whole which could be a set of different parts taken from the environment. We cannot control part by part, the system has to be thought as a whole. All those parts of the system have relationships between each other: that's why it is impossible to extract one of those and analyse it as a single part.

The function of any system is to convert or process energy, information, or materials into a product or outcome for use within the system, or outside of the system (the environment) or both.

Open system is a system which has relations with environments. Environments have and influence on the input of open system and using the inputs, can change a state of the system and make the system it less secure.

Meanwhile close system is a system which has no relations with environmetns.

Security

Security is being free of danger (harm, threat). In our case it is impossible to complete 100% secure (Internet Explorer is an open system).

Vulnerability

It refers to a weakness or other opening in a system. It is a flaw in a product that makes it infeasible

Systems Theory and Internet Explorer

According to SSK, “a system is defined as a set of objects together with relationships between the objects and between their attributes related to each other and to their environments as to form a whole”.

If we look at Internet Explorer as a system we can see that “Internet Explorer System” is not different from others. The Internet Explorer System has the same systems characteristics (objectives, environment, resources, components and management) and the key concepts (set, objects, relationships, attributes, environment and whole).

A web browser has a goal to show a required page from an internet connection or hard disk. The browser will be the process part in order to decode data into human readable pages. It would be an interpreter of the data transfer.

Environments constitute all that is “outside” the system’s control. It signifies that the environment contains and surrounds the system but has a plenty of relationships with. The system itself can have little or no influence to the environment. In our case, the system is the web browser and its environment would be:

  • Internet: this system from the environment has strong relationship with our system (browser).the data will come to our system from Internet.
  • User: this living system will decide what page he wants to show and then what data he wants to threat.
  • Computer: this system will host the browser. You cannot separate those 2 systems
  • Operating System: Internet Explorer is a subsystem of an operating system and we can look the operating system as the environment for Internet Explorer.
  • Technology: this system would be every physical connection between internet and our system.

The resources are what are concretely inside the system in order to make it working. In our case, the resources of the browser are their own parts of browser: developed program code, and then its engine.

The components are all those activities that contribute to the realization of the system’s objectives. In others words, it means that those components are absolutely useful if we want to make the process working. Here we will need more than the simple browser program. The components would be:

  • OS
  • Internet connection
  • Data
  • Internet Explorer with all its components

The system must be controlled in order to precede its task. Managers must make some kind of control of what the process is doing. In an open system as ours, changes are inevitable: changes could be intrusion or error data which may cause lot of problem for the process or even for the environment. A manager is able to control this kind of problem by controlling outputs and feedback as it is characterized in Cybernetics systems.

Web browser is made of set which is the collection of elements inside the system (for ex. skins, engine, plug-ins, etc.).

Objects are the elements of a system and could be divided into three functional categories: inputs, processes and outputs.

  • Inputs can come from the internet, a user or from hard disk. On user input (request for some page in the browser), the request will be sent out to some medium and data will be received as an input into browser. Here we have a feedback from environment.
  • Process is the browser engine that prepares received data for the output in human readable format. Also, there is a process that reads user input, prepares the URL and sends it to environment.
  • Outputs are browser panel (where a page will be displayed), internet connection (request for a page).

Relationships are links between the objects. There are three categories of relationships: symbiotic, synergistic and redundant. Objects that are not linked could be looked as closed subsystem. They don’t have any inputs or outputs and that objects are not interested for us. In Internet Explorer, we have an example of relationship between an address bar and browser’s engine. The address bar is the object of browser and is used as an input object where a user enters a URL. The address bar is in the relationship with browser’s engine.

All objects or relationships have their attributes, defining and accompanying. Internet Explorer has attributes as the version of browser, size and type of fonts, etc.

Internet Explorer and all its parts work as a whole. They work as an independent framework, which the main goal is page taken from some media in human readable format and show them to the user.

Internet Explorer Vulnerability Report [2]

It's already well known that Internet Explorer has a lot of weaknesses such as DDoS, system access, etc. Here we shall try to apply the Systems Theory to the report.

This report describes the statistics of the most attacks during current years.

Monthly report:

As we can see from the graph below, Internet Explorer has been vulnerable for a long time since Secunia started to follow vulnerabilities for Internet Explorer. In the graph, during all this years Internet Explorer has been vulnerable all the time and Secunia rated this product as Highly Critical.

In the next graphs, we will look to Internet Explorer vulnerabilities from different views and for some of them we shall give some view applying Systems Theory.

Solution Status Report:

The pie graph presents solved and how many unresolved issues Internet Explorer has.

From the Systems Theory view, we can define a diagram of how patches have influence to Internet Explorer. Here, an environment will be the vendor who tries to fix all vulnerabilities that exist in the web browser.

When a system is attacked by any kind of intrusion, the system is more or less infected and then the environment will be as well.

It appends a failure when a flaw is discovered into the system, and when it’s possible to change the process into the system and then it could change its objectives. For instance, worms are not known as virus but are using Internet explorer as an entrance into the environment.

When a failure is discover on the web browser system, patch are developed. It means that we modify the process into the system by any mean in order to avoid the failure.

Criticality:

When a system is attacked by any kind of intrusion, the system is more or less infected and then the environment will be as well.

It appends a failure when a flaw is discovered into the system, and when it’s possible to change the process into the system and then it could change its objectives. For instance, worms are not known as virus but are using Internet explorer as an entrance into the environment.

When a failure is discover on the web browser system, patch are developed. It means that we modify the process into the system by any mean in order to avoid the failure.

From the graph, according to Secunia report, we can see that more then 40% criticalities are highly or extremely critical. With this high percentage of criticalities, how is Internet Explorer secure?

From where Internet Explorer could be attacked?:

In the graph below, Secunia shows where Internet Explorer is vulnerable. For this comparison, Secunia divided attacks into three groups: From Remote, From Local Network and Local System.

As the graph shows, 99% attacks are coming from remote. Usually “from remote” we understand “from the internet”. If the network hasn’t been set up correct, updated and secured, according to an issue from Slashdot site, average time for “infection” of Internet Explorer is 12 minutes.

How to prevent remote attacks? From Systems Theory, we can do something with environment little or nothing. In our case, we are able to manage operating system and to set up a firewall correctly. With setting firewall up correctly, we ensure that we shall not have attacks directly from the internet

All other remote attacks are at most human errors, like answering on pop-ups, installing suspicious software from the internet, opening infected emails, etc.

Impact:

This pie graph showed below presents the different attacks dated from 2003 until 2005. We can see that the most vulnerability threat is system access which could be summarized as an intrusion into the system thanks to the Internet explorer flaw.

As we can see on the pie graph, the largest numbers of attacks through Internet Explorer flaw are the system access. By Internet Explorer, one intruder is able to access in the environment files. Then by the system’s process, the intrusion permits to access the framework which is not under control by our system.

Summary

As a part of the Information Systems, it is crucial to view the web browser systems and any other parts of the Information systems as a whole. This system cannot be seen as an independent part, we have to think about the entire environment in order to make it secure. The browser system cannot be seen as a close system which is just relying on its vendor to update the security patches. We must see the browser as an open system which is interconnected to other objects. In any other words we have to see it in holistic view.

As an open system, the browser itself is impossible to control everything outside its boundary, but it can do something within its own boundary, such as control its process and its outputs.

Thus, the browser system applying systems theory could be a good solution to get the system more optimized and secured. In this report, we just applied how to view the browser system in holistic view. Here, we still didn't come out with the total solution or strategy of the web browser systems security. Hopefully we can do this later. The most important thing here is to make us comfortable and familiar with the systems theory approach which could be applied to the all subjects of life especially to the field of Information and Communication Security.

Reference

1. Schoderbek, Schoderbek, Kafalas: Management Systems, Custom Edition, McGraw-Hill, 1998 [SSK]

2. Secunia report: http://secunia.com/product/11/

::Howto have your own web server on your ubuntu machine::

[This article was written during the earlier version of ubuntu:dapper drake, am not sure whether it's still applicable with the latest version of ubuntu. But just for a knowledge sharing, here you go dudes!]

If you a have an ubuntu box (I assume that you have a box installed with dapper drake) connected to the internet through broadband service, you could have a possibility to run your own web server on your linux box. Follow the instructions below in order to build your own web server.

What starter kit do you have to have?

1. Apache 2.0 - web server
2. PHP5 - server side programming language
3. PHP5 module for Apache 2.0
4. MySQL server - database server

Alright here we go, just enter the command below than you will have everything ready for you.

$ sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server

OK now you can open your browser and type http://localhost, if you see an Apache web page appeared, than your web server is already up. Instead of that you also can use ps command to check whether the apache2 web server and mysql server demon is up.

$ ps aux|grep apache2
$ ps aux|grep mysqld

later, you can use this command to stop, restart, your apache2 and mysql server demon:

$ sudo /etc/init.d/apache2 stop | restart | start
$ sudo /etc/init.d/mysql stop | restart | start

Now your web server is already up and here you can upload your personal webpage into Apache webroot directory. In default, the webroot directory is located in /var/www/. To make your work later easier for uploading, deleting, editing your web pages, it is suggested that you change the default webroot to your a directory in your home directory. The instructions below will show you how to do this:

First, edit /etc/apache2/sites-available/default file

$ sudo vi /etc/apache2/sites-available/default

find this statement:

DocumentRoot /var/www

and change it to the preferable directory in your home directory (assume the home directory here is my_ubuntu):

DocumentRoot /home/my_ubuntu/public_html

Now, restart the apache,

$ sudo /etc/init.d/apache2 restart

then enter http://localhost at the address bar of your browser, you should get this page appeared on the screen:

Index of /

Icon Name Last modified Size Description
=======================================
Apache/2.0.55 (Ubuntu) PHP/5.1.2 Server at localhost Port 80

Ok, now create a simple web page using html language for a testing.

Open any text editor such as gedit and write a simple html code, say a Hello World! code. Save it as index.html or index.htm into your webroot directory (/home/*/public_html). Then once again enter http://localhost at the browser address bar and you will see your first web page welcoming you there, congratulation dude!.

Ok, so far you have successfully setup the web server on your linux box, but you have to know that until this point your web page only can be viewed internally on your box. How to make your web page viewable worldwide? just follow the simple instructions below:

1. Go to http://www.dyndns.com/ and open an account there.
2. After you receive confirmation e-mail from www.dyndns.com, click to the link given to activate your account.
3. On your dyndns account, go to menu My Hosts on your left side, and add host services there for your dynamic DNS.

There, you can select your preferably hostname from the list. Let say you account name is xxx and you could select your hostname as xxx.dyndns.org. After everyting is done, you can test whether your hostname is correctly run or not by entering http://xxx.dyndns.org at the browser. If your website appeared successfully on the screen, and your friend also can view your website then congratulation once again, your are now on a right path to be a web master hahaha baka!

Tuesday, October 28, 2008

::How to install/uninstall .deb files on ubuntu machine::

.deb is a debian package file and can be installed on ubuntu using two ways:

1. Double click on the package.deb file and install it by selecting Install Package option

2. or by using command line from ubuntu terminal:
sudo dpkg -i package.deb
dpkg is a debian package manager that manages debian packages. There are many options that can be used and in this case -i option is for installation.

3. To uninstall the package is pretty simple as well. It can be done via Synaptic Package Manager: search by the package name and then uncheck it for removal selection.

4. or via terminal by invoking a command with -r option:
sudo dpkg -r package.deb
That's so easy isn't it? so good luck dudes!