Notes 3 5
Notes 3 5
Primality Testing
Amuch more efficient method is the Euclidean algorithm, which uses the division
algorithm in combination with the observation that the gcd of two numbers also divides their difference.
gcd(a,0) =a
gcd (a, b) =gcd (b, a mod b)
Public Key Cryptography
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.
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
“
Encryption
Given message (Plaintext) M = 88
887 mod 187 = [(884 mod 187) x 882 mod 187) x 881 mod 187)] mod 187
881 mod 187 = 88
882 mod 187 = 7744 mod 187 = 77
884 mod 187 = 59,969,536 mod 187 = 132
887 mod 187 = (88 x 77 x 132) mod 187
= 8,94432 mod 187
= 11
So, Cipher text C = 11
RSAAnalysis
111 mod 187 = 11
112 mod 187 = 121
114 mod 187 = 14641 mod 187 = 55
118 mod 187 = 2,14, 358, 881 mod 187 = 33
118 mod 187 = 2,14, 358, 881 mod 187 = 33
1123 mod 187 = (11 x 121 x 55 x 33 x 33) mod 187
= 79, 720, 245 mod 187
= 88
So, Plaintext M =88
KEY DISTRIBUTION
1. Public announcement
2. Publicly available directory
3. Public-key authority
4. Public-key certificates
Public Announcement
The point of public-key encryption is that the public key is public, hence any participant can send
his or her public key to any other participant, or broadcast the key to the community at large. eg. append
PGP keys to email messages or post to news groups or email list.
Figure 3.5 illustrates the public key distribution
Its major weakness is forgery, anyone could pretend to be user A and send a public key to another
participant or broadcast such a public key. Until the forgery is discovered they can masquerade as
the claimed user.
Publicly Available Directory
The user obtains greater security by registering keys with a public directory. The directory must be
trusted with properties: The authority maintains a directory with a {name, public key} entry for each
participant. Each participant registers a public key with the directory authority. A participant may replace the
existing key with a new one at any time because the corresponding private key has been compromised in
some way.
Participants could also access the directory electronically. For this purpose, secure, authenticated
communication from the authority to the participant is mandatory.
Figure 3.6 illustrates the public key publication
A sends a time stamped message to the public-key authority containing a request for the current
public key of B. The authority responds with a message that is encrypted using the authority’s private
key, PRauth Thus, A is able to decrypt the message using the authority’s public key. Therefore, A is
assured that the message originated with the authority. The message includes the following:
i. B’s public key, PU which A can use to encrypt messages destined for B.
b
ii.The original request, to enable A to match this response with the corresponding
earlier request and to verify that the original request was not altered before
reception by the authority.
iii. The original timestamp, so A can determine that this is not an old message from
the authority containing a key other than B’s current
public key.
vi. At this point, public keys have been securely delivered to A and B, and they may
begin their protected exchange. However, two additional steps are desirable:
vii.B sends a message to A encrypted with PUa and containing A’s nonce (N1) as well
as a new nonce generated by B (N2) Because only B could have decrypted message
(3), the presence of N1 in message (6) assures A that the correspondent is B.
viii. A returns N2, encrypted using B’s public key, to assure B that its correspondent is A.
Public-Key Certificates
i. A user must appeal to the authority for a public key for every other user that it
wishes to contact and it is vulnerable to tampering too.
ii. Public key certificates can be used to exchange keys without contacting a public-
key authority.
iii. Figure 3.8 illustrates the public key Certificate exchanges
iv. A certificate binds an identity to public key, with all contents signed by a trusted
Public- Key or Certificate Authority(CA).
i. This can be verified by anyone who knows the public-key authorities public-key.
ii. A participant can also convey its key information to another by transmitting its
certificate.
Other participants can verify that the certificate was created by the authority. We can place
the following requirements on this scheme:
i. Any participant can read a certificate to determine the name and public key of
the certificate’s owner.
ii. Anyparticipant can verify that the certificate originated from the certificate
authority and is not counterfeit.
Prepared By: Mrs.T.Kavitha, Dept. of CSE
8
8
iii. Only the certificate authority can create and update certificates. iv.Any
participant can verify the currency of thecertificate.
One scheme has become universally accepted for formatting public-keycertificates.
The X.509 standard. X.509 certificates are used in most network security applications,
including IP security, secure sockets layer (SSL), secure electronic transactions (SET), and
S/MIME.
Example 1:
• Choose global public elements
q=23, α = 9
• User A select value XA is 4
• Calculate public YB
Y B= αxB mod q= 93 mod 23
= 729 mod 23
YB = 16
▪ Now, exchange their public keys
▪ Figure 3.13 shows the exchange of keys
After exchange their public keys, each can compute the common key.
● A compute K = (YB)xA mod q
= 164 mod 23
= 65536 mod 23
K=9
● B compute K = (YA)xB modq
= 63 mod 23
= 216 mod 23
K=9
Now A and B can talk securely
▪ compute respective public keys:
YA=397 mod 353 = 40 (Alice)
YB=3233 mod 353 = 248 (Bob)
▪ compute shared session key as:
KAB= Y xA mod 353 = 24897 = 160 (Alice) KAB= Y xB mod
353 = 40233 = 160 (Bob)
7. Alice receives the key and calculates the shared key (with Darth instead of Bob)
Applications
Diffie-Hellman is currently used in many protocols, namely:
• Secure Sockets Layer (SSL)/Transport Layer Security (TLS)
• Secure Shell (SSH)
• Internet Protocol Security (IPSec)
•
Public Key Infrastructure (PKI)
ELLIPTIC CURVE CRYPTOGRAPHY.
Elliptic curve cryptography can be used to encrypt the plain text message M, into
ciphertext.
Prepared By: Mrs.T.Kavitha, Dept. of CSE
13
13
The plain text message M is encoded into a point PM from the finite set of points
in the elliptic group, Ed(a,b).
The first step consists in choosing a generator point, G c Ed(a, b) , such that the smallest
value of n for which nG = o is a very large prime number.
The elliptic group Ed(a,b) and the generator point G are made public.
Each user select a private key,nA< n and compute the public key PA as PA = nAG
To encrypt the message point PM for Bob (B), Alice (A) choses a random integer k and compute the ciphertext pair
of points c. Using Bob‘s public key PB.
➢ In the context of communications across a network, the following attacks can be identified.
• Disclosure: Release of message contents to any person or process not possessingthe
appropriate cryptographic key.
• Traffic analysis: Detection of the pattern of traffic between parties. In a connection-
oriented application, the frequency and duration of connections could be determined,
in which, the number and length of messages between parties could be determined.
• Masquerade: Insertion of messages into the network from afraudulent source.
This includes the creation of messages by an opponent that are purported to
come from an authorized entity. Also included are fraudulent
acknowledgements of message receipt or no receipt by someone other than
the message recipient.
• Content modification: Changes to the contents of a message, including
insertion, deletion, transposition, and modification
• Sequence modification: Any modification to a sequence of messagesbetween
parties, including insertion, deletion, and reordering
• Timing modification: Delay or replay of messages. In a connection-oriented
application, an entire session or sequence of messages could be a replay of
some previous valid session, or individual messages in the sequence could be
delayed or replayed. In a connectionless application, an individual message
(e.g., datagram) could be delayed or replayed
MESSAGE AUTHENTICATION
➢ A mechanism or service used to verify the integrity of amessage.
➢ Assures that data received are exactly as sent (i.e., contain no modification,insertion,
deletion, or replay).
➢ When a hash function is used to provide message authentication, the hashfunction
value is often referred to as a message digest.
Authentication function is of two levels offunctionality
Lower Level
➢ Produces an authenticator: a value to be used to authenticate a message.
Higher-Level
➢ enables a receiver to verify the authenticity of a message
ENCRYPTION
➢ The ciphertext of the entire message serves as its authenticator
Message authentication code (MAC)
➢ A function of the message and a secret key that produces a fixed-lengthvalue
that serves as the authenticator
Hash function
➢ A function that maps a message of any length into a fixed-length hash value,which
serves as the authenticator
Message Encryption-SymmetricEncryption
• HMAC should execute in approximately the same time as the embedded hash function for long
messages. HMAC adds three executions of the hash compression function (for Si , So, and the block
produced from the inner hash). A more efficient implementation is possible, as shown in Figure 12.6.
Two quantities are precomputed:
f(IV, (K+ ⊕ ipad))
f(IV, (K+ ⊕ opad))
where f(cv, block) is the compression function for the hash function, which takes as arguments a
chaining variable of n bits and a block of b bits and produces a chaining variable of n bits. These
quantities only need to be computed initially and every time the key changes. In effect, the
precomputed quantities substitute for the initial value (IV) in the hash function. W
SECURITY OF HMAC:
• The security of any MAC function based on an embedded hash function depends in some way on the
cryptographic strength of the underlying hash function. The appeal of HMAC is that its designers
have been able to prove an exact relationship between the strength of the embedded hash function and
the strength of HMAC.
• The security of a MAC function is generally expressed in terms of the probability of successful
forgery with a given amount of time spent by the forger and a given number of message-tag pairs
SHA:
SHA was developed by the National Institute of Standards and Technology (NIST) and published as
a federal information processing standard (FIPS 180) in 1993.
SHA-512 Logic The algorithm takes as input a message with a maximum length of less than 2128
bits and produces as output a 512-bit message digest. The input is processed in 1024-bit
blocks.
Digital signature
➢ Digital signature is a cryptographic value that is calculated from the data and a secretkey
known only by the signer.
➢ Signature is formed by taking the hash of the message and encrypting the messagewith
creator’s private key
➢ Signatures guarantees, the original content of the message or document that has beensent
is unchanged.
Requirements of DS
➢ The signature must be a bit pattern that depends on the message being signed.
➢ The signature must use some information unique to the sender
➢ The Direct Digital Signature is only including two parties one to send message andother
one to receive it. According to direct digital signature both parties trust each other and
knows their public key. Figure 4.21 shows that DDS Approach.
➢ The sender generates hash code, which is act as signature and encrypt by sender’s
private key and send to receiver.
Drawback
A can read the message from X to Y like an eavesdropper
2) Conventional Encryption, Arbiter does not see message
➢ Because only the sender knows the private key, only the sender could have produceda valid
signature. Figure 4.26 shows RSA approach.
Digital Signature Algorithm
➢ There are three parameters that are public and can be common to a group of users.
➢ A 160-bit prime number q is chosen.
➢ Then, a prime number p is selected with a length between 512 and 1024 bits such that
q divides (P-1).
Biometrics
Kerberos
➢ It is a network authentication protocol designed to allow users, clients and servers,
authenticate themselves to each other through a trusted third party.
➢ Kerberos was designed and developed as part of Project Athena at MIT.
➢ It is done with Symmetric encryption- using no public keys
➢ It provides centralised private-key third-party authentication in a distributed network
➢ Currently, Kerberos is upto 5. Version 4 being the first version to be releasedoutsideof MIT.
➢ This mutual authentication is done using secret key cryptography with parties provingto each
other their identity across an insecure network
➢ Communication between the client and server can be secure after the client and serverhave
used Kerberos to prove their identity.
Kerberos Requirements
➢ Security-strong enough to stop potential eavesdroppers from finding it to be a weak
link
➢ Reliability- is highly reliable employing a distributed server where one server is ableto back
up another.
➢ Transparency-user is not aware that authentication is taking place beyond providing
passwords.
➢ Scalability – accept and support new clients and servers.
• To meet these requirements, Kerberos designers proposed a third-partytrusted
authentication service to arbitrate between the client and server in their mutual
authentication.
➢ The new service, TGS, issues tickets to users who have been authenticated toAS.
Thus, the user first requests a ticket-granting ticket (Tickettgs) from the
AS. The client module in the user workstation saves this ticket. Each time the
user requires access to
a new service, the client applies to the TGS, using the ticket to authenticateitself.
➢ The TGS then grants a ticket for the particular service. The client saves each service-
granting ticket and uses it to authenticate its user to a server each time a particular
service is requested. The client requests a ticket-granting ticket on behalf of the user
by sending its user’s ID and password to the AS,together with the TGS ID, indicating
a request to use the TGS service.
➢ The AS responds with a ticket that is encrypted with a key that is derived from the
user’s password. When this response arrives at the client, the client prompts the user
for his or her password, generates the key, and attempts to decrypt the incoming
message. If the correct password is supplied, the ticket is successfullyrecovered.
➢ The ticket itself consists of the ID and network address of the user, and the ID of the
TGS.
➢ A Kerberos principal is a service or user that is known to the Kerberos system. Each
Kerberos principal is identified by its principal name. Principal names consist of three parts: a
service or user name, an instance name, and a realm name.
Key management and distribution – Symmetric key distribution using symmetric and asymmetric encryption
Symmetric encryption to work, the two parties to an exchange must share the same key, and that key must be
protected from access by others. Furthermore, frequent key changes are usually desirable to limit the amount of data
compromised if an attacker learns the key. Therefore, the strength of any cryptographic system rests with the key
distribution technique, a term that refers to the means of delivering a key to two parties who wish to exchange data
without allowing others to see the key.
For two parties A and B, key distribution can be achieved in a number of ways, as follows:
1. A can select a key and physically deliver it to B.
2. A third party can select the key and physically deliver it to A and B.
3. If A and B have previously and recently used a key, one party can transmit the new key to the other,
encrypted using the old key.
4. If A and B each has an encrypted connection to a third party C, C can deliver a key on the encrypted links
to A and B.
A has a master key, Ka, known only to itself and the KDC; similarly, B shares the master key Kb with the
KDC. The following steps occur.
1. A issues a request to the KDC for a session key to protect a logical connection to B. The message includes
the identity of A and B and a unique identifier, N1, for this transaction, which we refer to as a nonce. The nonce may
be a timestamp, a counter, or a random number; the minimum requirement is that it differs with each request. Also, to
prevent masquerade, it should be difficult for an opponent to guess the nonce. Thus, a random number is a good choice
for a nonce.
2. The KDC responds with a message encrypted using Ka. Thus, A is the only one who can successfully read
the message, and A knows that it originated at the KDC. The message includes two items intended for A:
■ The one-time session key, Ks, to be used for the session
■ The original request message, including the nonce, to enable A to match this response with the appropriate
request.
Thus, A can verify that its original request was not altered before reception by the KDC and, because of the
nonce, that this is not a replay of some previous request. In addition, the message includes two items intended for B:
■ The one-time session key, Ks, to be used for the session
■ An identifier of A (e.g., its network address), IDA These last two items are encrypted with Kb (the master
key that the KDC shares with B). They are to be sent to B to establish the connection and prove A’s identity.
3. A stores the session key for use in the upcoming session and forwards to B the information that originated
at the KDC for B, namely, E(Kb,[Ks } IDA]). Because this information is encrypted with Kb, it is protected from
eavesdropping. B now knows the session key (Ks), knows that the other party is A (from IDA), and knows that the
information originated at the KDC (because it is encrypted using Kb). At this point, a session key has been securely
delivered to A and B, and they may begin their protected exchange. However, two additional steps are desirable:
4. Using the newly minted session key for encryption, B sends a nonce, N2, to A.
5. Also, using Ks, A responds with f(N2), where f is a function that performs some transformation on N2
(e.g., adding one)
As an alternative, a hierarchy of KDCs can be established. For example, there can be local KDCs, each
responsible for a small domain of the overall internetwork, such as a single LAN or a single building. For
communication among entities within the same local domain, the local KDC is responsible for key distribution. If
two entities in different domains desire a shared key, then the corresponding local KDCs can communicate through a
global KDC.
In this case, any one of the three KDCs involved can actually select the key. The hierarchical concept can be
extended to three or even more layers, depending on the size of the user population and the geographic scope of the
internetwork. A hierarchical scheme minimizes the effort involved in master key distribution, because most master
keys are those shared by a local KDC with its local entities. Furthermore, such a scheme limits the damage of a faulty
or subverted KDC to its local area only.
Session Key Life Time
On the other hand, the distribution of session keys delays the start of any exchange and places a burden on
network capacity. A security manager must try to balance these competing considerations in determining the lifetime
of a particular session key.
For connection-oriented protocols, one obvious choice is to use the same session key for the length of time
that the connection is open, using a new session key for each new session. If a logical connection has a very long
lifetime, then it would be prudent to change the session key periodically, perhaps every time the PDU (protocol data
unit) sequence number cycles. For a connectionless protocol, such as a transaction-oriented protocol, there is no
explicit connection initiation or termination.
The most secure approach is to use a new session key for each exchange. However, this negates one of the
principal benefits of connectionless protocols, which is minimum overhead and delay for each transaction. A better
strategy is to use a given session key for a certain fixed period only or for a certain number of transactions. A
Transparent Key Control Scheme The approach suggested in Figure 14.3 has many variations, one of which is
described in this subsection.
The scheme (Figure 14.4) is useful for providing end-to-end encryption at a network or transport level in a
way that is transparent to the end users. The approach assumes that communication makes use of a connection-
oriented end-to-end protocol, such as TCP. The noteworthy element of this approach is a session security module
(SSM), which may consist of functionality
The approach assumes that communication makes use of a connection- oriented end-to-end protocol, such as
TCP. The noteworthy element of this approach is a session security module (SSM), which may consist of
functionality
An extremely simple scheme was put forward by Merkle [MERK79], as illustrated in Figure 14.7. If A wishes to
communicate with B, the following procedure is employed:
1. A generates a public/private key pair {PUa, PRa} and transmits a message to B consisting of PUa and an identifier
of A, IDA.
Its major weakness is forgery, anyone could pretend to be user A and send a public key to another
participant or broadcast such a public key. Until the forgery is discovered they can masquerade as
the claimed user.
Publicly Available Directory
The user obtains greater security by registering keys with a public directory. The directory must be
trusted with properties: The authority maintains a directory with a {name, public key} entry for each
participant. Each participant registers a public key with the directory authority. A participant may replace the
existing key with a new one at any time because the corresponding private key has been compromised in
some way.
Participants could also access the directory electronically. For this purpose, secure, authenticated
communication from the authority to the participant is mandatory.
Figure 3.6 illustrates the public key publication
A sends a time stamped message to the public-key authority containing a request for the current
public key of B. The authority responds with a message that is encrypted using the authority’s private
key, PRauth Thus, A is able to decrypt the message using the authority’s public key. Therefore, A is
assured that the message originated with the authority. The message includes the following:
vii. B’s public key, PU which A can use to encrypt messages destined for B.
b
viii. The original request, to enable A to match this response with the corresponding
earlier request and to verify that the original request was not altered before
reception by the authority.
ix. The original timestamp, so A can determine that this is not an old message from
the authority containing a key other than B’s current
The X.509 standard. X.509 certificates are used in most network security applications,
including IP security, secure sockets layer (SSL), secure electronic transactions (SET), and
S/MIME.
1. Cyber Terrorism –
Cyber terrorism is the use of the computer and internet to perform violent acts that result in loss of life. This
may include different type of activities either by software or hardware for threatening life of citizens.
In general, Cyber terrorism can be defined as an act of terrorism committed through the use of cyberspace or
computer resources.
4. Internet Fraud –
Internet fraud is a type of fraud or deceit which makes use of the Internet and could include hiding of
information or providing incorrect information for the purpose of deceiving victims for money or property.
Internet fraud is not considered a single, distinctive crime but covers a range of illegal and illicit actions
that are committed in cyberspace.
5. Cyber Stalking –
This is a kind of online harassment wherein the victim is subjected to a barrage of online messages and
emails. In this case, these stalkers know their victims and instead of offline stalking, they use the Internet
to stalk. However, if they notice that cyber stalking is not having the desired effect, they begin offline
stalking along with cyber stalking to make the victims’ lives more miserable.
2. Anonymity-
Those who Commit cyber crime are anonymous for us so we cannot do anything to that person.
5. No harsh punishment-
In Cyber crime there is no harsh punishment in every cases. But there is harsh punishment in some cases
like when somebody commits cyber terrorism in that case there is harsh punishment for that individual.
But in other cases there is no harsh punishment so this factor also gives encouragement to that person who
commits cyber crime.
Prevention of Cyber Crime:
Below are some points by means of which we can prevent cyber crime:
1. Use strong password –
Maintain different password and username combinations for each account and resist the temptation to write
them down. Weak passwords can be easily cracked using certain attacking methods like Brute force attack,
Rainbow table attack etc, So make them complex. That means combination of letters, numbers and special
characters.
7. Software should be updated – Operating system should be updated regularly when it comes to internet
security. This can become a potential threat when cybercriminals exploit flaws in the system.
Network access control (NAC) is an umbrella term for managing access to a network. NAC authenticates
users logging into the network and determines what data they can access and actions they can perform.
NAC also examines the health of the user’s computer or mobile device (the endpoints). Elements of a
Network Access Control System