# Cryptography

Some terms related to cryptography :
Cryptography :
It is the study of the mathematics techniques for all aspects of the information security. Cryptanalysis is the complementary science with the methods to defeat these techniques. The study of cryptography and cryptanalysis is called Cryptology.
Encryption :
It is the process of disguising the message in order to hide all the information that it contains.. This process includes encoding and enciphering.
Protocol :
It is an algorithm that is defined by a sequence of steps, precisely specifying the actions of multiple parties in order to acheive the objective.
Plain text :
The message that is transmitted or stored.
Ciphertext :
The disguised message that is in encrypted form.
Encode :
Encode means to convert the message into a representaion in a standard alphabet, such as to the alphabet {a,……z} or to numerical alphabet.
Decode :
Decode means to convert the encoded message into its original form. The process of encoding a message is not an obscure process, and the result that we get after decoding can be considered as equivalent to the plaintext message.
Cipher :
A map from a space of plaintext to a space of ciphertext.
Encipher :
To convert the plaintext to ciphertext.
Decipher :
To convert the ciphertext back to the plaintext.
Stream cipher :
A cipher which acts on the plaintext one symbol at a time.
Block cipher :
A cipher which acts on the plaintext in blocks of symbols.
Substitution cipher :
A stream cipher which acts on plaintext by making a substitution of the characters with the elements of a new alphabets or by permutation of the characters in the plaintext alphabets.
Transposition cipher :
A block cipher which acts on the plaintext by permuting the positions of the characters in the plaintext.

# Getting close to BIOS

BIOS :
Basically, the combination of the motherboard BIOS, adaptercard BIOS device drivers loaded form the disks contributes the BIOS. The portion of the BIOS contained in the ROM chips is called firmware. The firmware is nothing but the name of the software which is stored on these chips.
BIOS hardware and software :
The BIOS is a software running in memory that consists of all the various drivers that interface the hardware to the OS. The BIOS comes from the 3 possible sources :
• Motherboard ROM
• Loaded into RAM from the disks

The motherboard ROM BIOS is most associated with the hardware rather than software. It includes driver for all the basic system components with keyboard, hard drive, serial ports, latest video adapters, CD-ROM drives, SCSI hard disks, USB ports and many more.

A few adapters boards always have a ROM on board that includes :

• Video cards
• Network cards
• IDE or floppy upgrade boards
• Y2K boards

The setup program in the BIOS is used to set and store the configuration settings in the CMOS RAM.

Functions of BIOS :
Basically it has 4 main function :
• POST ( Power On Self Test )
• Setup
• BIOS

Don’t get confused with the 4th function of the BIOS is itself BIOS. This function refers to the collection of the actual drivers used to act as a basic interface between the OS and hardware when the system is booted and running.

Types of ROM chips :
There are 4 main types of ROM

• ROM : Read Only Memory
• PROM : Programmable ROM
• EPROM : Erasable PROM
• EEPROM : Electrically EPROM ( also called Flash ROM )

It does not matter what ROM the system uses, The data stored in a ROM chip is non-volatile and stays indefinitely unless erased or overwritten.

To replace the BIOS chip, follow these steps :

1. Back up the CMOS RAM settings.
2. Power down the system and unplug the power cord.
3. Remove the cover and any other components in the way of the BIOS EPROM chip. Remember to use caution with respect to static discharges; you should wear an antistatic wrist strap for this procedure or ground yourself to the chassis before touching any internal components.
4. Using a chip puller or a thin flat-blade screwdriver, gently pry the chip out of its socket.
5. Remove the new EPROM from the antistatic packing material in which it came.
6. Install the new EPROM chip into the socket. A standard rectangular BIOS chip has a dimple atone end that corresponds to a cutout on the socket. You can install the chip in the socket back-ward, but if you do, you will destroy the chip.
8. Put the cover back on, plug in the system, and power on.
9. Enter the BIOS setup information you saved earlier.
10. Reboot and enjoy the new BIOS!
Different types of viruses:
File infector virus: Most common form of the computer virus is the file infector virus, that hides its code within the code of the another programs. Its an executable program typically with exe, bat, pif, sys or com extension. By loading itself to the memory it runs separately and even can continue if the host program is closed. This type of virus is responsible for 85% of the infections.
Boot sector virus : It resides in the part of the hard disk which is read in the memory when the computer firsts boot up. since removable disks are less used today, boot sector viruses have become much less prevalent than they used to be.
Macro viruses : Come viruses are created with the macro coding languages. Macros are the small programs that are created to do highly specific tasks within an application. They are written in a pseudo-programming language designed to work with the application. VBA (example of macro language) is used in all microsoft applications. Thus they modify the file, send e-mails etc.
Script virus : Script virus are based on common scripting language which are macro like pseudo-programming languages that is typically used in web-sites. Some of common scripting language are javascript, activex, and java applets which run automatically when the web-site is opened. Due to increase in the use of web, the script virus is getting more popular.
Trojan horse : A trojan horse is a program that claims to do one thing but does something very different. it looks innocuous  enough to be safe to open but the moment we run the file it proceeds to inflict the damage on the system.
Worms : A worm is a program that scans the networks for another computer that has a specific security hole. It copies itself through that security hole and starts replicating. they don’t have to be delivered through the conventional programs therefore they are termed as fileless worms.
E-mail virus : A virus that is distribted theough e-mail. Many e-mail virus hijack e-mail program and send themself out to all the contacts in the address book.
Life cycle of the computer virus:
1. Creation : Virus is created.
2. Replication : Virus is copied from pc to pc.
3. Activation : Virus launches and delivers destructive payloads.
4. Discovery: Virus is detected and documented.
5. Assimilation : Anti-viruses companies modify their programs to include new virus.
6. Eradication : Use of anti-virus  removes the threats.