SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
Data Communication and Computer Network
SWETA KUMARI BARNWAL 1
HTTP
o HTTP stands for HyperText Transfer Protocol.
o It is a protocol used to access the data on the World Wide Web (www).
o The HTTP protocol can be used to transfer the data in the form of plain text, hypertext,
audio, video, and so on.
o This protocol is known as HyperText Transfer Protocol because of its efficiency that
allows us to use in a hypertext environment where there are rapid jumps from one
document to another document.
o HTTP is similar to the FTP as it also transfers the files from one host to another host.
But, HTTP is simpler than FTP as HTTP uses only one connection, i.e., no control
connection to transfer the files.
o HTTP is used to carry the data in the form of MIME-like format.
o HTTP is similar to SMTP as the data is transferred between client and server. The
HTTP differs from the SMTP in the way the messages are sent from the client to the
server and from server to the client. SMTP messages are stored and forwarded while
HTTP messages are delivered immediately.
Features of HTTP:
o Connectionless protocol: HTTP is a connectionless protocol. HTTP client initiates a
request and waits for a response from the server. When the server receives the request,
the server processes the request and sends back the response to the HTTP client after
CLIENT SERVER
Request
Response
Data Communication and Computer Network
SWETA KUMARI BARNWAL 2
which the client disconnects the connection. The connection between client and server
exist only during the current request and response time only.
o Media independent: HTTP protocol is a media independent as data can be sent as long
as both the client and server know how to handle the data content. It is required for both
the client and server to specify the content type in MIME-type header.
o Stateless: HTTP is a stateless protocol as both the client and server know each other
only during the current request. Due to this nature of the protocol, both the client and
server do not retain the information between various requests of the web pages.
TELNET
It stands for TErminaL NETwork. It is a type of protocol that enables one computer to connect
to local computer. It is a used as a standard TCP/IP protocol for virtual terminal service which
is given by ISO. Computer which starts connection known as the local computer. Computer
which is being connected to i.e. which accepts the connection known as remote computer.
When the connection is established between local and remote computer. During telnet
operation whatever that is being performed on the remote computer will be displayed by local
computer. Telnet operates on client/server principle. Local computer uses telnet client program
and the remote computers uses telnet server program.
• The main task of the internet is to provide services to users. For example, users want to
run different application programs at the remote site and transfers a result to the local
site. This requires a client-server program such as FTP, SMTP. But this would not allow
us to create a specific program for each demand.
• The better solution is to provide a general client-server program that lets the user access
any application program on a remote computer. Therefore, a program that allows a user
to log on to a remote computer. A popular client-server program Telnet is used to meet
such demands. Telnet is an abbreviation for Terminal Network.
• Telnet provides a connection to the remote computer in such a way that a local terminal
appears to be at the remote side.
There are two types of login:
Local Login
Data Communication and Computer Network
SWETA KUMARI BARNWAL 3
o When a user logs into a local computer, then it is known as local login.
o When the workstation running terminal emulator, the keystrokes entered by the
user are accepted by the terminal driver. The terminal driver then passes these
characters to the operating system which in turn, invokes the desired application
program.
o However, the operating system has special meaning to special characters. For
example, in UNIX some combination of characters have special meanings such
as control character with "z" means suspend. Such situations do not create any
problem as the terminal driver knows the meaning of such characters. But, it
can cause the problems in remote login.
Remote login
Data Communication and Computer Network
SWETA KUMARI BARNWAL 4
o When the user wants to access an application program on a remote computer,
then the user must perform remote login.
FTP
FTP stands for File transfer protocol.
FTP is a standard internet protocol provided by TCP/IP used for transmitting the files from
one host to another.
It is mainly used for transferring the web page files from their creator to the computer that
acts as a server for other computers on the internet.
It is also used for downloading the files to computer from other servers.
Objectives of FTP
It provides the sharing of files.
It is used to encourage the use of remote computers.
It transfers the data more reliably and efficiently.
File Transfer Protocol(FTP) is an application layer protocol which moves files between local
and remote file systems. It runs on the top of TCP, like HTTP. To transfer a file, 2 TCP
connections are used by FTP in parallel: control connection and data connection.
Data Communication and Computer Network
SWETA KUMARI BARNWAL 5
Electronic mail
It is one of most widely used services of Internet. This service allows an Internet user to send
a message in formatted manner (mail) to the other Internet user in any part of world. Message
in mail not only contain text, but it also contains images, audio and videos data. The person
who is sending mail is called sender and person who receives mail is called recipient. It is just
like postal mail service.
Email messages include three components, which are as follows:
Message envelope: It depicts the email's electronic format.
Message header: It contains email subject line and sender/recipient information.
Message body: It comprises images, text, and other file attachments.
Email can be used in different ways: it can be used to communicate either within an
organization or personally, including between two people or a large group of people. Most
people get benefit from communicating by email with colleagues or friends or individuals or
small groups. It allows you to communicate with others around the world and send and receive
images, documents, links, and other attachments. Additionally, it offers benefit users to
communicate with the flexibility on their own schedule.
The email was developed to support rich text with custom formatting, and the original email
standard is only capable of supporting plain text messages. In modern times, email supports
HTML (Hypertext markup language), which makes it capable of emails to support the same
formatting as websites. The email that supports HTML can contain links, images, CSS layouts,
and also can send files or "email attachments" along with messages. Most of the mail servers
enable users to send several attachments with each message. The attachments were typically
limited to one megabyte in the early days of email. Still, nowadays, many mail servers are able
to support email attachments of 20 megabytes or more in size.
In 1971, as a test e-mail message, Ray Tomlinson sent the first e-mail to himself. This email
was contained the text "something like QWERTYUIOP." However, the e-mail message was
Data Communication and Computer Network
SWETA KUMARI BARNWAL 6
still transmitted through ARPANET, despite sending the e-mail to himself. Most of the
electronic mail was being sent as compared to postal mail till 1996.
SECURED SHELL
It is access credential that is used in the SSH Protocol. In other words, it is a cryptographic
network protocol that is used for transferring encrypted data over network. It allows you to
connect to a server, or multiple servers, without having you to remember or enter your
password for each system that is to login remotely from one system into another.
It always comes in key pair:
1. User Key – If public key and private key remain with the user.
2. Host Key – If public key and private key are on a remote system.
3. Session key – Used when large amount of data is to be transmitted.
How SSH Works?
It uses asymmetric cipher for performing encryption and decryption. There are many
encryption methods:
Public key – Everyone can see it, no need to protect it. (for encryption function)
Private key – Stays in computer, must be protected. (for decryption function)
Key pairs can be of the following types:
General procedure is :-
• Public keys from the local computers (system) are passed to the server which is
to be accessed.
• Server then identifies if the public key is registered.
• If so, the server then creates a new secret key and encrypts it with the public key
which was send to it via local computer.
• This encrypted code is send to the local computer.
• This data is unlocked by the private key of the system and is send to the server.
• Server after receiving this data verifies the local computer.
• SSH creates a route and all the encrypted data are transferred through it with no
security issues.
WWW
WWW stands for World Wide Web. A technical definition of the World Wide Web is : all
the resources and users on the Internet that are using the Hypertext Transfer Protocol (HTTP).
A broader definition comes from the organization that Web inventor Tim Berners-Lee helped
found, the World Wide Web Consortium (W3C).
The World Wide Web is the universe of network-accessible information, an embodiment of
human knowledge.
In simple terms, The World Wide Web is a way of exchanging information between computers
on the Internet, tying them together into a vast collection of interactive multimedia resources.
Internet and Web is not the same thing: Web uses internet to pass over the information.
Data Communication and Computer Network
SWETA KUMARI BARNWAL 7
Evolution
World Wide Web was created by Timothy Berners Lee in 1989 at CERN in Geneva.
The following diagram briefly defines evolution of World Wide Web:
WWW Architecture
WWW architecture is divided into several layers as shown in the following diagram:
Data Communication and Computer Network
SWETA KUMARI BARNWAL 8
Identifiers and Character Set
Uniform Resource Identifier (URI) is used to uniquely identify resources on the web
and UNICODE makes it possible to built web pages that can be read and write in human
languages.
Syntax
XML (Extensible Markup Language) helps to define common syntax in semantic web.
Data Interchange
Resource Description Framework (RDF) framework helps in defining core representation
of data for web. RDF represents data about resource in graph form.
Taxonomies
RDF Schema (RDFS) allows more standardized description of taxonomies and
other ontological constructs.
Ontologies
Web Ontology Language (OWL) offers more constructs over RDFS. It comes in following
three versions:
• OWL Lite for taxonomies and simple constraints.
• OWL DL for full description logic support.
• OWL for more syntactic freedom of RDF
Rules
Data Communication and Computer Network
SWETA KUMARI BARNWAL 9
RIF and SWRL offers rules beyond the constructs that are available
from RDFs and OWL. Simple Protocol and RDF Query Language (SPARQL) is SQL like
language used for querying RDF data and OWL Ontologies.
Proof
All semantic and rules that are executed at layers below Proof and their result will be used to
prove deductions.
Cryptography
Cryptography means such as digital signature for verification of the origin of sources is used.
User Interface and Applications
On the top of layer User interface and Applications layer is built for user interaction.
WWW Operation
WWW works on client- server approach. Following steps explains how the web works:
1. User enters the URL (say, http://www.tutorialspoint.com) of the web page in the
address bar of web browser.
2. Then browser requests the Domain Name Server for the IP address corresponding to
www.tutorialspoint.com.
3. After receiving IP address, browser sends the request for web page to the web server
using HTTP protocol which specifies the way the browser and web server
communicates.
4. Then web server receives request using HTTP protocol and checks its search for the
requested web page. If found it returns it back to the web browser and close the HTTP
connection.
5. Now the web browser receives the web page, It interprets it and display the contents of
web page in web browser’s window.
Future
Data Communication and Computer Network
SWETA KUMARI BARNWAL 10
There had been a rapid development in field of web. It has its impact in almost every area
such as education, research, technology, commerce, marketing etc. So the future of web is
almost unpredictable.
Apart from huge development in field of WWW, there are also some technical issues that W3
consortium has to cope up with.
User Interface
Work on higher quality presentation of 3-D information is under deveopment. The W3
Consortium is also looking forward to enhance the web to full fill requirements of global
communities which would include all regional languages and writing systems.
Technology
Work on privacy and security is under way. This would include hiding information,
accounting, access control, integrity and risk management.
Architecture
There has been huge growth in field of web which may lead to overload the internet and
degrade its performance. Hence more better protocol are required to be developed.
Simple Mail Transfer Protocol
The Simple Mail Transfer Protocol (SMTP) is used to transfer electronic mail from one user
to another. This task is done by means of email client software (User Agents) the user is using.
User Agents help the user to type and format the email and store it until internet is available.
When an email is submitted to send, the sending process is handled by Message Transfer
Agent which is normally comes inbuilt in email client software.
Message Transfer Agent uses SMTP to forward the email to another Message Transfer Agent
(Server side). While SMTP is used by end user to only send the emails, the Servers normally
use SMTP to send as well as receive emails. SMTP uses TCP port number 25 and 587.
Client software uses Internet Message Access Protocol (IMAP) or POP protocols to receive
emails.
File Transfer Protocol
The File Transfer Protocol (FTP) is the most widely used protocol for file transfer over the
network. FTP uses TCP/IP for communication and it works on TCP port 21. FTP works on
Client/Server Model where a client requests file from Server and server sends requested
resource back to the client.
FTP uses out-of-band controlling i.e. FTP uses TCP port 20 for exchanging controlling
information and the actual data is sent over TCP port 21.
The client requests the server for a file. When the server receives a request for a file, it opens
a TCP connection for the client and transfers the file. After the transfer is complete, the server
closes the connection. For a second file, client requests again and the server reopens a new
TCP connection.
Data Communication and Computer Network
SWETA KUMARI BARNWAL 11
Post Office Protocol (POP)
The Post Office Protocol version 3 (POP 3) is a simple mail retrieval protocol used by User
Agents (client email software) to retrieve mails from mail server.
When a client needs to retrieve mails from server, it opens a connection with the server on
TCP port 110. User can then access his mails and download them to the local computer. POP3
works in two modes. The most common mode the delete mode, is to delete the emails from
remote server after they are downloaded to local machines. The second mode, the keep mode,
does not delete the email from mail server and gives the user an option to access mails later
on mail server.
Hyper Text Transfer Protocol (HTTP)
The Hyper Text Transfer Protocol (HTTP) is the foundation of World Wide Web. Hypertext
is well organized documentation system which uses hyperlinks to link the pages in the text
documents. HTTP works on client server model. When a user wants to access any HTTP page
on the internet, the client machine at user end initiates a TCP connection to server on port 80.
When the server accepts the client request, the client is authorized to access web pages.
To access the web pages, a client normally uses web browsers, who are responsible for
initiating, maintaining, and closing TCP connections. HTTP is a stateless protocol, which
means the Server maintains no information about earlier requests by clients.
HTTP versions
• HTTP 1.0 uses non persistent HTTP. At most one object can be sent over a single TCP
connection.
• HTTP 1.1 uses persistent HTTP. In this version, multiple objects can be sent over a
single TCP connection.
DNS
An application layer protocol defines how the application processes running on different
systems, pass the messages to each other.
o DNS stands for Domain Name System.
o DNS is a directory service that provides a mapping between the name of a host on the network
and its numerical address.
o DNS is required for the functioning of the internet.
o Each node in a tree has a domain name, and a full domain name is a sequence of symbols
specified by dots.
o DNS is a service that translates the domain name into IP addresses. This allows the users of
networks to utilize user-friendly names when looking for other hosts instead of remembering
the IP addresses.
Data Communication and Computer Network
SWETA KUMARI BARNWAL 12
o For example, suppose the FTP site at EduSoft had an IP address of 132.147.165.50, most people
would reach this site by specifying ftp.EduSoft.com. Therefore, the domain name is more
reliable than IP address.
DNS is a TCP/IP protocol used on different platforms. The domain name space is divided into
three different sections: generic domains, country domains, and inverse domain.
Generic Domains
o It defines the registered hosts according to their generic behavior.
o Each node in a tree defines the domain name, which is an index to the DNS database.
o It uses three-character labels, and these labels describe the organization type.
Label Description
aero Airlines and aerospace companies
biz Businesses or firms
com Commercial Organizations
coop Cooperative business Organizations
edu Educational institutions
gov Government institutions
info Information service providers
int International Organizations
Data Communication and Computer Network
SWETA KUMARI BARNWAL 13
mil Military groups
museum Museum & other nonprofit organizations
name Personal names
net Network Support centers
org Nonprofit Organizations
pro Professional individual Organizations
Country Domain
The format of country domain is same as a generic domain, but it uses two-character country
abbreviations (e.g., us for the United States) in place of three character organizational
abbreviations.
Inverse Domain
Data Communication and Computer Network
SWETA KUMARI BARNWAL 14
The inverse domain is used for mapping an address to a name. When the server has received a
request from the client, and the server contains the files of only authorized clients. To determine
whether the client is on the authorized list or not, it sends a query to the DNS server and ask
for mapping an address to the name.
Working of DNS
o DNS is a client/server network communication protocol. DNS clients send requests to the.
server while DNS servers send responses to the client.
o Client requests contain a name which is converted into an IP address known as a forward DNS
lookups while requests containing an IP address which is converted into a name known as
reverse DNS lookups.
o DNS implements a distributed database to store the name of all the hosts available on the
internet.
o If a client like a web browser sends a request containing a hostname, then a piece of software
such as DNS resolver sends a request to the DNS server to obtain the IP address of a hostname.
If DNS server does not contain the IP address associated with a hostname, then it forwards the
request to another DNS server. If IP address has arrived at the resolver, which in turn completes
the request over the internet protocol.
NOTE: Domain name is the address of your website that people type in the browser’s URL
bar to visit your website. In other words, if your website was a house, then your domain name
will be its address. A domain name can have words which makes it easy to remember website
addresses. Now if you wanted to visit a website on the internet, you don’t need to type a
string of numbers. Instead, you can type in an easy to remember domain name, for example,
wpbeginner.com. Web hosting is the place where all the files of your website live. It is like
the home of your website where it actually lives. When someone enters your domain name in
a browser, the domain name is translated into the IP address of your web hosting company’s
computer. This computer contains your website’s files, and it sends those files back to the
users’ browsers.
CRYPTOGRAPHY
It is technique of securing information and communications through use of codes so that
only those persons for whom the information is intended can understand it and process it.
Thus, preventing unauthorized access to information. The prefix “crypt” means “hidden” and
suffix graphy means “writing”.
In Cryptography the techniques which are used to protect information are obtained from
mathematical concepts and a set of rule-based calculations known as algorithms to convert
messages in ways that make it hard to decode it. These algorithms are used for cryptographic
key generation, digital signing, verification to protect data privacy, web browsing on internet
and to protect confidential transactions such as credit card and debit card transactions.
Data Communication and Computer Network
SWETA KUMARI BARNWAL 15
Cryptography refers to the science and art of transforming messages to make them secure and
immune to attacks. It is a method of storing and transmitting data in a particular form so that
only those for whom it is intended can read and process it. Cryptography not only protects data
from theft or alteration but can also be used for user authentication.
Components
There are various components of cryptography which are as follows −
Plaintext and Ciphertext
The original message, before being transformed, is called plaintext. After the message is
transformed, it is called ciphertext. An encryption algorithm transforms the plaintext into
ciphertext; a decryption algorithm transforms the ciphertext back into plaintext. The sender
uses an encryption algorithm, and the receiver uses a decryption algorithm.
Cipher
We refer to encryption and decryption algorithms as ciphers. The term cipher is also used to
refer to different categories of algorithms in cryptography. This is not to say that every sender-
receiver pair needs their very own unique cipher for secure communication. On the contrary,
one cipher can serve millions of communicating pairs.
Key
A key is a number (or a set of numbers) that the cipher, as an algorithm, operates on. To encrypt
a message, we need an encryption algorithm, an encryption key, and plaintext. These create the
ciphertext. To decrypt a message, we need a decryption algorithm, a decryption key, and the
ciphertext. These reveal the original plaintext.
Features Of Cryptography are as follows:
1. Confidentiality:
Information can only be accessed by the person for whom it is intended and no
other person except him can access it.
2. Integrity:
Information cannot be modified in storage or transition between sender and
intended receiver without any addition to information being detected.
3. Non-repudiation:
The creator/sender of information cannot deny his or her intention to send
information at later stage.
4. Authentication:
The identities of sender and receiver are confirmed. As well as destination/origin
of information is confirmed.
Types
There are two types of cryptography which are as follows −
Symmetric Key Cryptography
In symmetric-key cryptography, the same key is used by both parties. The sender uses this key
and an encryption algorithm to encrypt data; the receiver uses the same key and the
corresponding decryption algorithm to decrypt the data.
Asymmetric-Key Cryptography
Data Communication and Computer Network
SWETA KUMARI BARNWAL 16
In asymmetric or public-key cryptography, there are two keys: a private key and a public key.
The private key is kept by the receiver. The public key is announced to the public.
In public-key encryption/decryption, the public key that is used for encryption is different from
the private key that is used for decryption. The public key is available to the public, and the
private key is available only to an individual.
Traditional Cipher
In the second chapter, we discussed the fundamentals of modern cryptography. We equated
cryptography with a toolkit where various cryptographic techniques are considered as the
basic tools. One of these tools is the Symmetric Key Encryption where the key used for
encryption and decryption is the same.
In this chapter, we discuss this technique further and its applications to develop various
cryptosystems.
Earlier Cryptographic Systems
Before proceeding further, you need to know some facts about historical cryptosystems −
• All of these systems are based on symmetric key encryption scheme.
• The only security service these systems provide is confidentiality of information.
• Unlike modern systems which are digital and treat data as binary numbers, the earlier
systems worked on alphabets as basic element.
These earlier cryptographic systems are also referred to as Ciphers. In general, a cipher is
simply just a set of steps (an algorithm) for performing both an encryption, and the
corresponding decryption.
Caesar Cipher
It is a mono-alphabetic cipher wherein each letter of the plaintext is substituted by another
letter to form the ciphertext. It is a simplest form of substitution cipher scheme.
This cryptosystem is generally referred to as the Shift Cipher. The concept is to replace each
alphabet by another alphabet which is ‘shifted’ by some fixed number between 0 and 25.
For this type of scheme, both sender and receiver agree on a ‘secret shift number’ for shifting
the alphabet. This number which is between 0 and 25 becomes the key of encryption.
The name ‘Caesar Cipher’ is occasionally used to describe the Shift Cipher when the ‘shift of
three’ is used.
Process of Shift Cipher
• In order to encrypt a plaintext letter, the sender positions the sliding ruler underneath
the first set of plaintext letters and slides it to LEFT by the number of positions of the
secret shift.
• The plaintext letter is then encrypted to the ciphertext letter on the sliding ruler
underneath. The result of this process is depicted in the following illustration for an
Data Communication and Computer Network
SWETA KUMARI BARNWAL 17
agreed shift of three positions. In this case, the plaintext ‘tutorial’ is encrypted to the
ciphertext ‘WXWRULDO’. Here is the ciphertext alphabet for a Shift of 3 −
• On receiving the ciphertext, the receiver who also knows the secret shift, positions his
sliding ruler underneath the ciphertext alphabet and slides it to RIGHT by the agreed
shift number, 3 in this case.
• He then replaces the ciphertext letter by the plaintext letter on the sliding ruler
underneath. Hence the ciphertext ‘WXWRULDO’ is decrypted to ‘tutorial’. To
decrypt a message encoded with a Shift of 3, generate the plaintext alphabet using a
shift of ‘-3’ as shown below −
Security Value
Caesar Cipher is not a secure cryptosystem because there are only 26 possible keys to try out.
An attacker can carry out an exhaustive key search with available limited computing
resources.
Simple Substitution Cipher
It is an improvement to the Caesar Cipher. Instead of shifting the alphabets by some number,
this scheme uses some permutation of the letters in alphabet.
For example, A.B…..Y.Z and Z.Y……B.A are two obvious permutation of all the letters in
alphabet. Permutation is nothing but a jumbled up set of alphabets.
With 26 letters in alphabet, the possible permutations are 26! (Factorial of 26) which is equal
to 4x1026
. The sender and the receiver may choose any one of these possible permutation as a
ciphertext alphabet. This permutation is the secret key of the scheme.
Process of Simple Substitution Cipher
• Write the alphabets A, B, C,...,Z in the natural order.
• The sender and the receiver decide on a randomly selected permutation of the letters
of the alphabet.
• Underneath the natural order alphabets, write out the chosen permutation of the letters
of the alphabet. For encryption, sender replaces each plaintext letters by substituting
the permutation letter that is directly beneath it in the table. This process is shown in
the following illustration. In this example, the chosen permutation is K,D, G, ..., O.
The plaintext ‘point’ is encrypted to ‘MJBXZ’.
Here is a jumbled Ciphertext alphabet, where the order of the ciphertext letters is a key.
Data Communication and Computer Network
SWETA KUMARI BARNWAL 18
• On receiving the ciphertext, the receiver, who also knows the randomly chosen
permutation, replaces each ciphertext letter on the bottom row with the corresponding
plaintext letter in the top row. The ciphertext ‘MJBXZ’ is decrypted to ‘point’.
Security Value
Simple Substitution Cipher is a considerable improvement over the Caesar Cipher. The
possible number of keys is large (26!) and even the modern computing systems are not yet
powerful enough to comfortably launch a brute force attack to break the system. However, the
Simple Substitution Cipher has a simple design and it is prone to design flaws, say choosing
obvious permutation, this cryptosystem can be easily broken.
Monoalphabetic and Polyalphabetic Cipher
Monoalphabetic cipher is a substitution cipher in which for a given key, the cipher alphabet
for each plain alphabet is fixed throughout the encryption process. For example, if ‘A’ is
encrypted as ‘D’, for any number of occurrences in that plaintext, ‘A’ will always get
encrypted to ‘D’.
All of the substitution ciphers we have discussed earlier in this chapter are monoalphabetic;
these ciphers are highly susceptible to cryptanalysis.
Polyalphabetic Cipher is a substitution cipher in which the cipher alphabet for the plain
alphabet may be different at different places during the encryption process. The next two
examples, playfair and Vigenere Cipher are polyalphabetic ciphers.
Playfair Cipher
In this scheme, pairs of letters are encrypted, instead of single letters as in the case of simple
substitution cipher.
In playfair cipher, initially a key table is created. The key table is a 5×5 grid of alphabets that
acts as the key for encrypting the plaintext. Each of the 25 alphabets must be unique and one
letter of the alphabet (usually J) is omitted from the table as we need only 25 alphabets instead
of 26. If the plaintext contains J, then it is replaced by I.
The sender and the receiver deicide on a particular key, say ‘tutorials’. In a key table, the first
characters (going left to right) in the table is the phrase, excluding the duplicate letters. The
rest of the table will be filled with the remaining letters of the alphabet, in natural order. The
key table works out to be −
Data Communication and Computer Network
SWETA KUMARI BARNWAL 19
Process of Playfair Cipher
• First, a plaintext message is split into pairs of two letters (digraphs). If there is an odd
number of letters, a Z is added to the last letter. Let us say we want to encrypt the
message “hide money”. It will be written as −
HI DE MO NE YZ
• The rules of encryption are −
o If both the letters are in the same column, take the letter below each one (going
back to the top if at the bottom)
T U O R I
‘H’ and ‘I’ are in same column, hence take letter below them to replace.
HI → QC
A L S B C
D E F G H
K M N P Q
V W X Y Z
• If both letters are in the same row, take the letter to the right of each one (going back
to the left if at the farthest right)
T U O R I
‘D’ and ‘E’ are in same row, hence take letter to the right of them to
replace. DE → EF
A L S B C
Data Communication and Computer Network
SWETA KUMARI BARNWAL 20
D E F G H
K M N P Q
V W X Y Z
• If neither of the preceding two rules are true, form a rectangle with the two letters and
take the letters on the horizontal opposite corner of the rectangle.
Using these rules, the result of the encryption of ‘hide money’ with the key of ‘tutorials’ would
be −
QC EF NU MF ZV
Decrypting the Playfair cipher is as simple as doing the same process in reverse. Receiver has
the same key and can create the same key table, and then decrypt any messages made using
that key.
Security Value
It is also a substitution cipher and is difficult to break compared to the simple substitution
cipher. As in case of substitution cipher, cryptanalysis is possible on the Playfair cipher as
well, however it would be against 625 possible pairs of letters (25x25 alphabets) instead of 26
different possible alphabets.
The Playfair cipher was used mainly to protect important, yet non-critical secrets, as it is quick
to use and requires no special equipment.
Vigenère Cipher
This scheme of cipher uses a text string (say, a word) as a key, which is then used for doing a
number of shifts on the plaintext.
For example, let’s assume the key is ‘point’. Each alphabet of the key is converted to its
respective numeric value: In this case,
p → 16, o → 15, i → 9, n → 14, and t → 20.
Thus, the key is: 16 15 9 14 20.
Data Communication and Computer Network
SWETA KUMARI BARNWAL 21
Process of Vigenere Cipher
• The sender and the receiver decide on a key. Say ‘point’ is the key. Numeric
representation of this key is ‘16 15 9 14 20’.
• The sender wants to encrypt the message, say ‘attack from south east’. He will arrange
plaintext and numeric key as follows −
• He now shifts each plaintext alphabet by the number written below it to create
ciphertext as shown below −
• Here, each plaintext character has been shifted by a different amount – and that amount
is determined by the key. The key must be less than or equal to the size of the message.
• For decryption, the receiver uses the same key and shifts received ciphertext in reverse
order to obtain the plaintext.
Security Value
Vigenere Cipher was designed by tweaking the standard Caesar cipher to reduce the
effectiveness of cryptanalysis on the ciphertext and make a cryptosystem more robust. It is
significantly more secure than a regular Caesar Cipher.
In the history, it was regularly used for protecting sensitive political and military information.
It was referred to as the unbreakable cipher due to the difficulty it posed to the cryptanalysis.
Variants of Vigenere Cipher
There are two special cases of Vigenere cipher −
• The keyword length is same as plaintect message. This case is called Vernam Cipher.
It is more secure than typical Vigenere cipher.
• Vigenere cipher becomes a cryptosystem with perfect secrecy, which is called One-
time pad.
One-Time Pad
The circumstances are −
• The length of the keyword is same as the length of the plaintext.
Data Communication and Computer Network
SWETA KUMARI BARNWAL 22
• The keyword is a randomly generated string of alphabets.
• The keyword is used only once.
Security Value
Let us compare Shift cipher with one-time pad.
Shift Cipher − Easy to Break
In case of Shift cipher, the entire message could have had a shift between 1 and 25. This is a
very small size, and very easy to brute force. However, with each character now having its
own individual shift between 1 and 26, the possible keys grow exponentially for the message.
One-time Pad − Impossible to Break
Let us say, we encrypt the name “point” with a one-time pad. It is a 5 letter text. To break the
ciphertext by brute force, you need to try all possibilities of keys and conduct computation for
(26 x 26 x 26 x 26 x 26) = 265
= 11881376 times. That’s for a message with 5 alphabets. Thus,
for a longer message, the computation grows exponentially with every additional alphabet.
This makes it computationally impossible to break the ciphertext by brute force.
Transposition Cipher
It is another type of cipher where the order of the alphabets in the plaintext is rearranged to
create the ciphertext. The actual plaintext alphabets are not replaced.
An example is a ‘simple columnar transposition’ cipher where the plaintext is written
horizontally with a certain alphabet width. Then the ciphertext is read vertically as shown.
For example, the plaintext is “golden statue is in eleventh cave” and the secret random key
chosen is “five”. We arrange this text horizontally in table with number of column equal to
key value. The resulting text is shown below.
The ciphertext is obtained by reading column vertically downward from first to last column.
The ciphertext is ‘gnuneaoseenvltiltedasehetivc’.
Data Communication and Computer Network
SWETA KUMARI BARNWAL 23
To decrypt, the receiver prepares similar table. The number of columns is equal to key number.
The number of rows is obtained by dividing number of total ciphertext alphabets by key value
and rounding of the quotient to next integer value.
The receiver then writes the received ciphertext vertically down and from left to right column.
To obtain the text, he reads horizontally left to right and from top to bottom row.

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Network Layer
Network LayerNetwork Layer
Network Layer
 
IPv6 header
IPv6 headerIPv6 header
IPv6 header
 
Presentation on arp protocol
Presentation on arp protocolPresentation on arp protocol
Presentation on arp protocol
 
Arp and rarp
Arp and rarpArp and rarp
Arp and rarp
 
Introduction to the Data Link Layer
Introduction to the Data Link LayerIntroduction to the Data Link Layer
Introduction to the Data Link Layer
 
Ethernet Computer network
Ethernet Computer networkEthernet Computer network
Ethernet Computer network
 
TCP and UDP
TCP and UDP TCP and UDP
TCP and UDP
 
Cs8591 Computer Networks
Cs8591 Computer NetworksCs8591 Computer Networks
Cs8591 Computer Networks
 
IPv4
IPv4IPv4
IPv4
 
Data link layer
Data link layer Data link layer
Data link layer
 
computer Netwoks - network layer
computer Netwoks - network layercomputer Netwoks - network layer
computer Netwoks - network layer
 
Tcp
TcpTcp
Tcp
 
Chapter 4 data link layer
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layer
 
Introduction of tcp, ip & udp
Introduction of tcp, ip & udpIntroduction of tcp, ip & udp
Introduction of tcp, ip & udp
 
RARP, BOOTP, DHCP and PXE Protocols
RARP, BOOTP, DHCP and PXE ProtocolsRARP, BOOTP, DHCP and PXE Protocols
RARP, BOOTP, DHCP and PXE Protocols
 
Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)Transmission Control Protocol (TCP)
Transmission Control Protocol (TCP)
 
IEEE standards 802.3.&802.11
IEEE standards 802.3.&802.11IEEE standards 802.3.&802.11
IEEE standards 802.3.&802.11
 
Flow control main
Flow control mainFlow control main
Flow control main
 
Ethernet
EthernetEthernet
Ethernet
 
Bgp protocol
Bgp protocolBgp protocol
Bgp protocol
 

Similar a Application Layer

Web Programming: Basics of Internet and Introduction to HTML5 and CSS
Web Programming: Basics of Internet and Introduction to HTML5 and CSSWeb Programming: Basics of Internet and Introduction to HTML5 and CSS
Web Programming: Basics of Internet and Introduction to HTML5 and CSSKajal Singh
 
network protocol | Networking by Nitasha Chaturvedi
network protocol | Networking by Nitasha Chaturvedinetwork protocol | Networking by Nitasha Chaturvedi
network protocol | Networking by Nitasha Chaturvedinitashach22
 
Remote Login and File Transfer Protocols
Remote Login and File Transfer ProtocolsRemote Login and File Transfer Protocols
Remote Login and File Transfer ProtocolsHimanshu Pathak
 
Lesson 17 fundamental of internet (88 kb)
Lesson 17 fundamental of internet (88 kb)Lesson 17 fundamental of internet (88 kb)
Lesson 17 fundamental of internet (88 kb)IMRAN KHAN
 
APPLICATION LAYER PROTOCOLS .pptx
APPLICATION LAYER PROTOCOLS         .pptxAPPLICATION LAYER PROTOCOLS         .pptx
APPLICATION LAYER PROTOCOLS .pptxArnavPlayz
 
Basic of it definations
Basic of it definationsBasic of it definations
Basic of it definationstangemjoy
 
Information on protocols-email protocols
Information on protocols-email protocolsInformation on protocols-email protocols
Information on protocols-email protocolsPriyanka Shinde
 
Lesson4.9 d u4l3 hierarchy of open protocols
Lesson4.9 d u4l3 hierarchy of open protocolsLesson4.9 d u4l3 hierarchy of open protocols
Lesson4.9 d u4l3 hierarchy of open protocolsLexume1
 
Computer Networks
Computer NetworksComputer Networks
Computer NetworksShylesh BC
 
A basic guide to the internet
A basic guide to the internetA basic guide to the internet
A basic guide to the internetarunabhatla
 

Similar a Application Layer (20)

Web Programming: Basics of Internet and Introduction to HTML5 and CSS
Web Programming: Basics of Internet and Introduction to HTML5 and CSSWeb Programming: Basics of Internet and Introduction to HTML5 and CSS
Web Programming: Basics of Internet and Introduction to HTML5 and CSS
 
application layer
application layerapplication layer
application layer
 
network protocol | Networking by Nitasha Chaturvedi
network protocol | Networking by Nitasha Chaturvedinetwork protocol | Networking by Nitasha Chaturvedi
network protocol | Networking by Nitasha Chaturvedi
 
internet protocol
internet protocolinternet protocol
internet protocol
 
Assignment 01
Assignment 01Assignment 01
Assignment 01
 
Remote Login and File Transfer Protocols
Remote Login and File Transfer ProtocolsRemote Login and File Transfer Protocols
Remote Login and File Transfer Protocols
 
Lesson 17 fundamental of internet (88 kb)
Lesson 17 fundamental of internet (88 kb)Lesson 17 fundamental of internet (88 kb)
Lesson 17 fundamental of internet (88 kb)
 
APPLICATION LAYER PROTOCOLS .pptx
APPLICATION LAYER PROTOCOLS         .pptxAPPLICATION LAYER PROTOCOLS         .pptx
APPLICATION LAYER PROTOCOLS .pptx
 
Web protocol.pptx
Web protocol.pptxWeb protocol.pptx
Web protocol.pptx
 
Basic of it definations
Basic of it definationsBasic of it definations
Basic of it definations
 
Assignment - 01
Assignment - 01Assignment - 01
Assignment - 01
 
Information on protocols-email protocols
Information on protocols-email protocolsInformation on protocols-email protocols
Information on protocols-email protocols
 
internet protocol
internet protocolinternet protocol
internet protocol
 
Lesson4.9 d u4l3 hierarchy of open protocols
Lesson4.9 d u4l3 hierarchy of open protocolsLesson4.9 d u4l3 hierarchy of open protocols
Lesson4.9 d u4l3 hierarchy of open protocols
 
Internet
InternetInternet
Internet
 
Introduction to telnet
Introduction to telnetIntroduction to telnet
Introduction to telnet
 
Tcp and udp ports
Tcp and udp portsTcp and udp ports
Tcp and udp ports
 
Networking
NetworkingNetworking
Networking
 
Computer Networks
Computer NetworksComputer Networks
Computer Networks
 
A basic guide to the internet
A basic guide to the internetA basic guide to the internet
A basic guide to the internet
 

Más de Sweta Kumari Barnwal

Computer Network-Data Link Layer-Module-2.pdf
Computer Network-Data Link Layer-Module-2.pdfComputer Network-Data Link Layer-Module-2.pdf
Computer Network-Data Link Layer-Module-2.pdfSweta Kumari Barnwal
 
Sensors in Different Applications Area.pdf
Sensors in Different Applications Area.pdfSensors in Different Applications Area.pdf
Sensors in Different Applications Area.pdfSweta Kumari Barnwal
 
Sensor technology module-3-interface electronic circuits
Sensor technology module-3-interface electronic circuitsSensor technology module-3-interface electronic circuits
Sensor technology module-3-interface electronic circuitsSweta Kumari Barnwal
 
Sensors fundamentals and characteristics, physical principle of sensing
Sensors fundamentals and characteristics, physical principle of sensingSensors fundamentals and characteristics, physical principle of sensing
Sensors fundamentals and characteristics, physical principle of sensingSweta Kumari Barnwal
 
Module 5-cloud computing-SECURITY IN THE CLOUD
Module 5-cloud computing-SECURITY IN THE CLOUDModule 5-cloud computing-SECURITY IN THE CLOUD
Module 5-cloud computing-SECURITY IN THE CLOUDSweta Kumari Barnwal
 
Process improvement & service oriented software engineering
Process improvement & service oriented software engineeringProcess improvement & service oriented software engineering
Process improvement & service oriented software engineeringSweta Kumari Barnwal
 

Más de Sweta Kumari Barnwal (20)

UNIT-1 Start Learning R.pdf
UNIT-1 Start Learning R.pdfUNIT-1 Start Learning R.pdf
UNIT-1 Start Learning R.pdf
 
MODULE-2-Cloud Computing.docx.pdf
MODULE-2-Cloud Computing.docx.pdfMODULE-2-Cloud Computing.docx.pdf
MODULE-2-Cloud Computing.docx.pdf
 
Number System.pdf
Number System.pdfNumber System.pdf
Number System.pdf
 
Cloud Computing_Module-1.pdf
Cloud Computing_Module-1.pdfCloud Computing_Module-1.pdf
Cloud Computing_Module-1.pdf
 
Computer Network-Data Link Layer-Module-2.pdf
Computer Network-Data Link Layer-Module-2.pdfComputer Network-Data Link Layer-Module-2.pdf
Computer Network-Data Link Layer-Module-2.pdf
 
Sensors in Different Applications Area.pdf
Sensors in Different Applications Area.pdfSensors in Different Applications Area.pdf
Sensors in Different Applications Area.pdf
 
Sensor technology module-3-interface electronic circuits
Sensor technology module-3-interface electronic circuitsSensor technology module-3-interface electronic circuits
Sensor technology module-3-interface electronic circuits
 
Sensors fundamentals and characteristics, physical principle of sensing
Sensors fundamentals and characteristics, physical principle of sensingSensors fundamentals and characteristics, physical principle of sensing
Sensors fundamentals and characteristics, physical principle of sensing
 
Logic gates
Logic gatesLogic gates
Logic gates
 
Basic computer system
Basic computer systemBasic computer system
Basic computer system
 
Features of windows
Features of windowsFeatures of windows
Features of windows
 
Operating system and services
Operating system and servicesOperating system and services
Operating system and services
 
Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computers
 
Network Layer & Transport Layer
Network Layer & Transport LayerNetwork Layer & Transport Layer
Network Layer & Transport Layer
 
Module 5-cloud computing-SECURITY IN THE CLOUD
Module 5-cloud computing-SECURITY IN THE CLOUDModule 5-cloud computing-SECURITY IN THE CLOUD
Module 5-cloud computing-SECURITY IN THE CLOUD
 
Module 3-cyber security
Module 3-cyber securityModule 3-cyber security
Module 3-cyber security
 
Unit ii-hackers and cyber crimes
Unit ii-hackers and cyber crimesUnit ii-hackers and cyber crimes
Unit ii-hackers and cyber crimes
 
Module 3-cloud computing
Module 3-cloud computingModule 3-cloud computing
Module 3-cloud computing
 
Virtualization - cloud computing
Virtualization - cloud computingVirtualization - cloud computing
Virtualization - cloud computing
 
Process improvement & service oriented software engineering
Process improvement & service oriented software engineeringProcess improvement & service oriented software engineering
Process improvement & service oriented software engineering
 

Último

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIShubhangi Sonawane
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxNikitaBankoti2
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 

Último (20)

2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 

Application Layer

  • 1. Data Communication and Computer Network SWETA KUMARI BARNWAL 1 HTTP o HTTP stands for HyperText Transfer Protocol. o It is a protocol used to access the data on the World Wide Web (www). o The HTTP protocol can be used to transfer the data in the form of plain text, hypertext, audio, video, and so on. o This protocol is known as HyperText Transfer Protocol because of its efficiency that allows us to use in a hypertext environment where there are rapid jumps from one document to another document. o HTTP is similar to the FTP as it also transfers the files from one host to another host. But, HTTP is simpler than FTP as HTTP uses only one connection, i.e., no control connection to transfer the files. o HTTP is used to carry the data in the form of MIME-like format. o HTTP is similar to SMTP as the data is transferred between client and server. The HTTP differs from the SMTP in the way the messages are sent from the client to the server and from server to the client. SMTP messages are stored and forwarded while HTTP messages are delivered immediately. Features of HTTP: o Connectionless protocol: HTTP is a connectionless protocol. HTTP client initiates a request and waits for a response from the server. When the server receives the request, the server processes the request and sends back the response to the HTTP client after CLIENT SERVER Request Response
  • 2. Data Communication and Computer Network SWETA KUMARI BARNWAL 2 which the client disconnects the connection. The connection between client and server exist only during the current request and response time only. o Media independent: HTTP protocol is a media independent as data can be sent as long as both the client and server know how to handle the data content. It is required for both the client and server to specify the content type in MIME-type header. o Stateless: HTTP is a stateless protocol as both the client and server know each other only during the current request. Due to this nature of the protocol, both the client and server do not retain the information between various requests of the web pages. TELNET It stands for TErminaL NETwork. It is a type of protocol that enables one computer to connect to local computer. It is a used as a standard TCP/IP protocol for virtual terminal service which is given by ISO. Computer which starts connection known as the local computer. Computer which is being connected to i.e. which accepts the connection known as remote computer. When the connection is established between local and remote computer. During telnet operation whatever that is being performed on the remote computer will be displayed by local computer. Telnet operates on client/server principle. Local computer uses telnet client program and the remote computers uses telnet server program. • The main task of the internet is to provide services to users. For example, users want to run different application programs at the remote site and transfers a result to the local site. This requires a client-server program such as FTP, SMTP. But this would not allow us to create a specific program for each demand. • The better solution is to provide a general client-server program that lets the user access any application program on a remote computer. Therefore, a program that allows a user to log on to a remote computer. A popular client-server program Telnet is used to meet such demands. Telnet is an abbreviation for Terminal Network. • Telnet provides a connection to the remote computer in such a way that a local terminal appears to be at the remote side. There are two types of login: Local Login
  • 3. Data Communication and Computer Network SWETA KUMARI BARNWAL 3 o When a user logs into a local computer, then it is known as local login. o When the workstation running terminal emulator, the keystrokes entered by the user are accepted by the terminal driver. The terminal driver then passes these characters to the operating system which in turn, invokes the desired application program. o However, the operating system has special meaning to special characters. For example, in UNIX some combination of characters have special meanings such as control character with "z" means suspend. Such situations do not create any problem as the terminal driver knows the meaning of such characters. But, it can cause the problems in remote login. Remote login
  • 4. Data Communication and Computer Network SWETA KUMARI BARNWAL 4 o When the user wants to access an application program on a remote computer, then the user must perform remote login. FTP FTP stands for File transfer protocol. FTP is a standard internet protocol provided by TCP/IP used for transmitting the files from one host to another. It is mainly used for transferring the web page files from their creator to the computer that acts as a server for other computers on the internet. It is also used for downloading the files to computer from other servers. Objectives of FTP It provides the sharing of files. It is used to encourage the use of remote computers. It transfers the data more reliably and efficiently. File Transfer Protocol(FTP) is an application layer protocol which moves files between local and remote file systems. It runs on the top of TCP, like HTTP. To transfer a file, 2 TCP connections are used by FTP in parallel: control connection and data connection.
  • 5. Data Communication and Computer Network SWETA KUMARI BARNWAL 5 Electronic mail It is one of most widely used services of Internet. This service allows an Internet user to send a message in formatted manner (mail) to the other Internet user in any part of world. Message in mail not only contain text, but it also contains images, audio and videos data. The person who is sending mail is called sender and person who receives mail is called recipient. It is just like postal mail service. Email messages include three components, which are as follows: Message envelope: It depicts the email's electronic format. Message header: It contains email subject line and sender/recipient information. Message body: It comprises images, text, and other file attachments. Email can be used in different ways: it can be used to communicate either within an organization or personally, including between two people or a large group of people. Most people get benefit from communicating by email with colleagues or friends or individuals or small groups. It allows you to communicate with others around the world and send and receive images, documents, links, and other attachments. Additionally, it offers benefit users to communicate with the flexibility on their own schedule. The email was developed to support rich text with custom formatting, and the original email standard is only capable of supporting plain text messages. In modern times, email supports HTML (Hypertext markup language), which makes it capable of emails to support the same formatting as websites. The email that supports HTML can contain links, images, CSS layouts, and also can send files or "email attachments" along with messages. Most of the mail servers enable users to send several attachments with each message. The attachments were typically limited to one megabyte in the early days of email. Still, nowadays, many mail servers are able to support email attachments of 20 megabytes or more in size. In 1971, as a test e-mail message, Ray Tomlinson sent the first e-mail to himself. This email was contained the text "something like QWERTYUIOP." However, the e-mail message was
  • 6. Data Communication and Computer Network SWETA KUMARI BARNWAL 6 still transmitted through ARPANET, despite sending the e-mail to himself. Most of the electronic mail was being sent as compared to postal mail till 1996. SECURED SHELL It is access credential that is used in the SSH Protocol. In other words, it is a cryptographic network protocol that is used for transferring encrypted data over network. It allows you to connect to a server, or multiple servers, without having you to remember or enter your password for each system that is to login remotely from one system into another. It always comes in key pair: 1. User Key – If public key and private key remain with the user. 2. Host Key – If public key and private key are on a remote system. 3. Session key – Used when large amount of data is to be transmitted. How SSH Works? It uses asymmetric cipher for performing encryption and decryption. There are many encryption methods: Public key – Everyone can see it, no need to protect it. (for encryption function) Private key – Stays in computer, must be protected. (for decryption function) Key pairs can be of the following types: General procedure is :- • Public keys from the local computers (system) are passed to the server which is to be accessed. • Server then identifies if the public key is registered. • If so, the server then creates a new secret key and encrypts it with the public key which was send to it via local computer. • This encrypted code is send to the local computer. • This data is unlocked by the private key of the system and is send to the server. • Server after receiving this data verifies the local computer. • SSH creates a route and all the encrypted data are transferred through it with no security issues. WWW WWW stands for World Wide Web. A technical definition of the World Wide Web is : all the resources and users on the Internet that are using the Hypertext Transfer Protocol (HTTP). A broader definition comes from the organization that Web inventor Tim Berners-Lee helped found, the World Wide Web Consortium (W3C). The World Wide Web is the universe of network-accessible information, an embodiment of human knowledge. In simple terms, The World Wide Web is a way of exchanging information between computers on the Internet, tying them together into a vast collection of interactive multimedia resources. Internet and Web is not the same thing: Web uses internet to pass over the information.
  • 7. Data Communication and Computer Network SWETA KUMARI BARNWAL 7 Evolution World Wide Web was created by Timothy Berners Lee in 1989 at CERN in Geneva. The following diagram briefly defines evolution of World Wide Web: WWW Architecture WWW architecture is divided into several layers as shown in the following diagram:
  • 8. Data Communication and Computer Network SWETA KUMARI BARNWAL 8 Identifiers and Character Set Uniform Resource Identifier (URI) is used to uniquely identify resources on the web and UNICODE makes it possible to built web pages that can be read and write in human languages. Syntax XML (Extensible Markup Language) helps to define common syntax in semantic web. Data Interchange Resource Description Framework (RDF) framework helps in defining core representation of data for web. RDF represents data about resource in graph form. Taxonomies RDF Schema (RDFS) allows more standardized description of taxonomies and other ontological constructs. Ontologies Web Ontology Language (OWL) offers more constructs over RDFS. It comes in following three versions: • OWL Lite for taxonomies and simple constraints. • OWL DL for full description logic support. • OWL for more syntactic freedom of RDF Rules
  • 9. Data Communication and Computer Network SWETA KUMARI BARNWAL 9 RIF and SWRL offers rules beyond the constructs that are available from RDFs and OWL. Simple Protocol and RDF Query Language (SPARQL) is SQL like language used for querying RDF data and OWL Ontologies. Proof All semantic and rules that are executed at layers below Proof and their result will be used to prove deductions. Cryptography Cryptography means such as digital signature for verification of the origin of sources is used. User Interface and Applications On the top of layer User interface and Applications layer is built for user interaction. WWW Operation WWW works on client- server approach. Following steps explains how the web works: 1. User enters the URL (say, http://www.tutorialspoint.com) of the web page in the address bar of web browser. 2. Then browser requests the Domain Name Server for the IP address corresponding to www.tutorialspoint.com. 3. After receiving IP address, browser sends the request for web page to the web server using HTTP protocol which specifies the way the browser and web server communicates. 4. Then web server receives request using HTTP protocol and checks its search for the requested web page. If found it returns it back to the web browser and close the HTTP connection. 5. Now the web browser receives the web page, It interprets it and display the contents of web page in web browser’s window. Future
  • 10. Data Communication and Computer Network SWETA KUMARI BARNWAL 10 There had been a rapid development in field of web. It has its impact in almost every area such as education, research, technology, commerce, marketing etc. So the future of web is almost unpredictable. Apart from huge development in field of WWW, there are also some technical issues that W3 consortium has to cope up with. User Interface Work on higher quality presentation of 3-D information is under deveopment. The W3 Consortium is also looking forward to enhance the web to full fill requirements of global communities which would include all regional languages and writing systems. Technology Work on privacy and security is under way. This would include hiding information, accounting, access control, integrity and risk management. Architecture There has been huge growth in field of web which may lead to overload the internet and degrade its performance. Hence more better protocol are required to be developed. Simple Mail Transfer Protocol The Simple Mail Transfer Protocol (SMTP) is used to transfer electronic mail from one user to another. This task is done by means of email client software (User Agents) the user is using. User Agents help the user to type and format the email and store it until internet is available. When an email is submitted to send, the sending process is handled by Message Transfer Agent which is normally comes inbuilt in email client software. Message Transfer Agent uses SMTP to forward the email to another Message Transfer Agent (Server side). While SMTP is used by end user to only send the emails, the Servers normally use SMTP to send as well as receive emails. SMTP uses TCP port number 25 and 587. Client software uses Internet Message Access Protocol (IMAP) or POP protocols to receive emails. File Transfer Protocol The File Transfer Protocol (FTP) is the most widely used protocol for file transfer over the network. FTP uses TCP/IP for communication and it works on TCP port 21. FTP works on Client/Server Model where a client requests file from Server and server sends requested resource back to the client. FTP uses out-of-band controlling i.e. FTP uses TCP port 20 for exchanging controlling information and the actual data is sent over TCP port 21. The client requests the server for a file. When the server receives a request for a file, it opens a TCP connection for the client and transfers the file. After the transfer is complete, the server closes the connection. For a second file, client requests again and the server reopens a new TCP connection.
  • 11. Data Communication and Computer Network SWETA KUMARI BARNWAL 11 Post Office Protocol (POP) The Post Office Protocol version 3 (POP 3) is a simple mail retrieval protocol used by User Agents (client email software) to retrieve mails from mail server. When a client needs to retrieve mails from server, it opens a connection with the server on TCP port 110. User can then access his mails and download them to the local computer. POP3 works in two modes. The most common mode the delete mode, is to delete the emails from remote server after they are downloaded to local machines. The second mode, the keep mode, does not delete the email from mail server and gives the user an option to access mails later on mail server. Hyper Text Transfer Protocol (HTTP) The Hyper Text Transfer Protocol (HTTP) is the foundation of World Wide Web. Hypertext is well organized documentation system which uses hyperlinks to link the pages in the text documents. HTTP works on client server model. When a user wants to access any HTTP page on the internet, the client machine at user end initiates a TCP connection to server on port 80. When the server accepts the client request, the client is authorized to access web pages. To access the web pages, a client normally uses web browsers, who are responsible for initiating, maintaining, and closing TCP connections. HTTP is a stateless protocol, which means the Server maintains no information about earlier requests by clients. HTTP versions • HTTP 1.0 uses non persistent HTTP. At most one object can be sent over a single TCP connection. • HTTP 1.1 uses persistent HTTP. In this version, multiple objects can be sent over a single TCP connection. DNS An application layer protocol defines how the application processes running on different systems, pass the messages to each other. o DNS stands for Domain Name System. o DNS is a directory service that provides a mapping between the name of a host on the network and its numerical address. o DNS is required for the functioning of the internet. o Each node in a tree has a domain name, and a full domain name is a sequence of symbols specified by dots. o DNS is a service that translates the domain name into IP addresses. This allows the users of networks to utilize user-friendly names when looking for other hosts instead of remembering the IP addresses.
  • 12. Data Communication and Computer Network SWETA KUMARI BARNWAL 12 o For example, suppose the FTP site at EduSoft had an IP address of 132.147.165.50, most people would reach this site by specifying ftp.EduSoft.com. Therefore, the domain name is more reliable than IP address. DNS is a TCP/IP protocol used on different platforms. The domain name space is divided into three different sections: generic domains, country domains, and inverse domain. Generic Domains o It defines the registered hosts according to their generic behavior. o Each node in a tree defines the domain name, which is an index to the DNS database. o It uses three-character labels, and these labels describe the organization type. Label Description aero Airlines and aerospace companies biz Businesses or firms com Commercial Organizations coop Cooperative business Organizations edu Educational institutions gov Government institutions info Information service providers int International Organizations
  • 13. Data Communication and Computer Network SWETA KUMARI BARNWAL 13 mil Military groups museum Museum & other nonprofit organizations name Personal names net Network Support centers org Nonprofit Organizations pro Professional individual Organizations Country Domain The format of country domain is same as a generic domain, but it uses two-character country abbreviations (e.g., us for the United States) in place of three character organizational abbreviations. Inverse Domain
  • 14. Data Communication and Computer Network SWETA KUMARI BARNWAL 14 The inverse domain is used for mapping an address to a name. When the server has received a request from the client, and the server contains the files of only authorized clients. To determine whether the client is on the authorized list or not, it sends a query to the DNS server and ask for mapping an address to the name. Working of DNS o DNS is a client/server network communication protocol. DNS clients send requests to the. server while DNS servers send responses to the client. o Client requests contain a name which is converted into an IP address known as a forward DNS lookups while requests containing an IP address which is converted into a name known as reverse DNS lookups. o DNS implements a distributed database to store the name of all the hosts available on the internet. o If a client like a web browser sends a request containing a hostname, then a piece of software such as DNS resolver sends a request to the DNS server to obtain the IP address of a hostname. If DNS server does not contain the IP address associated with a hostname, then it forwards the request to another DNS server. If IP address has arrived at the resolver, which in turn completes the request over the internet protocol. NOTE: Domain name is the address of your website that people type in the browser’s URL bar to visit your website. In other words, if your website was a house, then your domain name will be its address. A domain name can have words which makes it easy to remember website addresses. Now if you wanted to visit a website on the internet, you don’t need to type a string of numbers. Instead, you can type in an easy to remember domain name, for example, wpbeginner.com. Web hosting is the place where all the files of your website live. It is like the home of your website where it actually lives. When someone enters your domain name in a browser, the domain name is translated into the IP address of your web hosting company’s computer. This computer contains your website’s files, and it sends those files back to the users’ browsers. CRYPTOGRAPHY It is technique of securing information and communications through use of codes so that only those persons for whom the information is intended can understand it and process it. Thus, preventing unauthorized access to information. The prefix “crypt” means “hidden” and suffix graphy means “writing”. In Cryptography the techniques which are used to protect information are obtained from mathematical concepts and a set of rule-based calculations known as algorithms to convert messages in ways that make it hard to decode it. These algorithms are used for cryptographic key generation, digital signing, verification to protect data privacy, web browsing on internet and to protect confidential transactions such as credit card and debit card transactions.
  • 15. Data Communication and Computer Network SWETA KUMARI BARNWAL 15 Cryptography refers to the science and art of transforming messages to make them secure and immune to attacks. It is a method of storing and transmitting data in a particular form so that only those for whom it is intended can read and process it. Cryptography not only protects data from theft or alteration but can also be used for user authentication. Components There are various components of cryptography which are as follows − Plaintext and Ciphertext The original message, before being transformed, is called plaintext. After the message is transformed, it is called ciphertext. An encryption algorithm transforms the plaintext into ciphertext; a decryption algorithm transforms the ciphertext back into plaintext. The sender uses an encryption algorithm, and the receiver uses a decryption algorithm. Cipher We refer to encryption and decryption algorithms as ciphers. The term cipher is also used to refer to different categories of algorithms in cryptography. This is not to say that every sender- receiver pair needs their very own unique cipher for secure communication. On the contrary, one cipher can serve millions of communicating pairs. Key A key is a number (or a set of numbers) that the cipher, as an algorithm, operates on. To encrypt a message, we need an encryption algorithm, an encryption key, and plaintext. These create the ciphertext. To decrypt a message, we need a decryption algorithm, a decryption key, and the ciphertext. These reveal the original plaintext. Features Of Cryptography are as follows: 1. Confidentiality: Information can only be accessed by the person for whom it is intended and no other person except him can access it. 2. Integrity: Information cannot be modified in storage or transition between sender and intended receiver without any addition to information being detected. 3. Non-repudiation: The creator/sender of information cannot deny his or her intention to send information at later stage. 4. Authentication: The identities of sender and receiver are confirmed. As well as destination/origin of information is confirmed. Types There are two types of cryptography which are as follows − Symmetric Key Cryptography In symmetric-key cryptography, the same key is used by both parties. The sender uses this key and an encryption algorithm to encrypt data; the receiver uses the same key and the corresponding decryption algorithm to decrypt the data. Asymmetric-Key Cryptography
  • 16. Data Communication and Computer Network SWETA KUMARI BARNWAL 16 In asymmetric or public-key cryptography, there are two keys: a private key and a public key. The private key is kept by the receiver. The public key is announced to the public. In public-key encryption/decryption, the public key that is used for encryption is different from the private key that is used for decryption. The public key is available to the public, and the private key is available only to an individual. Traditional Cipher In the second chapter, we discussed the fundamentals of modern cryptography. We equated cryptography with a toolkit where various cryptographic techniques are considered as the basic tools. One of these tools is the Symmetric Key Encryption where the key used for encryption and decryption is the same. In this chapter, we discuss this technique further and its applications to develop various cryptosystems. Earlier Cryptographic Systems Before proceeding further, you need to know some facts about historical cryptosystems − • All of these systems are based on symmetric key encryption scheme. • The only security service these systems provide is confidentiality of information. • Unlike modern systems which are digital and treat data as binary numbers, the earlier systems worked on alphabets as basic element. These earlier cryptographic systems are also referred to as Ciphers. In general, a cipher is simply just a set of steps (an algorithm) for performing both an encryption, and the corresponding decryption. Caesar Cipher It is a mono-alphabetic cipher wherein each letter of the plaintext is substituted by another letter to form the ciphertext. It is a simplest form of substitution cipher scheme. This cryptosystem is generally referred to as the Shift Cipher. The concept is to replace each alphabet by another alphabet which is ‘shifted’ by some fixed number between 0 and 25. For this type of scheme, both sender and receiver agree on a ‘secret shift number’ for shifting the alphabet. This number which is between 0 and 25 becomes the key of encryption. The name ‘Caesar Cipher’ is occasionally used to describe the Shift Cipher when the ‘shift of three’ is used. Process of Shift Cipher • In order to encrypt a plaintext letter, the sender positions the sliding ruler underneath the first set of plaintext letters and slides it to LEFT by the number of positions of the secret shift. • The plaintext letter is then encrypted to the ciphertext letter on the sliding ruler underneath. The result of this process is depicted in the following illustration for an
  • 17. Data Communication and Computer Network SWETA KUMARI BARNWAL 17 agreed shift of three positions. In this case, the plaintext ‘tutorial’ is encrypted to the ciphertext ‘WXWRULDO’. Here is the ciphertext alphabet for a Shift of 3 − • On receiving the ciphertext, the receiver who also knows the secret shift, positions his sliding ruler underneath the ciphertext alphabet and slides it to RIGHT by the agreed shift number, 3 in this case. • He then replaces the ciphertext letter by the plaintext letter on the sliding ruler underneath. Hence the ciphertext ‘WXWRULDO’ is decrypted to ‘tutorial’. To decrypt a message encoded with a Shift of 3, generate the plaintext alphabet using a shift of ‘-3’ as shown below − Security Value Caesar Cipher is not a secure cryptosystem because there are only 26 possible keys to try out. An attacker can carry out an exhaustive key search with available limited computing resources. Simple Substitution Cipher It is an improvement to the Caesar Cipher. Instead of shifting the alphabets by some number, this scheme uses some permutation of the letters in alphabet. For example, A.B…..Y.Z and Z.Y……B.A are two obvious permutation of all the letters in alphabet. Permutation is nothing but a jumbled up set of alphabets. With 26 letters in alphabet, the possible permutations are 26! (Factorial of 26) which is equal to 4x1026 . The sender and the receiver may choose any one of these possible permutation as a ciphertext alphabet. This permutation is the secret key of the scheme. Process of Simple Substitution Cipher • Write the alphabets A, B, C,...,Z in the natural order. • The sender and the receiver decide on a randomly selected permutation of the letters of the alphabet. • Underneath the natural order alphabets, write out the chosen permutation of the letters of the alphabet. For encryption, sender replaces each plaintext letters by substituting the permutation letter that is directly beneath it in the table. This process is shown in the following illustration. In this example, the chosen permutation is K,D, G, ..., O. The plaintext ‘point’ is encrypted to ‘MJBXZ’. Here is a jumbled Ciphertext alphabet, where the order of the ciphertext letters is a key.
  • 18. Data Communication and Computer Network SWETA KUMARI BARNWAL 18 • On receiving the ciphertext, the receiver, who also knows the randomly chosen permutation, replaces each ciphertext letter on the bottom row with the corresponding plaintext letter in the top row. The ciphertext ‘MJBXZ’ is decrypted to ‘point’. Security Value Simple Substitution Cipher is a considerable improvement over the Caesar Cipher. The possible number of keys is large (26!) and even the modern computing systems are not yet powerful enough to comfortably launch a brute force attack to break the system. However, the Simple Substitution Cipher has a simple design and it is prone to design flaws, say choosing obvious permutation, this cryptosystem can be easily broken. Monoalphabetic and Polyalphabetic Cipher Monoalphabetic cipher is a substitution cipher in which for a given key, the cipher alphabet for each plain alphabet is fixed throughout the encryption process. For example, if ‘A’ is encrypted as ‘D’, for any number of occurrences in that plaintext, ‘A’ will always get encrypted to ‘D’. All of the substitution ciphers we have discussed earlier in this chapter are monoalphabetic; these ciphers are highly susceptible to cryptanalysis. Polyalphabetic Cipher is a substitution cipher in which the cipher alphabet for the plain alphabet may be different at different places during the encryption process. The next two examples, playfair and Vigenere Cipher are polyalphabetic ciphers. Playfair Cipher In this scheme, pairs of letters are encrypted, instead of single letters as in the case of simple substitution cipher. In playfair cipher, initially a key table is created. The key table is a 5×5 grid of alphabets that acts as the key for encrypting the plaintext. Each of the 25 alphabets must be unique and one letter of the alphabet (usually J) is omitted from the table as we need only 25 alphabets instead of 26. If the plaintext contains J, then it is replaced by I. The sender and the receiver deicide on a particular key, say ‘tutorials’. In a key table, the first characters (going left to right) in the table is the phrase, excluding the duplicate letters. The rest of the table will be filled with the remaining letters of the alphabet, in natural order. The key table works out to be −
  • 19. Data Communication and Computer Network SWETA KUMARI BARNWAL 19 Process of Playfair Cipher • First, a plaintext message is split into pairs of two letters (digraphs). If there is an odd number of letters, a Z is added to the last letter. Let us say we want to encrypt the message “hide money”. It will be written as − HI DE MO NE YZ • The rules of encryption are − o If both the letters are in the same column, take the letter below each one (going back to the top if at the bottom) T U O R I ‘H’ and ‘I’ are in same column, hence take letter below them to replace. HI → QC A L S B C D E F G H K M N P Q V W X Y Z • If both letters are in the same row, take the letter to the right of each one (going back to the left if at the farthest right) T U O R I ‘D’ and ‘E’ are in same row, hence take letter to the right of them to replace. DE → EF A L S B C
  • 20. Data Communication and Computer Network SWETA KUMARI BARNWAL 20 D E F G H K M N P Q V W X Y Z • If neither of the preceding two rules are true, form a rectangle with the two letters and take the letters on the horizontal opposite corner of the rectangle. Using these rules, the result of the encryption of ‘hide money’ with the key of ‘tutorials’ would be − QC EF NU MF ZV Decrypting the Playfair cipher is as simple as doing the same process in reverse. Receiver has the same key and can create the same key table, and then decrypt any messages made using that key. Security Value It is also a substitution cipher and is difficult to break compared to the simple substitution cipher. As in case of substitution cipher, cryptanalysis is possible on the Playfair cipher as well, however it would be against 625 possible pairs of letters (25x25 alphabets) instead of 26 different possible alphabets. The Playfair cipher was used mainly to protect important, yet non-critical secrets, as it is quick to use and requires no special equipment. Vigenère Cipher This scheme of cipher uses a text string (say, a word) as a key, which is then used for doing a number of shifts on the plaintext. For example, let’s assume the key is ‘point’. Each alphabet of the key is converted to its respective numeric value: In this case, p → 16, o → 15, i → 9, n → 14, and t → 20. Thus, the key is: 16 15 9 14 20.
  • 21. Data Communication and Computer Network SWETA KUMARI BARNWAL 21 Process of Vigenere Cipher • The sender and the receiver decide on a key. Say ‘point’ is the key. Numeric representation of this key is ‘16 15 9 14 20’. • The sender wants to encrypt the message, say ‘attack from south east’. He will arrange plaintext and numeric key as follows − • He now shifts each plaintext alphabet by the number written below it to create ciphertext as shown below − • Here, each plaintext character has been shifted by a different amount – and that amount is determined by the key. The key must be less than or equal to the size of the message. • For decryption, the receiver uses the same key and shifts received ciphertext in reverse order to obtain the plaintext. Security Value Vigenere Cipher was designed by tweaking the standard Caesar cipher to reduce the effectiveness of cryptanalysis on the ciphertext and make a cryptosystem more robust. It is significantly more secure than a regular Caesar Cipher. In the history, it was regularly used for protecting sensitive political and military information. It was referred to as the unbreakable cipher due to the difficulty it posed to the cryptanalysis. Variants of Vigenere Cipher There are two special cases of Vigenere cipher − • The keyword length is same as plaintect message. This case is called Vernam Cipher. It is more secure than typical Vigenere cipher. • Vigenere cipher becomes a cryptosystem with perfect secrecy, which is called One- time pad. One-Time Pad The circumstances are − • The length of the keyword is same as the length of the plaintext.
  • 22. Data Communication and Computer Network SWETA KUMARI BARNWAL 22 • The keyword is a randomly generated string of alphabets. • The keyword is used only once. Security Value Let us compare Shift cipher with one-time pad. Shift Cipher − Easy to Break In case of Shift cipher, the entire message could have had a shift between 1 and 25. This is a very small size, and very easy to brute force. However, with each character now having its own individual shift between 1 and 26, the possible keys grow exponentially for the message. One-time Pad − Impossible to Break Let us say, we encrypt the name “point” with a one-time pad. It is a 5 letter text. To break the ciphertext by brute force, you need to try all possibilities of keys and conduct computation for (26 x 26 x 26 x 26 x 26) = 265 = 11881376 times. That’s for a message with 5 alphabets. Thus, for a longer message, the computation grows exponentially with every additional alphabet. This makes it computationally impossible to break the ciphertext by brute force. Transposition Cipher It is another type of cipher where the order of the alphabets in the plaintext is rearranged to create the ciphertext. The actual plaintext alphabets are not replaced. An example is a ‘simple columnar transposition’ cipher where the plaintext is written horizontally with a certain alphabet width. Then the ciphertext is read vertically as shown. For example, the plaintext is “golden statue is in eleventh cave” and the secret random key chosen is “five”. We arrange this text horizontally in table with number of column equal to key value. The resulting text is shown below. The ciphertext is obtained by reading column vertically downward from first to last column. The ciphertext is ‘gnuneaoseenvltiltedasehetivc’.
  • 23. Data Communication and Computer Network SWETA KUMARI BARNWAL 23 To decrypt, the receiver prepares similar table. The number of columns is equal to key number. The number of rows is obtained by dividing number of total ciphertext alphabets by key value and rounding of the quotient to next integer value. The receiver then writes the received ciphertext vertically down and from left to right column. To obtain the text, he reads horizontally left to right and from top to bottom row.