Bala's Blog

JOY OF PROGRAMMING

Month: January, 2010

USAGE OF PING AND IFCONFIG COMMANDS IN LINUX

Hi ….

Today I am going to say some of the usages of the ping and the ifconfig command in linux systems…..

1)ifconfig

The ifconfig command is used to find the ip address of the system which we are working and has many

options in it which can be used to change the ip address or to connect to a network etc………

2)ping

The ping command is used to check whether the ip address specified as a argument of the ping command

is connected to the network in which our system works ….

If it is connected to the network then it receives packets from the system………………

That’s it for today

with regards………….

JKBS……………..

Advertisements

MOGRIFY COMMAND FOR IMAGE RESIZING IN LINUX

If you need  to just resize  images in a folder

1)Open terminal

2)By using cd command to respective folder

3)And then type following:

mogrify -resize 800×600 -verbose *.JPG

This will resize all the JPG files in the folder in a single go.

jkbs………………….

CLAM-REMOVING VIRUS PROGRAMS IN LINUX

Hai friend…..I wish all of them had a nice start of the week…….

Today I thought of saying simple but a powerful tool which is none other than “CLAM”

The clam is a open source software which is used to remove the virus files that affect the windows

operating systems…..

The clam are used to remove these types of files from the NTFS file systems from linux OSes……….

The clam is available in both command line and gtk i.e. GUI version that can be installed

in our linux systems and used a like other packages………….

I think this would help you for sorting the problem of viruses…….

SAY NO TO VIRUSes………

JKBS………………………

INSTALLING GRUB

Hai . I wish all of them had a nice sunday….
Today I like to post something about installation procedure of GRUB….
This situation of installing GRUB occurs when we have already installed linux operating system and
after that we have installed any windows OSes…….
So we have to install the GRUB manually to get on to the linux OS during the boot time…
For this we have to follow the following steps………..
1)First insert the live CD of ubuntu(any of its version)
2)Then open the terminal and type the following commands
i)sudo grub
after typing this command you get a sudo prompt in the terminal
ii)find /boot/grub/stage1
This shows the partition number where you have installed the linux operating system.
iii)root(hd0,4)
Here you have to specify the partition number as the second argument.
iv)setup(hd0)

This installs the GRUB in your system….
3)Then you can reboot the system and can select the OS from the GRUB that is installed………..

I think this will be useful for the linux geeks probably…………..

JKBS………………

ZENITY command IN LINUX

Some of the commands in linux i thought it will be useful for some utility purposes……………………

zenity-

It is a command in linux which opens a gtk i.e. window which can be used for displaying a info or a warning messages or to get an status from the user.This can be done by using various arguments of zentiy like

–info   for displaying a info window to the user.

–warning for displaying a warning message to the user.

–text it is used to specify the text that is to be printed in the window

and many of them are available like –calendar for getting a calendar etc

Some of the other arguments can be added for header text and size of the window which can be little essential and when needed can be got from the manual pages of zenity…………………………………

JKBS

QUANTUM CRYPTOGRAPHY

This was the topic which i took as seminar on 08-01-10 . Some valuable points about this topic…………

Quantum cryptography, or quantum key distribution (QKD), uses quantum mechanics to guarantee secure communication. It enables two parties to produce a shared random bit string known only to them, which can be used as a key to encrypt and decrypt messages.

An important and unique property of quantum cryptography is the ability of the two communicating users to detect the presence of any third party trying to gain knowledge of the key. This results from a fundamental aspect of quantum mechanics: the process of measuring a quantum system in general disturbs the system. A third party trying to eavesdrop on the key must in some way measure it, thus introducing detectable anomalies. By using quantum superpositions or quantum entanglement and transmitting information in quantum states, a communication system can be implemented which detects eavesdropping. If the level of eavesdropping is below a certain threshold, a key can be produced that is guaranteed to be secure (i.e. the eavesdropper has no information about), otherwise no secure key is possible and communication is aborted.

The security of quantum cryptography relies on the foundations of quantum mechanics, in contrast to traditional public key cryptography which relies on the computational difficulty of certain mathematical functions, and cannot provide any indication of eavesdropping or guarantee of key security.

Quantum cryptography is only used to produce and distribute a key, not to transmit any message data. This key can then be used with any chosen encryption algorithm to encrypt (and decrypt) a message, which can then be transmitted over a standard communication channel. The algorithm most commonly associated with QKD is the one-time pad, as it is provably secure when used with a secret, random key.

BB84 PROTOCOL

This protocol, known as BB84 after its inventors and year of publication, was originally described using photon polarization states to transmit the information. However, any two pairs of conjugate states can be used for the protocol, and many optical fibre based implementations described as BB84 use phase encoded states. The sender (traditionally referred to as Alice) and the receiver (Bob) are connected by a quantum communication channel which allows quantum states to be transmitted. In the case of photons this channel is generally either an optical fibre or simply free space. In addition they communicate via a public classical channel, for example using broadcast radio or the internet. Neither of these channels need to be secure; the protocol is designed with the assumption that an eavesdropper (referred to as Eve) can interfere in any way with both.

The security of the protocol comes from encoding the information in non-orthogonal states. Quantum indeterminacy means that these states cannot in general be measured without disturbing the original state. BB84 uses two pairs of states, with each pair conjugate to the other pair, and the two states within a pair orthogonal to each other. Pairs of orthogonal states are referred to as a basis. The usual polarization state pairs used are either the rectilinear basis of vertical (0°) and horizontal (90°), the diagonal basis of 45° and 135° or the circular basis of left- and right-handedness. Any two of these bases are conjugate to each other, and so any two can be used in the protocol. Below the rectilinear and diagonal bases are used.

The first step in BB84 is quantum transmission. Alice creates a random bit (0 or 1) and then randomly selects one of her two bases (rectilinear or diagonal in this case) to transmit it in. She then prepares a photon polarization state depending both on the bit value and basis, as shown in the table to the left. So for example a 0 is encoded in the rectilinear basis (+) as a vertical polarization state, and a 1 is encoded in the diagonal basis (x) as a 135° state. Alice then transmits a single photon in the state specified to Bob, using the quantum channel. This process is then repeated from the random bit stage, with Alice recording the state, basis and time of each photon sent.

According to quantum mechanics no possible measurement distinguishes between the 4 different polarization states, as they are not all orthogonal. The only possible measurement is between any two orthogonal states (a basis). So, for example, measuring in the rectilinear basis gives a result of horizontal or vertical. If the photon was created as horizontal or vertical then this measures the correct state, but if it was created as 45° or 135°  then the rectilinear measurement instead returns either horizontal or vertical at random. Furthermore, after this measurement the photon is polarized in the state it was measured in (horizontal or vertical), with all information about its initial polarization lost.

These are some of the points about quantum cryptography and the protocol used in it………………………………….