Wednesday, August 21, 2013

Computer Virus and Crime and How to Prevent It

1. What is a Virus?
Computer Virus Alert!

A virus is a program designed to replicate itself in order to spread itself from one system to another.

Some viruses are harmless. They display only a simple message. But most viruses are very harmful. They destroy data or even the entire hard disk. Viruses attach themselves to program-files and move with them from disk to disk. When a virus attaches itself to a file, it lies dormant.

But when a certain date or event occurs, it gets triggered and becomes active. One notorious virus is called Friday, the 13 Virus. It is also called Jerusalem Virus because it was first of all discovered at the University of Jerusalem in 1987. It gets activated every Friday that occurs on the 13th of a month.

2. What does a Virus do?

What harm can a virus do when it gets active? It depends on the virus itself. It may:
  1. reformat hard disks erasing them totally.
  2. delete or damage files.
  3. heavily damage the file-allocation table. As a result of which, files cannot be easily located and found.  Moreover, the hard disks are rendered absolutely useless.
The first documented virus-program was written in 1983 by Fred Cohen, Within only six years, i.e., by the close of the 1980s, virus had become an alarming epidemic. However, viruses need caution on the user's part. But they are not at all to be feared from. Some simple steps can protect a system from them. These steps are:
  1. backing up important files frequently.
  2. Write-protecting program disks.
  3. Some viruses are copied from an infected disk during start-up. So, all disks should be removed from their drives before starting the computer.
  4. All files that come from an unknown source should be checked with an anti-virus program. They should be used only when they are found to be totally virus-free.
  5. Every PC should be equipped with some anti-virus program. Examples of such anti-virus programmers include Norton Anti-virus, Dr.Solomon's Anti-virus, McAfee Virus Scan and many others.
New viruses are being discovered every day. So, the users should keep updating their list of viruses. Also, they should take necessary precautions and steps for keeping the viruses at arm's length.

3. Types of Virus:

The different types of viruses are listed below:
a. Worm.
Originally, it is quite a harmless virus that simply replicates itself. But in the long run, it takes over all the resources of the itself. But in the long run, it takes over all the resources of the system and the PC become useless. Worms have the capacity to travel from system to system very easily.
b. Trojan Horse.
This virus comes as a friendly program (as a game etc.). But it is very dangerous as it destroys all data.
c. File Infector.
This is the most common type of virus, It adds virus code to the regular programming code within program-files. So, when the infected program is run, other program-files also get infected. 
d. Boot-Sector Virus. 
The virus attaches itself to the boot-sector of the disk. This sector is the part of the disk where start-up instructions and the file-allocation table are kept. This sector is read and loaded into the memory every time the disk is booted. Evidently, this virus is also very dangerous.
4. Computer Crime:

Computer crime means unauthorized access to or alteration in computer programs or data.

As the human society is becoming more and more dependent on computers, computer crime is talking an alarming shape. Computer criminals have done the following harms:
  • They have stolen huge amounts of funds belonging to various computer companies by transferring them out of their computer accounts illegally.
  • They have spread destruction from one computer to another using virus programs. Thus they have crippled the entire system of computer networks.
  • They have spread computer-worm programs that are less harmful in the beginning but render the computer almost useless in the long run.
5. How to prevent Computer Crime?

The basic ways of prevention are listed below:
a. Vaccines:
These are programs that vaccinate the computers against the viruses.
b. Passwords:
Most computer systems require the user to enter a password that is usually a combination of alphanumeric characters (A-Z and 0-9). If the password is valid, the computer grants access to the system. If it is not valid, access is denied. Some complex computer security-systems trigger an alarm if someone tries to use a fake password. The longer the password, the safer it is.
c. Halting Trespassers:

In order to restrict illegal access to a computer, some sophisticated defenses are used instead of simple passwords. For example, special voice-recorders can analyses the voice of a trespasser and check it against a database containing the voice-patterns of valid users.

Introduction to BASIC Programming Language

BASIC is a popular programming language for the beginners. It was developed in 1964. Using this easy language, we can make very interesting programs with text and graphic output.

A number of companies provide this language under different names.
For example,

T-BASIC, GW-BASIC AND Q-BASIC.

1. Structure of a Program in BASIC language:

  • Every program in BASIC language has a line number. The line numbers start from 10 and increase with the difference of 10. For example, 10,20,30,...
  • Every line in the programme is called a statement. This statement asks the computer to perform the required task.
2. Our First BASIC Program:

Using BASIC, we can print any message on the screen. To display a message, we use the PRINT statement. This statement takes a message from us and prints it on the screen. Type the following PRINT statement and press ENTER.


10 PRINT "Hello, World!"
140 END



Our first program will give this output on the computer screen.




3. Modes of a Program:

In BASIC, we can write a programme in two different modes.

(i) Direct Mode
(ii) Indirect Mode

(i). Direct Mode:

In the direct mode, we can write any program and immediately run it without giving any line numbers or saving to the floppy or hard disk. Our first programme was also written in the Direct Mode.

Here  is another Direct Mode program.


PRINT 4+2 <Enter>

we will get this output on the computer screen.



(ii). Indirect Mode:

In the Indirect Mode we can write multilane programs and then run all the statements turn by turn. We can also save these programs on the floppy or hard disk.

Write the following program with line numbers.


10 PRINT "I Live in"
20 PRINT "USA"



Now type RUN and we get the output on the screen.


4. Saving a Program:

To save a program on floppy disk, type the following command.


SAVE " my prog1" <Enter>

5. Loading a Program:
Loading a program means getting data from the floppy disk to the computer, so that we may run it. Use this command to load a program from floppy to the computer.

LOAD " my prog1" <Enter>

6. Getting List of the Loaded Programs:

LIST command in BASIC displays all the programs that have been loaded in the computer memory and can be run by RUN command.


LIST " my prog1" <Enter>

7. Variables in BASIC:

BASIC language allows us the use of variables. Therefore, instead of using constants as in our previous examples, we  can use variables in our programs. Once defined, we can store values in these variables and can use them anywhere in the program.

8. Variable Types In BASIC:

We can use two types of variables in BASIC:

a. Numeric
b. String

a. Numeric Variables:
Numeric Variables can hold numeric values. For example, 12,32,23,50 etc. We can perform calculations on numeric variables.

b. String Variables:
String variables can store non-numeric data. For example, David, USA, A, 77%, etc.

9. Using Variables:

To use a variable, whether it is numeric or string, we have to take two steps:
a. Defining the Variableb. Defining a String Variable
a. Defining a Numeric Variable:

In BASIC, a numeric variable can be defined in this way.

LET A=20


In the above statement, we use LET to define a variable 'A' and give it the value 20. We can give any numeric value to a variable.

b. Defining a String Variable:

A string variable is the collection of alphabets. Defining a string variable is a little different to defining a numeric variable. Let us see how?
LET B$ = "Computer"

Note: A string variable may also contain numbers but a numeric variable cannot contain alphabets. (Every string value for a variable should be in double quotes).

For example, the following two statements are correct.
LET C$ = "123"
LET D$ = "A1B2C3"

In the above example, both '123' and 'A1B2C3' are taken as string values and stored into string type of variables.

10. BASIC Commands:

You already know about some BASIC commands, such as SAVE, LOAD, SAVE and RUN. Let's know some other commands.
  1. BASIC or GWBASIC (This command is used to load BASIC language itself. This command will work when you are in the directory that contains the BASIC OR GWBASIC file).
  2. SYSTEM (We use this command to exit from BASIC language environment)
  3. INPUT (This command is used to get input from user. This input is stored into some variable).
  4. CLS (This command is used to clear the monitor screen).
  5. END (End is used to end a BASIC program. This statement comes at the end of a program).
11. Sample Programs:

Program - 1

Now we make some program that gets two values from the user: stores them into the variables and shows the total of the two values to the user.

10 CLS
20 INPUT "Enter first Value"; A
30 INPUT "Enter second Value"; B
40 PRINT A + B
50 END