Sunteți pe pagina 1din 18

CRYPTOGRAPHY & NETWORK SECURITY

ASSIGNMENT 02
Submitted in Partial Fulfilment of the Requirements
For the Award of degree of

MASTER OF TECHNOLOGY
(COMPUTER SCIENCE AND ENGINEERING)

TO

(A P GOYAL SHIMLA UNIVERSITY )

Submitted By : Submitted To:


Essien Aniekanabasi Michael Mr Anuj Gupta
Roll no: 16001592 Professor
Semester – 7th Department of CSE

DEPARTMENT OF COMPUTER SCIENCES & ENGINEERING A P


GOYAL SHIMLA UNIVERSITY MEHLI-SHOGHI BYPASS ROAD,
SHIMLA, HIMACHAL PRADESH -171009
The following topics are explained in the content below.
 Digital Signatures
 Authentication Protocols
 Digital signature standards
 Kerberos and X.509 with directory authentication service
 Email security-pretty good privacy (PGP)
Digital Signatures:
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.

Authentication Protocol:
An authentication protocol is a type of computer communications
protocol or cryptographic protocol specifically designed for transfer
of authentication data between two entities. It allows the receiving entity to
authenticate the connecting entity (e.g. Client connecting to a Server) as well as
authenticate itself to the connecting entity (Server to a client) by declaring the type
of information needed for authentication as well as syntax. [1] It is the most
important layer of protection needed for secure communication within computer
networks.

Purpose
With the increasing amount of trustworthy information being accessible over the
network, the need for keeping unauthorized persons from access to this data
emerged. Stealing someone's identity is easy in the computing world - special
verification methods had to be invented to find out whether the person/computer
requesting data is really who he says he is. ] The task of the authentication protocol
is to specify the exact series of steps needed for execution of the authentication. It
has to comply with the main protocol principles:

1. A Protocol has to involve two or more parties and everyone involved in the
protocol must know the protocol in advance.
2. All the included parties have to follow the protocol.
3. A protocol has to be unambiguous - each step must be defined precisely.
4. A protocol must be complete - must include a specified action for every
possible situation.
An illustration of password-based authentication using simple authentication
protocol:
Alice (an entity wishing to be verified) and Bob (an entity verifying Alice's
identity) are both aware of the protocol they agreed on using. Bob has Alice's
password stored in a database for comparison.

1. Alice sends Bob her password in a packet complying with the protocol rules.
2. Bob checks the received password against the one stored in his database.
Then he sends a packet saying "Authentication successful" or
"Authentication failed" based on the result.
This is an example of a very basic authentication protocol vulnerable to many
threats such as eavesdropping, replay attack, man-in-the-middle attacks, dictionary
attacks or brute-force attacks. Most authentication protocols are more complicated
in order to be resilient against these attacks.

TYPES:
Authentication protocols developed for PPP Point-to-Point Protocol
Protocols are used mainly by Point-to-Point Protocol (PPP) servers to validate the
identity of remote clients before granting them access to server data. Most of them
use a password as the cornerstone of the authentication. In most cases, the
password has to be shared between the communicating entities in advance.
PAP 2-way handshake scheme

PAP - Password Authentication Protocol


Password Authentication Protocol is one of the oldest authentication protocols.
Authentication is initialized by the client sending a packet
with credentials (username and password) at the beginning of the connection, with
the client repeating the authentication request until acknowledgement is
received. [6] It is highly insecure because credentials are sent "in the clear" and
repeatedly, making it vulnerable even to the most simple attacks
like eavesdropping and man-in-the-middle based attacks. Although widely
supported, it is specified that if an implementation offers a stronger authentication
method, that method must be offered before PAP. Mixed authentication (e.g. the
same client alternately using both PAP and CHAP) is also not expected, as the
CHAP authentication would be compromised by PAP sending the password in
plain-text.
CHAP - Challenge-handshake authentication protocol
The authentication process in this protocol is always initialized by the server/host
and can be performed anytime during the session, even repeatedly. Server sends a
random string (usually 128B long). The client uses password and the string
received as parameters for MD5 hash function and then sends the result together
with username in plain text. Server uses the username to apply the same function
and compares the calculated and received hash. An authentication is successful or
unsuccessful.

Digital Signature Standard (DSS)


The Digital Signature Standard is intended to be used in electronic funds transfer,
software distribution, electronic mail, data storage and applications which require
high data integrity assurance. The Digital Signature Standard can be implemented
in software, hardware or firmware.
The algorithm used behind the Digital Signature Standard is known as the Digital
Signature Algorithm. The algorithm makes use of two large numbers which are
calculated based on a unique algorithm which also considers parameters that
determine the authenticity of the signature. This indirectly also helps in verifying
the integrity of the data attached to the signature. The digital signatures can be
generated only by the authorized person using their private keys and the users or
public can verify the signature with the help of the public keys provided to them.
However, one key difference between encryption and signature operation in the
Digital Signature Standard is that encryption is reversible, whereas the digital
signature operation is not. Another fact about the digital signature standard is that
it does not provide any capability with regards to key distribution or exchange of
keys. In other words, security of the digital signature standard largely depends on
the secrecy of the private keys of the signatory.
The Digital Signature Standard ensures that the digital signature can be
authenticated and the electronic documents carrying the digital signatures are
secure. The standard also ensures non-repudiation with regards to the signatures
and provides all safeguards for imposter prevention. The standard also ensures that
digital signed documents can be tracked.

Kerberos and X.509


Kerberos is a computer-network authentication protocol that works on the basis
of tickets to allow nodes communicating over a non-secure network to prove their
identity to one another in a secure manner. The protocol was named after the
character Kerberos (or Cerberus) from Greek mythology, the ferocious three-
headed guard dog of Hades. Its designers aimed it primarily at a client–
server model and it provides mutual authentication—both the user and the server
verify each other's identity. Kerberos protocol messages are protected
against eavesdropping and replay attacks.
Kerberos builds on symmetric key cryptography and requires a trusted third party,
and optionally may use public-key cryptography during certain phases of
authentication.[1] Kerberos uses UDP port 88 by default.

Protocol:
Description
The client authenticates itself to the Server (AS) which forwards the username to
a key distribution center (KDC). The KDC issues a ticket-granting ticket (TGT),
which is time stamped and encrypts it using the ticket-granting service's
(TGS) secret key and returns the encrypted result to the user's workstation. This is
done infrequently, typically at user logon; the TGT expires at some point although
it may be transparently renewed by the user's session manager while they are
logged in.
When the client needs to communicate with a service on another node (a
"principal", in Kerberos parlance), the client sends the TGT to the TGS, which
usually shares the same host as the KDC. Service must be registered at TGS with
a Service Principal Name (SPN). The client uses the SPN to request access to this
service. After verifying that the TGT is valid and that the user is permitted to
access the requested service, the TGS issues ticket and session keys to the client.
The client then sends the ticket to the service server (SS) along with its service
request.

Kerberos negotiations
The protocol is described in detail below.
User Client-based Login

1. A user enters a username and password on the client machine(s). Other


credential mechanisms like pkinit (RFC 4556) allow for the use of public
keys in place of a password.
2. The client transforms the password into the key of a symmetric cipher. This
either uses the built-in key scheduling, or a one-way hash, depending on the
cipher-suite used.
Client Authentication

1. The client sends a cleartext message of the user ID to the AS (Authentication


Server) requesting services on behalf of the user. (Note: Neither the secret
key nor the password is sent to the AS.)
2. The AS checks to see if the client is in its database. If it is, the AS generates
the secret key by hashing the password of the user found at the database
(e.g., Active Directory in Windows Server) and sends back the following
two messages to the client:
o Message A: Client/TGS Session Key encrypted using the secret key of
the client/user.
o Message B: Ticket-Granting-Ticket (TGT, which includes the client ID,
client network address, ticket validity period, and the client/TGS session
key) encrypted using the secret key of the TGS.
3. Once the client receives messages A and B, it attempts to decrypt message A
with the secret key generated from the password entered by the user. If the
user entered password does not match the password in the AS database, the
client's secret key will be different and thus unable to decrypt message A.
With a valid password and secret key the client decrypts message A to
obtain the Client/TGS Session Key. This session key is used for further
communications with the TGS. (Note: The client cannot decrypt Message B,
as it is encrypted using TGS's secret key.) At this point, the client has
enough information to authenticate itself to the TGS.
Client Service Authorization

1. When requesting services, the client sends the following messages to the
TGS:
o Message C: Composed of the TGT from message B and the ID of the
requested service.
o Message D: Authenticator (which is composed of the client ID and the
timestamp), encrypted using the Client/TGS Session Key.
2. Upon receiving messages C and D, the TGS retrieves message B out of
message C. It decrypts message B using the TGS secret key. This gives it
the "client/TGS session key". Using this key, the TGS decrypts message D
(Authenticator) and compare client ID from message C and D, if they match
server sends the following two messages to the client:
o Message E: Client-to-server ticket (which includes the client ID, client
network address, validity period and Client/Server Session Key)
encrypted using the service's secret key.
o Message F: Client/Server Session Key encrypted with the Client/TGS
Session Key.
Client Service Request

1. Upon receiving messages E and F from TGS, the client has enough
information to authenticate itself to the Service Server (SS). The client
connects to the SS and sends the following two messages:
o Message E: from the previous step (the client-to-server ticket, encrypted
using service's secret key).
o Message G: a new Authenticator, which includes the client ID,
timestamp and is encrypted using Client/Server Session Key.
2. The SS decrypts the ticket (message E) using its own secret key to retrieve
the Client/Server Session Key. Using the sessions key, SS decrypts the
Authenticator and compares client ID from messages E and G, if they match
server sends the following message to the client to confirm its true identity
and willingness to serve the client:
o Message H: the timestamp found in client's Authenticator (plus 1 in
version 4, but not necessary in version 5), encrypted using
the Client/Server Session Key.
3. The client decrypts the confirmation (message H) using the Client/Server
Session Key and checks whether the timestamp is correct. If so, then the
client can trust the server and can start issuing service requests to the server.
4. The server provides the requested services to the client.

Drawbacks and limitations


 Single point of failure: It requires continuous availability of a central server.
When the Kerberos server is down, new users cannot log in. This can be
mitigated by using multiple Kerberos servers and fallback authentication
mechanisms.
 Kerberos has strict time requirements, which means the clocks of the involved
hosts must be synchronized within configured limits. The tickets have a time
availability period and if the host clock is not synchronized with the Kerberos
server clock, the authentication will fail. The default configuration per
MIT requires that clock times be no more than five minutes apart. In
practice Network Time Protocol daemons are usually used to keep the host
clocks synchronized. Note that some servers (Microsoft's implementation being
one of them) may return a KRB_AP_ERR_SKEW result containing the
encrypted server time in case both clocks have an offset greater than the
configured maximum value. In that case, the client could retry by calculating
the time using the provided server time to find the offset. This behavior is
documented in RFC 4430.
 The administration protocol is not standardized and differs between server
implementations. Password changes are described in RFC 3244.
 In case of symmetric cryptography adoption (Kerberos can work using
symmetric or asymmetric (public-key) cryptography), since all authentications
are controlled by a centralized key distribution center (KDC), compromise of
this authentication infrastructure will allow an attacker to impersonate any user.
 Each network service which requires a different host name will need its own set
of Kerberos keys. This complicates virtual hosting and clusters.
 Kerberos requires user accounts, user clients and the services on the server to
all have a trusted relationship to the Kerberos token server (All must be in the
same Kerberos domain or in domains that have a trust relationship between
each other). Kerberos cannot be used in scenarios where users want to connect
to services from unknown/untrusted clients as in a typical Internet or cloud
computer scenario, where the authentication provider typically does not have
knowledge about the users client system.
 The required client trust makes creating staged environments (e.g., separate
domains for test environment, pre-production environment and production
environment) difficult: Either domain trust relationships need to be created that
prevent a strict separation of environment domains or additional user clients
need to be provided for each environment.

Vulnerabilities
The Data Encryption Standard (DES) cipher can be used in combination with
Kerberos, but is no longer an Internet standard because it is weak. [8] Security
vulnerabilities exist in many legacy products that implement Kerberos because
they have not been updated to use newer ciphers like AES instead of DES.

In cryptography, X.509 is a standard defining the format of public key certificates.


X.509 certificates are used in many Internet protocols, including TLS/SSL, which is
the basis for HTTPS[1], the secure protocol for browsing the web. They are also used
in offline applications, like electronic signatures. An X.509 certificate contains a
public key and an identity (a hostname, or an organization, or an individual), and is
either signed by a certificate authority or self-signed. When a certificate is signed by a
trusted certificate authority, or validated by other means, someone holding that
certificate can rely on the public key it contains to establish secure communications
with another party, or validate documents digitally signed by the
corresponding private key.

In the X.509 system, an organization that wants a signed certificate requests one via
a certificate signing request (CSR).
To do this, it first generates a key pair, keeping the private key secret and using it to
sign the CSR. This contains information identifying the applicant and the
applicant's public key that is used to verify the signature of the CSR - and
the Distinguished Name (DN) that the certificate is for. The CSR may be
accompanied by other credentials or proofs of identity required by the certificate
authority.
The certification authority issues a certificate binding a public key to a
particular distinguished name.
An organization's trusted root certificates can be distributed to all employees so that
they can use the company PKI system. Browsers such as Internet
Explorer, Firefox, Opera, Safari and Chrome come with a predetermined set of root
certificates pre-installed, so SSL certificates from major certificate authorities will
work instantly; in effect the browsers' developers determine which CAs are trusted
third parties for the browsers' users. For example, Firefox provides a CSV and/or
HTML file containing a list of Included CAs.
X.509 and RFC 5280 also include standards for certificate revocation list (CRL)
implementations. Another IETF-approved way of checking a certificate's validity is
the Online Certificate Status Protocol (OCSP). Firefox 3 enables OCSP checking by
default, as do versions of Windows from at least Vista and later. [3]

Structure of a certificate
The structure foreseen by the standards is expressed in a formal language, Abstract
Syntax Notation One (ASN.1).
The structure of an X.509 v3 digital certificate is as follows:

 Certificate
o Version Number
o Serial Number
o Signature Algorithm ID
o Issuer Name
o Validity period
 Not Before
 Not After
o Subject name
o Subject Public Key Info
 Public Key Algorithm
 Subject Public Key
o Issuer Unique Identifier (optional)
o Subject Unique Identifier (optional)
o Extensions (optional)
 ...
 Certificate Signature Algorithm
 Certificate Signature
Each extension has its own ID, expressed as object identifier, which is a set of
values, together with either a critical or non-critical indication. A certificate-using
system must reject the certificate if it encounters a critical extension that it does not
recognize, or a critical extension that contains information that it cannot process. A
non-critical extension may be ignored if it is not recognized, but must be processed
if it is recognized.
The structure of version 1 is given in RFC 1422.
ITU-T introduced issuer and subject unique identifiers in version 2 to permit the
reuse of issuer or subject name after some time. An example of reuse will be when
a CA goes bankrupt and its name is deleted from the country's public list. After
some time, another CA with the same name may register itself, even though it is
unrelated to the first one. However, IETF recommends that no issuer and subject
names be reused. Therefore, version 2 is not widely deployed in the Internet.
Extensions were introduced in version 3. A CA can use extensions to issue a
certificate only for a specific purpose (e.g. only for signing digital objects).
In all versions, the serial number must be unique for each certificate issued by a
specific CA (as mentioned in RFC 5280).
Extensions informing a specific usage of a certificate
RFC 5280 (and its predecessors) defines a number of certificate extensions which
indicate how the certificate should be used. Most of them are arcs from the joint-
iso-ccitt(2) ds(5) id-ce(29) OID. Some of the most common, defined in section
4.2.1, are:
 Basic Constraints, { id-ce 19 }, are used to indicate whether the certificate
belongs to a CA.
 Key Usage, { id-ce 15 }, provides a bitmap specifying the cryptographic
operations which may be performed using the public key contained in the
certificate; for example, it could indicate that the key should be used for
signatures but not for encipherment.
 Extended Key Usage, { id-ce 37 }, is used, typically on a leaf certificate, to
indicate the purpose of the public key contained in the certificate. It contains a
list of OIDs, each of which indicates an allowed use. For example, { id-pkix 3 1
} indicates that the key may be used on the server end of a TLS or SSL
connection; { id-pkix 3 4 } indicates that the key may be used to secure email.
In general, if a certificate has several extensions restricting its use, all restrictions
must be satisfied for a given use to be appropriate. RFC 5280 gives the specific
example of a certificate containing both keyUsage and extendedKeyUsage: in this
case, both must be processed and the certificate can only be used if both extensions
are coherent in specifying the usage of a certificate. For example, NSS uses both
extensions to specify certificate usage.

Certificate filename extensions


There are several commonly used filename extensions for X.509 certificates.
Unfortunately, some of these extensions are also used for other data such as private
keys.

 .pem – (Privacy-enhanced Electronic Mail) Base64 encoded DER certificate,


enclosed between "-----BEGIN CERTIFICATE-----" and "-----END
CERTIFICATE-----"
 .cer, .crt, .der – usually in binary DER form, but Base64-encoded certificates
are common too (see .pem above)
 .p7b, .p7c – PKCS#7 SignedData structure without data, just certificate(s)
or CRL(s)
 .p12 – PKCS#12, may contain certificate(s) (public) and private keys (password
protected)
 .pfx – PFX, predecessor of PKCS#12 (usually contains data in PKCS#12
format, e.g., with PFX files generated in IIS)
PKCS#7 is a standard for signing or encrypting (officially called "enveloping")
data. Since the certificate is needed to verify signed data, it is possible to include
them in the SignedData structure. A .P7C file is a degenerated SignedData
structure, without any data to sign.
PKCS#12 evolved from the personal information exchange (PFX) standard and is
used to exchange public and private objects in a single file.

Pretty Good Privacy (PGP)


Pretty Good Privacy or PGP is a popular program used to encrypt and
decrypt email over the Internet, as well as authenticate messages with digital
signatures and encrypted stored files.

Previously available as freeware and now only available as a low-cost commercial


version, PGP was once the most widely used privacy-ensuring program by individuals
and is also used by many corporations. It was developed by Philip R. Zimmermann in
1991 and has become a de facto standard for email security.

How PGP works

Pretty Good Privacy uses a variation of the public key system. In this system, each
user has an encryption key that is publicly known and a private key that is known only
to that user. You encrypt a message you send to someone else using their public key.
When they receive it, they decrypt it using their private key. Since encrypting an
entire message can be time-consuming, PGP uses a faster encryption algorithm to
encrypt the message and then uses the public key to encrypt the shorter key that was
used to encrypt the entire message. Both the encrypted message and the short key are
sent to the receiver who first uses the receiver's private key to decrypt the short key
and then uses that key to decrypt the message.

PGP comes in two public key versions -- Rivest-Shamir-Adleman (RSA) and Diffie-
Hellman. The RSA version, for which PGP must pay a license fee to RSA, uses
the IDEA algorithm to generate a short key for the entire message and RSA to encrypt
the short key. The Diffie-Hellman version uses the CAST algorithm for the short key
to encrypt the message and the Diffie-Hellman algorithm to encrypt the short key.

When sending digital signatures, PGP uses an efficient algorithm that generates
a hash (a mathematical summary) from the user's name and other signature
information. This hash code is then encrypted with the sender's private key. The
receiver uses the sender's public key to decrypt the hash code. If it matches the hash
code sent as the digital signature for the message, the receiver is sure that the message
has arrived securely from the stated sender. PGP's RSA version uses
the MD5 algorithm to generate the hash code. PGP's Diffie-Hellman version uses the
SHA-1 algorithm to generate the hash code.

S-ar putea să vă placă și