0% found this document useful (0 votes)
28 views22 pages

CN Unit-5

The document discusses Domain Name System (DNS) and how it is used to map domain names to IP addresses. It describes the hierarchy of DNS servers including root, top-level, and authoritative name servers. It also discusses how DNS queries work to resolve domain names to IP addresses in a distributed manner. Finally, it covers email security protocols like S/MIME and how they provide confidentiality, authentication, integrity and non-repudiation for email communications.

Uploaded by

abinayamohan0527
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views22 pages

CN Unit-5

The document discusses Domain Name System (DNS) and how it is used to map domain names to IP addresses. It describes the hierarchy of DNS servers including root, top-level, and authoritative name servers. It also discusses how DNS queries work to resolve domain names to IP addresses in a distributed manner. Finally, it covers email security protocols like S/MIME and how they provide confidentiality, authentication, integrity and non-repudiation for email communications.

Uploaded by

abinayamohan0527
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Domain Name System (DNS) in Application Layer

Last Updated: 29-07-2020


DNS is a host name to IP address translation service. DNS is a distributed database
implemented in a hierarchy of name servers. It is an application layer protocol for message
exchange between clients and servers.
Requirement
Every host is identified by the IP address but remembering numbers is very difficult for the
people and also the IP addresses are not static therefore a mapping is required to change
the domain name to IP address. So DNS is used to convert the domain name of the
websites to their numerical IP address.
Domain :
There are various kinds of DOMAIN :
1. Generic domain : .com(commercial) .edu(educational) .mil(military) .org(non profit
organization) .net(similar to commercial) all these are generic domain.
2. Country domain .in (india) .us .uk
3. Inverse domain if we want to know what is the domain name of the website. Ip to
domain name mapping.So DNS can provide both the mapping for example to find the
ip addresses of geeksforgeeks.org then we have to type nslookup
www.geeksforgeeks.org.
Organization of Domain

It is Very difficult to find out the ip address associated to a website because there are
millions of websites and with all those websites we should be able to generate the ip
address immediately,
there should not be a lot of delay for that to happen organization of database is very
important.
DNS record – Domain name, ip address what is the validity?? what is the time to live ??
and all the information related to that domain name. These records are stored in tree like
structure.
Namespace – Set of possible names, flat or hierarchical . Naming system maintains a
collection of bindings of names to values – given a name, a resolution mechanism returns
the corresponding value –
Name server – It is an implementation of the resolution mechanism.. DNS (Domain Name
System) = Name service in Internet – Zone is an administrative unit, domain is a subtree.

Name to Address Resolution

The host request the DNS name server to resolve the domain name. And the name server
returns the IP address corresponding to that domain name to the host so that the host can
future connect to that IP address.

Hierarchy of Name Servers


Root name servers – It is contacted by name servers that can not resolve the name. It
contacts authoritative name server if name mapping is not known. It then gets the mapping
and return the IP address to the host.
Top level server – It is responsible for com, org, edu etc and all top level country domains
like uk, fr, ca, in etc. They have info about authoritative domain servers and know names
and IP addresses of each authoritative name server for the second level domains.
Authoritative name servers This is organization’s DNS server, providing authoritative
hostName to IP mapping for organization servers. It can be maintained by organization or
service provider. In order to reach cse.dtu.in we have to ask the root DNS server, then it will
point out to the top level domain server and then to authoritative domain name server which
actually contains the IP address. So the authoritative domain server will return the
associative ip address.

Domain Name Server


The client machine sends a request to the local name server, which , if root does not find
the address in its database, sends a request to the root name server , which in turn, will
route the query to an intermediate or authoritative name server. The root name server can
also contain some hostName to IP address mappings . The intermediate name server
always knows who the authoritative name server is. So finally the IP address is returned to
the local name server which in turn returns the IP address to the host.
E-Mail Network Security – Application Layer
Various business services are now offered online though client-server applications. The
most popular forms are web application and e-mail. In both applications, the client
communicates to the designated server and obtains services.
While using a service from any server application, the client and server exchange a lot of
information on the underlying intranet or Internet. We are aware of fact that these
information transactions are vulnerable to various attacks.
Network security entails securing data against attacks while it is in transit on a network. To
achieve this goal, many real-time security protocols have been designed. Such protocol
needs to provide at least the following primary objectives −

 The parties can negotiate interactively to authenticate each other.


 Establish a secret session key before exchanging information on network.
 Exchange the information in encrypted form.
Interestingly, these protocols work at different layers of networking model. For example,
S/MIME protocol works at Application layer, SSL protocol is developed to work at transport
layer, and IPsec protocol works at Network layer.
In this chapter, we will discuss different processes for achieving security for e-mail
communication and associated security protocols. The method for securing DNS is
covered subsequently. In the later chapters, the protocols to achieve web security will be
described.

E-mail Security
Nowadays, e-mail has become very widely used network application. Let’s briefly discuss
the e-mail infrastructure before proceeding to know about e-mail security protocols.
E-mail Infrastructure
The simplest way of sending an e-mail would be sending a message directly from the
sender’s machine to the recipient’s machine. In this case, it is essential for both the
machines to be running on the network simultaneously. However, this setup is impractical
as users may occasionally connect their machines to the network.
Hence, the concept of setting up e-mail servers arrived. In this setup, the mail is sent to a
mail server which is permanently available on the network. When the recipient’s machine
connects to the network, it reads the mail from the mail server.
In general, the e-mail infrastructure consists of a mesh of mail servers, also termed
as Message Transfer Agents (MTAs) and client machines running an e-mail program
comprising of User Agent (UA) and local MTA.
Typically, an e-mail message gets forwarded from its UA, goes through the mesh of MTAs
and finally reaches the UA on the recipient’s machine.

The protocols used for e-mail are as follows −


 Simple mail Transfer Protocol (SMTP) used for forwarding e-mail messages.
 Post Office Protocol (POP) and Internet Message Access Protocol (IMAP) are used
to retrieve the messages by recipient from the server.
MIME
Basic Internet e-mail standard was written in 1982 and it describes the format of e-mail
message exchanged on the Internet. It mainly supports e-mail message written as text in
basic Roman alphabet.
By 1992, the need was felt to improve the same. Hence, an additional
standard Multipurpose Internet Mail Extensions (MIME) was defined. It is a set of
extensions to the basic Internet E-mail standard. MIME provides an ability to send e-mail
using characters other than those of the basic Roman alphabet such as Cyrillic alphabet
(used in Russian), the Greek alphabet, or even the ideographic characters of Chinese.
Another need fulfilled by MIME is to send non-text contents, such as images or video clips.
Due to this features, the MIME standard became widely adopted with SMTP for e-mail
communication.
E-Mail Security Services
Growing use of e-mail communication for important and crucial transactions demands
provision of certain fundamental security services as the following −
 Confidentiality − E-mail message should not be read by anyone but the intended
recipient.
 Authentication − E-mail recipient can be sure of the identity of the sender.
 Integrity − Assurance to the recipient that the e-mail message has not been altered
since it was transmitted by the sender.
 Non-repudiation − E-mail recipient is able to prove to a third party that the sender
really did send the message.
 Proof of submission − E-mail sender gets the confirmation that the message is
handed to the mail delivery system.
 Proof of delivery − Sender gets a confirmation that the recipient received the
message.
Security services such as privacy, authentication, message integrity, and non-repudiation
are usually provided by using public key cryptography.
Typically, there are three different scenarios of e-mail communication. We will discuss the
methods of achieving above security services in these scenarios.
One-to-One E-mail
In this scenario, the sender sends an e-mail message to only one recipient. Usually, not
more than two MTA are involved in the communication.
Let’s assume a sender wants to send a confidential e-mail to a recipient. The provision of
privacy in this case is achieved as follows −
 The sender and receiver have their private-public keys as (S PVT, SPUB) and (RPVT, RPUB)
respectively.
 The sender generates a secret symmetric key, KS for encryption. Though the sender
could have used RPUB for encryption, a symmetric key is used to achieve faster
encryption and decryption.
 The sender encrypts message with key K S and also encrypts KS with public key of
the recipient, RPUB.
 The sender sends encrypted message and encrypted KS to the recipient.
 The recipient first obtains KS by decrypting encoded KS using his private key, RPVT.
 The recipient then decrypts message using the symmetric key, KS.

If message integrity, authentication, and non-repudiation services are also needed in this
scenario, the following steps are added to the above process.
 The sender produces hash of message and digitally signs this hash with his private
key, SPVT.
 The sender sends this signed hash to the recipient along with other components.
 The recipient uses public key SPUB and extracts the hash received under the sender’s
signature.
 The recipient then hashes the decrypted message and now compares the two hash
values. If they match, message integrity is considered to be achieved.
 Also, the recipient is sure that the message is sent by the sender (authentication).
And lastly, the sender cannot deny that he did not send the message (non-
repudiation).
One-to-Multiple Recipients E-mail
In this scenario, the sender sends an e-mail message to two or more recipients. The list is
managed by the sender’s e-mail program (UA + local MTA). All recipients get the same
message.

Let’s assume, the sender wants to send confidential e-mail to many recipients (say R1, R2,
and R3). The provision of privacy in this case is achieved as follows −
 The sender and all recipients have their own pair of private-public keys.
 The sender generates a secret symmetric key, Ks and encrypts the message with
this key.
 The sender then encrypts KS multiple times with public keys of R1, R2, and R3,
getting R1PUB(KS), R2PUB(KS), and R3PUB(KS).
 The sender sends encrypted message and corresponding encrypted K S to the
recipient. For example, recipient 1 (R1) receives encrypted message and R1PUB(KS).
 Each recipient first extracts key KS by decrypting encoded KS using his private key.
 Each recipient then decrypts the message using the symmetric key, KS.
For providing the message integrity, authentication, and non-repudiation, the steps to be
followed are similar to the steps mentioned above in one-to-one e-mail scenario.
One-to-Distribution List E-mail
In this scenario, the sender sends an e-mail message to two or more recipients but the list
of recipients is not managed locally by the sender. Generally, the e-mail server (MTA)
maintains the mailing list.
The sender sends a mail to the MTA managing the mailing list and then the mail is
exploded by MTA to all recipients in the list.

In this case, when the sender wants to send a confidential e-mail to the recipients of the
mailing list (say R1, R2, and R3); the privacy is ensured as follows −
 The sender and all recipients have their own pair of private-public keys. The
Exploder Server has a pair of private-public key for each mailing list (List PUB, ListPVT)
maintained by it.
 The sender generates a secret symmetric key K s and then encrypts the message
with this key.
 The sender then encrypts KS with the public key associated with the list, obtains
ListPUB(KS).
 The sender sends encrypted message and List PUB(KS). The exploder MTA decrypts
ListPUB(KS) using ListPVT and obtains KS.
 The exploder encrypts KS with as many public keys as there are members in the list.
 The Exploder forwards the received encrypted message and corresponding
encrypted KS to all recipients in the list. For example, the Exploder forwards the
encrypted message and R1PUB(KS) to recipient 1 and so on.

For providing the message integrity, authentication, and non-repudiation the steps to be
followed are similar as given in case of one-to-one e-mail scenario.
Interestingly, the e-mail program employing above security method for securing e-mail is
expected to work for all the possible scenarios discussed above. Most of the above
security mechanisms for e-mail are provided by two popular schemes, Pretty Good Privacy
(PGP) and S/MIME. We discuss both in the following sections.
PGP
Pretty Good Privacy (PGP) is an e-mail encryption scheme. It has become the de-facto
standard for providing security services for e-mail communication.
As discussed above, it uses public key cryptography, symmetric key cryptography, hash
function, and digital signature. It provides −

 Privacy
 Sender Authentication
 Message Integrity
 Non-repudiation
Along with these security services, it also provides data compression and key
management support. PGP uses existing cryptographic algorithms such as RSA, IDEA,
MD5, etc., rather than inventing the new ones.

Cryptography and Network Security


Cryptography historically dealt with the construction and analysis of protocols that would prevent any third
parties from reading a private communication between two parties. In the digital age, cryptography has
evolved to address the encryption and decryption of private communications through the internet and
computer systems, a branch of cyber and network security, in a manner far more complex than anything
the world of cryptography had seen before the arrival of computers.

Where Cryptography Comes From


Computer cryptography started with the invention of the first computer nicknamed 'Colossus'. The cipher
machines that were used before, during the Second World War, were in many ways the predecessors to
today's computer devices. The simple language codes used in those early devices were replaced by the
binary computer language of 0s and 1s to give rise to modern computer cryptography.

Modern Usage of Cryptography


In today's time, cyber cryptographic algorithms are used to transfer electronic data over the internet so
that no third-party is able to read the data. The strength of the code is judged according to four
parameters:

1. Confidentiality
This deals with how many people can understand the information that is being transmitted other than the
two parties that are engaged in the conversation. If more people are able to read the files, it means the
communication system is not secure.

2. Integrity
This deals with how easily the information that is being transmitted may be altered on its way from one
spot to another without either the sender or the receiver being aware of the changes to its content.
3. Non-repudiation
Whether or not the creator of the piece of communication may be able to deny the intentions behind
creating the message or its mode of transmission at a later stage.

4. Authentication
The sender and the receiver should both be able to confirm each other's identity as well as the point of
origin of the transmitted information. This is a crucial first step towards establishing the veracity of the
transmitted file.

The aim of cyber security is to attempt to create encryption systems that perform perfectly on all four of
the above-mentioned parameters. This can be almost impossible to fully accomplish, since the strength of
the encryption depends not only on computer programs but also on human behavior. The best security
systems in the world can still be defeated by an easily-guessed password, or the user not logging out after
a session or discussing security information with outsiders.

Today, cryptography uses some of the finest computer and mathematical minds on the planet. Every
industry on the planet, from war to healthcare makes use of encryption to protect sensitive information
that is being transmitted across the internet.

Importance in Cyber Security


The most basic uses of computer cryptography is for scrambling a piece of text and sending it over the
internet to a remote location, where the data is unscrambled and delivered to the receiver. In this manner
computer cryptography and cyber security go hand-in-hand. Certificate Authorities (CAs) are responsible
for passing out digital certificates to validate the ownership of the encryption key that is used for securing
communication on a trust basis. Let's take a look at two popular forms of encryption used by cyber
security experts:

Symmetric
A symmetric encryption is used to create a file that can be both encrypted and decrypted using the same
key. Also known as the 'secret key' encryption, it makes use of the same algorithm to decode a script as
the algorithm used to encrypt it in the first place. This makes it easier for multiple sources to use the key
since only a single code needs to be learned, but it also means there is only a single line of defense
against hackers who may be able to guess the code.

Asymmetric
On the other hand, 'public key' encryption makes use of a key that belongs to a select group of people who
are able to use it for encrypting/decrypting the data. Essentially, the defense of the encryption algorithm
depends on more than a single key. Two keys are often used in this system, one to encrypt the
information and a separate one to decrypt it. While a greater number of keys leads to some amount of
confusion, it makes the communication system much more secure.

Responsibilities for Cyber Security Managers


Cyber security managers pay close attention to the encryption capabilities of their digital network, since it
is the last line of defense against hackers. If the hacker somehow manages to break through the security
firewall, passwords, and other measures taken to keep them out, the encryption becomes the only
safeguard keeping them from reading protected data. Encryption algorithms have grown to become one of
the most effective tools in the arsenal of a cyber security expert.

Public Key Cryptography


Unlike symmetric key cryptography, we do not find historical use of public-key
cryptography. It is a relatively new concept.
Symmetric cryptography was well suited for organizations such as governments, military,
and big financial corporations were involved in the classified communication.
With the spread of more unsecure computer networks in last few decades, a genuine need
was felt to use cryptography at larger scale. The symmetric key was found to be non-
practical due to challenges it faced for key management. This gave rise to the public key
cryptosystems.
The process of encryption and decryption is depicted in the following illustration −

The most important properties of public key encryption scheme are −


 Different keys are used for encryption and decryption. This is a property which set
this scheme different than symmetric encryption scheme.
 Each receiver possesses a unique decryption key, generally referred to as his
private key.
 Receiver needs to publish an encryption key, referred to as his public key.
 Some assurance of the authenticity of a public key is needed in this scheme to avoid
spoofing by adversary as the receiver. Generally, this type of cryptosystem involves
trusted third party which certifies that a particular public key belongs to a specific
person or entity only.
 Encryption algorithm is complex enough to prohibit attacker from deducing the
plaintext from the ciphertext and the encryption (public) key.
 Though private and public keys are related mathematically, it is not be feasible to
calculate the private key from the public key. In fact, intelligent part of any public-key
cryptosystem is in designing a relationship between two keys.
There are three types of Public Key Encryption schemes. We discuss them in following
sections −

RSA Cryptosystem
This cryptosystem is one the initial system. It remains most employed cryptosystem even
today. The system was invented by three scholars Ron Rivest, Adi Shamir, and Len
Adleman and hence, it is termed as RSA cryptosystem.
We will see two aspects of the RSA cryptosystem, firstly generation of key pair and
secondly encryption-decryption algorithms.
Generation of RSA Key Pair
Each person or a party who desires to participate in communication using encryption
needs to generate a pair of keys, namely public key and private key. The process followed
in the generation of keys is described below −
 Generate the RSA modulus (n)
o Select two large primes, p and q.
o Calculate n=p*q. For strong unbreakable encryption, let n be a large number,
typically a minimum of 512 bits.
 Find Derived Number (e)
o Number e must be greater than 1 and less than (p − 1)(q − 1).
o There must be no common factor for e and (p − 1)(q − 1) except for 1. In
other words two numbers e and (p – 1)(q – 1) are coprime.
 Form the public key
o The pair of numbers (n, e) form the RSA public key and is made public.
o Interestingly, though n is part of the public key, difficulty in factorizing a large
prime number ensures that attacker cannot find in finite time the two primes
(p & q) used to obtain n. This is strength of RSA.
 Generate the private key
o Private Key d is calculated from p, q, and e. For given n and e, there is
unique number d.
o Number d is the inverse of e modulo (p - 1)(q – 1). This means that d is the
number less than (p - 1)(q - 1) such that when multiplied by e, it is equal to 1
modulo (p - 1)(q - 1).
o This relationship is written mathematically as follows −
ed = 1 mod (p − 1)(q − 1)
The Extended Euclidean Algorithm takes p, q, and e as input and gives d as output.
Example
An example of generating RSA Key pair is given below. (For ease of understanding, the
primes p & q taken here are small values. Practically, these values are very high).
 Let two primes be p = 7 and q = 13. Thus, modulus n = pq = 7 x 13 = 91.
 Select e = 5, which is a valid choice since there is no number that is common factor
of 5 and (p − 1)(q − 1) = 6 × 12 = 72, except for 1.
 The pair of numbers (n, e) = (91, 5) forms the public key and can be made available
to anyone whom we wish to be able to send us encrypted messages.
 Input p = 7, q = 13, and e = 5 to the Extended Euclidean Algorithm. The output will
be d = 29.
 Check that the d calculated is correct by computing −
de = 29 × 5 = 145 = 1 mod 72
 Hence, public key is (91, 5) and private keys is (91, 29).
Encryption and Decryption
Once the key pair has been generated, the process of encryption and decryption are
relatively straightforward and computationally easy.
Interestingly, RSA does not directly operate on strings of bits as in case of symmetric key
encryption. It operates on numbers modulo n. Hence, it is necessary to represent the
plaintext as a series of numbers less than n.
RSA Encryption
 Suppose the sender wish to send some text message to someone whose public key
is (n, e).
 The sender then represents the plaintext as a series of numbers less than n.
 To encrypt the first plaintext P, which is a number modulo n. The encryption process
is simple mathematical step as −
C = Pe mod n
 In other words, the ciphertext C is equal to the plaintext P multiplied by itself e times
and then reduced modulo n. This means that C is also a number less than n.
 Returning to our Key Generation example with plaintext P = 10, we get ciphertext C

C = 105 mod 91

RSA Decryption
 The decryption process for RSA is also very straightforward. Suppose that the
receiver of public-key pair (n, e) has received a ciphertext C.
 Receiver raises C to the power of his private key d. The result modulo n will be the
plaintext P.
Plaintext = Cd mod n
 Returning again to our numerical example, the ciphertext C = 82 would get
decrypted to number 10 using private key 29 −
Plaintext = 8229 mod 91 = 10

RSA Analysis
The security of RSA depends on the strengths of two separate functions. The RSA
cryptosystem is most popular public-key cryptosystem strength of which is based on the
practical difficulty of factoring the very large numbers.
 Encryption Function − It is considered as a one-way function of converting
plaintext into ciphertext and it can be reversed only with the knowledge of private
key d.
 Key Generation − The difficulty of determining a private key from an RSA public key
is equivalent to factoring the modulus n. An attacker thus cannot use knowledge of
an RSA public key to determine an RSA private key unless he can factor n. It is also
a one way function, going from p & q values to modulus n is easy but reverse is not
possible.
If either of these two functions are proved non one-way, then RSA will be broken. In fact, if
a technique for factoring efficiently is developed then RSA will no longer be safe.
The strength of RSA encryption drastically goes down against attacks if the number p and
q are not large primes and/ or chosen public key e is a small number.

ElGamal Cryptosystem
Along with RSA, there are other public-key cryptosystems proposed. Many of them are
based on different versions of the Discrete Logarithm Problem.
ElGamal cryptosystem, called Elliptic Curve Variant, is based on the Discrete Logarithm
Problem. It derives the strength from the assumption that the discrete logarithms cannot be
found in practical time frame for a given number, while the inverse operation of the power
can be computed efficiently.
Let us go through a simple version of ElGamal that works with numbers modulo p. In the
case of elliptic curve variants, it is based on quite different number systems.
Generation of ElGamal Key Pair
Each user of ElGamal cryptosystem generates the key pair through as follows −
 Choosing a large prime p. Generally a prime number of 1024 to 2048 bits length is
chosen.
 Choosing a generator element g.
o This number must be between 1 and p − 1, but cannot be any number.
o It is a generator of the multiplicative group of integers modulo p. This means
for every integer m co-prime to p, there is an integer k such that gk=a mod n.
For example, 3 is generator of group 5 (Z5 = {1, 2, 3, 4}).

N 3n 3n mod 5

1 3 3

2 9 4

3 27 2
4 81 1

 Choosing the private key. The private key x is any number bigger than 1 and
smaller than p−1.
 Computing part of the public key. The value y is computed from the parameters p,
g and the private key x as follows −
y = gx mod p
 Obtaining Public key. The ElGamal public key consists of the three parameters (p,
g, y).
For example, suppose that p = 17 and that g = 6 (It can be confirmed that 6 is a
generator of group Z17). The private key x can be any number bigger than 1 and
smaller than 71, so we choose x = 5. The value y is then computed as follows −
y = 65 mod 17 = 7
 Thus the private key is 62 and the public key is (17, 6, 7).
Encryption and Decryption
The generation of an ElGamal key pair is comparatively simpler than the equivalent
process for RSA. But the encryption and decryption are slightly more complex than RSA.
ElGamal Encryption
Suppose sender wishes to send a plaintext to someone whose ElGamal public key is (p, g,
y), then −
 Sender represents the plaintext as a series of numbers modulo p.
 To encrypt the first plaintext P, which is represented as a number modulo p. The
encryption process to obtain the ciphertext C is as follows −
o Randomly generate a number k;
Compute two values C1 and C2, where −
o
C1 = gk mod p
C2 = (P*yk) mod p
 Send the ciphertext C, consisting of the two separate values (C1, C2), sent together.
 Referring to our ElGamal key generation example given above, the plaintext P = 13
is encrypted as follows −
o Randomly generate a number, say k = 10
Compute the two values C1 and C2, where −
o
C1 = 6 mod 17
10

C2 = (13*710) mod 17 = 9
 Send the ciphertext C = (C1, C2) = (15, 9).
ElGamal Decryption
 To decrypt the ciphertext (C1, C2) using private key x, the following two steps are
taken −
o Compute the modular inverse of (C1)x modulo p, which is (C1)-x , generally
referred to as decryption factor.
o Obtain the plaintext by using the following formula −
C2 × (C1)-x mod p = Plaintext
 In our example, to decrypt the ciphertext C = (C1, C2) = (15, 9) using private key x =
5, the decryption factor is
15-5 mod 17 = 9
 Extract plaintext P = (9 × 9) mod 17 = 13.
ElGamal Analysis
In ElGamal system, each user has a private key x. and has three components of public
key − prime modulus p, generator g, and public Y = g x mod p. The strength of the
ElGamal is based on the difficulty of discrete logarithm problem.
The secure key size is generally > 1024 bits. Today even 2048 bits long key are used. On
the processing speed front, Elgamal is quite slow, it is used mainly for key authentication
protocols. Due to higher processing efficiency, Elliptic Curve variants of ElGamal are
becoming increasingly popular.

Elliptic Curve Cryptography (ECC)


Elliptic Curve Cryptography (ECC) is a term used to describe a suite of cryptographic tools
and protocols whose security is based on special versions of the discrete logarithm
problem. It does not use numbers modulo p.
ECC is based on sets of numbers that are associated with mathematical objects called
elliptic curves. There are rules for adding and computing multiples of these numbers, just
as there are for numbers modulo p.
ECC includes a variants of many cryptographic schemes that were initially designed for
modular numbers such as ElGamal encryption and Digital Signature Algorithm.
It is believed that the discrete logarithm problem is much harder when applied to points on
an elliptic curve. This prompts switching from numbers modulo p to points on an elliptic
curve. Also an equivalent security level can be obtained with shorter keys if we use elliptic
curve-based variants.
The shorter keys result in two benefits −

 Ease of key management


 Efficient computation
These benefits make elliptic-curve-based variants of encryption scheme highly attractive
for application where computing resources are constrained.

RSA and ElGamal Schemes – A Comparison


Let us briefly compare the RSA and ElGamal schemes on the various aspects.

RSA ElGamal

It is more efficient for encryption. It is more efficient for decryption.


It is less efficient for decryption. It is more efficient for decryption.

For a particular security level, lengthy keys are required in RSA. For the same level of security, very sho

It is widely accepted and used. It is new and not very popular in marke

Symmetric key Algorithms


What is Symmetric Encryption?
Symmetric encryption is a type of encryption where only one key (a secret key) is used to
both encrypt and decrypt electronic information. The entities communicating via
symmetric encryption must exchange the key so that it can be used in the decryption
process. This encryption method differs from asymmetric encryption where a pair of
keys, one public and one private, is used to encrypt and decrypt messages.
By using symmetric encryption algorithms, data is converted to a form that cannot be
understood by anyone who does not possess the secret key to decrypt it. Once the
intended recipient who possesses the key has the message, the algorithm reverses its
action so that the message is returned to its original and understandable form. The secret
key that the sender and recipient both use could be a specific password/code or it can be
random string of letters or numbers that have been generated by a secure random number
generator (RNG). For banking-grade encryption, the symmetric keys must be created
using an RNG that is certified according to industry standards, such as FIPS 140-2.
There are two types of symmetric encryption algorithms:

1. Block algorithms. Set lengths of bits are encrypted in blocks of electronic data with the
use of a specific secret key. As the data is being encrypted, the system holds the data in its
memory as it waits for complete blocks.
2. Stream algorithms. Data is encrypted as it streams instead of being retained in the
system’s memory.
Some examples of symmetric encryption algorithms include:

 AES (Advanced Encryption Standard)


 DES (Data Encryption Standard)
 IDEA (International Data Encryption Algorithm)
 Blowfish (Drop-in replacement for DES or IDEA)
 RC4 (Rivest Cipher 4)
 RC5 (Rivest Cipher 5)
 RC6 (Rivest Cipher 6)
AES, DES, IDEA, Blowfish, RC5 and RC6 are block ciphers. RC4 is stream cipher.

DES
In “modern” computing, DES was the first standardized cipher for securing electronic
communications, and is used in variations (e.g. 2-key or 3-key 3DES). The original DES
is not used anymore as it is considered too “weak”, due to the processing power of
modern computers. Even 3DES is not recommended by NIST and PCI DSS 3.2, just like
all 64-bit ciphers. However, 3DES is still widely used in EMV chip cards.

AES
The most commonly used symmetric algorithm is the Advanced Encryption Standard
(AES), which was originally known as Rijndael. This is the standard set by the U.S.
National Institute of Standards and Technology in 2001 for the encryption of electronic
data announced in U.S. FIPS PUB 197. This standard supersedes DES, which had been in
use since 1977. Under NIST, the AES cipher has a block size of 128 bits, but can have
three different key lengths as shown with AES-128, AES-192 and AES-256.

What is Symmetric Encryption Used For?


While symmetric encryption is an older method of encryption, it is faster and more
efficient than asymmetric encryption, which takes a toll on networks due to performance
issues with data size and heavy CPU use. Due to the better performance and faster speed
of symmetric encryption (compared to asymmetric), symmetric cryptography is typically
used for bulk encryption / encrypting large amounts of data, e.g. for database encryption.
In the case of a database, the secret key might only be available to the database itself to
encrypt or decrypt.

Some examples of where symmetric cryptography is used are:

 Payment applications, such as card transactions where PII needs to be protected to


prevent identity theft or fraudulent charges
 Validations to confirm that the sender of a message is who he claims to be
 Random number generation or hashing

Key management for symmetric encryption - what we need to consider


Unfortunately, symmetric encryption does come with its own drawbacks. Its weakest
point is its aspects of key management, including:

Key Exhaustion
Symmetric Encryption suffers from behavior where every use of a key ‘leaks’ some
information that can potentially be used by an attacker to reconstruct the key. The
defenses against this behavior include using a key hierarchy to ensure that master or key-
encryption keys are not over-used and the appropriate rotation of keys that do encrypt
volumes of data. To be tractable, both these solutions require competent key-management
strategies as if (for example) a retired encryption key cannot be recovered the data is
potentially lost.

Attribution data
Unlike asymmetric (public-key) Certificates, symmetric keys do not have embedded
metadata to record information such as expiry date or an Access Control List to indicate
the use the key may be put to - to Encrypt but not Decrypt for example.
The latter issue is somewhat addressed by standards such as ANSI X9-31 where a key can
be bound to information prescribing its usage. But for full control over what a key can be
used for and when it can be used, a key-management system is required.

Key Management at large scale


Where only a few keys are involved in a scheme (tens to low hundreds), the management
overhead is modest and can be handled through manual, human activity. However, with a
large estate, tracking the expiration and arranging rotation of keys quickly becomes
impractical.

Consider an EMV payment card deployment: millions of cards multiplied by several


keys-per-card requires a dedicated provision and key-management system.

Conclusion
Maintaining large-scale symmetric encryption systems is a very challenging task. This is
especially true when we want to achieve banking-grade security and auditability when the
corporate and/or IT architecture is decentralized / geographically distributed.

Digital signatures are the public-key primitives of message authentication. In the physical
world, it is common to use handwritten signatures on handwritten or typed messages. They
are used to bind signatory to the message.
Similarly, a digital signature is a technique that binds a person/entity to the digital data.
This binding can be independently verified by receiver as well as any third party.
Digital signature is a cryptographic value that is calculated from the data and a secret key
known only by the signer.
In real world, the receiver of message needs assurance that the message belongs to the
sender and he should not be able to repudiate the origination of that message. This
requirement is very crucial in business applications, since likelihood of a dispute over
exchanged data is very high.

Model of Digital Signature


As mentioned earlier, the digital signature scheme is based on public key cryptography.
The model of digital signature scheme is depicted in the following illustration −
The following points explain the entire process in detail −
 Each person adopting this scheme has a public-private key pair.
 Generally, the key pairs used for encryption/decryption and signing/verifying are
different. The private key used for signing is referred to as the signature key and the
public key as the verification key.
 Signer feeds data to the hash function and generates hash of data.
 Hash value and signature key are then fed to the signature algorithm which
produces the digital signature on given hash. Signature is appended to the data and
then both are sent to the verifier.
 Verifier feeds the digital signature and the verification key into the verification
algorithm. The verification algorithm gives some value as output.
 Verifier also runs same hash function on received data to generate hash value.
 For verification, this hash value and output of verification algorithm are compared.
Based on the comparison result, verifier decides whether the digital signature is
valid.
 Since digital signature is created by ‘private’ key of signer and no one else can have
this key; the signer cannot repudiate signing the data in future.
It should be noticed that instead of signing data directly by signing algorithm, usually a
hash of data is created. Since the hash of data is a unique representation of data, it is
sufficient to sign the hash in place of data. The most important reason of using hash
instead of data directly for signing is efficiency of the scheme.
Let us assume RSA is used as the signing algorithm. As discussed in public key encryption
chapter, the encryption/signing process using RSA involves modular exponentiation.
Signing large data through modular exponentiation is computationally expensive and time
consuming. The hash of the data is a relatively small digest of the data, hence signing a
hash is more efficient than signing the entire data.

Importance of Digital Signature


Out of all cryptographic primitives, the digital signature using public key cryptography is
considered as very important and useful tool to achieve information security.
Apart from ability to provide non-repudiation of message, the digital signature also provides
message authentication and data integrity. Let us briefly see how this is achieved by the
digital signature −
 Message authentication − When the verifier validates the digital signature using
public key of a sender, he is assured that signature has been created only by
sender who possess the corresponding secret private key and no one else.
 Data Integrity − In case an attacker has access to the data and modifies it, the
digital signature verification at receiver end fails. The hash of modified data and the
output provided by the verification algorithm will not match. Hence, receiver can
safely deny the message assuming that data integrity has been breached.
 Non-repudiation − Since it is assumed that only the signer has the knowledge of
the signature key, he can only create unique signature on a given data. Thus the
receiver can present data and the digital signature to a third party as evidence if any
dispute arises in the future.
By adding public-key encryption to digital signature scheme, we can create a cryptosystem
that can provide the four essential elements of security namely − Privacy, Authentication,
Integrity, and Non-repudiation.

Encryption with Digital Signature


In many digital communications, it is desirable to exchange an encrypted messages than
plaintext to achieve confidentiality. In public key encryption scheme, a public (encryption)
key of sender is available in open domain, and hence anyone can spoof his identity and
send any encrypted message to the receiver.
This makes it essential for users employing PKC for encryption to seek digital signatures
along with encrypted data to be assured of message authentication and non-repudiation.
This can archived by combining digital signatures with encryption scheme. Let us briefly
discuss how to achieve this requirement. There are two possibilities, sign-then-
encrypt and encrypt-then-sign.
However, the crypto system based on sign-then-encrypt can be exploited by receiver to
spoof identity of sender and sent that data to third party. Hence, this method is not
preferred. The process of encrypt-then-sign is more reliable and widely adopted. This is
depicted in the following illustration −
The receiver after receiving the encrypted data and signature on it, first verifies the
signature using sender’s public key. After ensuring the validity of the signature, he then
retrieves the data through decryption using his private key.

You might also like