Unit-1 (NS)
Unit-1 (NS)
Unit-1 (NS)
PKC is different from the symmetric key algorithm, which uses only one key to
both encrypt and decrypt. The two types of PKC algorithms are RSA (Rivest,
Shamir, and Adelman) and Digital Signature Algorithm (DSA). PKC encryption
evolved to meet the growing need for secure communication in multiple sectors
such as the military, government offices, etc. This type of cryptography has
become an important element of modern computer security and a critical
component of the cryptocurrency system.
The keys of a pair are mathematically related, and their length is much longer
than those used in symmetric cryptography. So, it is not easy to decipher the
private key from its pubic counterpart. RSA is one of the most common
algorithms for asymmetric encryption in use today.
Benefits of PKC:
o One key cannot be derived from another key, and there is no need to
exchange the keys
o It allows to establish authentication of the sender by using PKC (digital
signature)
o It can be used to create a digital signature in the Operating System software
such as Ubuntu, Red Hat Linux packages distribution, etc.
Example:
Public keys of every user are present in the Public key Register. If B wants to send a
confidential message to C, then B encrypt the message using C Public key. When C
receives the message from B then C can decrypt it using its own Private key. No
other recipient other than C can decrypt the message because only C know C’s
private key.
2)HASH FUNCTIONS:
Hash functions are extremely useful and appear in almost all
information security applications.
Values returned by a hash function are called message digest or simply hash
values. The following picture illustrated hash function −
Features of Hash Functions
• Pre-Image Resistance
o This property means that it should be computationally hard to
reverse a hash function.
o In other words, if a hash function h produced a hash value z, then it
should be a difficult process to find any input value x that hashes to
z.
o This property protects against an attacker who only has a hash
value and is trying to find the input.
• Second Pre-Image Resistance
o This property means given an input and its hash, it should be hard
to find a different input with the same hash.
o In other words, if a hash function h for an input x produces hash
value h(x), then it should be difficult to find any other input value y
such that h(y) = h(x).
o This property of hash function protects against an attacker who has
an input value and its hash, and wants to substitute different value
as legitimate value in place of original input value.
• Collision Resistance
o This property means it should be hard to find two different inputs
of any length that result in the same hash. This property is also
referred to as collision free hash function.
o In other words, for a hash function h, it is hard to find any two
different inputs x and y such that h(x) = h(y).
o Since, hash function is compressing function with fixed hash
length, it is impossible for a hash function not to have collisions.
This property of collision free only confirms that these collisions
should be hard to find.
o This property makes it very difficult for an attacker to find two
input values with the same hash.
o Also, if a hash function is collision-resistant then it is second pre-
image resistant.
The size of each data block varies depending on the algorithm. Typically the
block sizes are from 128 bits to 512 bits. The following illustration
demonstrates hash function −
Avalanche effect results in substantially different hash values for two messages
that differ by even a single bit of data.
Understand the difference between hash function and algorithm correctly. The hash
function generates a hash code by operating on two blocks of fixed-length binary
data.
Hashing algorithm is a process for using the hash function, specifying how the
message will be broken up and how the results from previous message blocks are
chained together.
MD5 was most popular and widely used hash function for quite some years.
• The MD family comprises of hash functions MD2, MD4, MD5 and MD6.
It was adopted as Internet Standard RFC 1321. It is a 128-bit hash
function.
• MD5 digests have been widely used in the software world to provide
assurance about integrity of transferred file. For example, file servers
often provide a pre-computed MD5 checksum for the files, so that a user
can compare the checksum of the downloaded file to it.
• In 2004, collisions were found in MD5. An analytical attack was reported
to be successful only in an hour by using computer cluster. This collision
attack resulted in compromised MD5 and hence it is no longer
recommended for use.
Secure Hash Function (SHA)
Family of SHA comprise of four SHA algorithms; SHA-0, SHA-1, SHA-2, and
SHA-3. Though from same family, there are structurally different.
There are two direct applications of hash function based on its cryptographic
properties.
Password Storage
• Instead of storing password in clear, mostly all logon processes store the
hash values of passwords in the file.
• The Password file consists of a table of pairs which are in the form (user
id, h(P)).
• The process of logon is depicted in the following illustration −
• An intruder can only see the hashes of passwords, even if he accessed the
password. He can neither logon using hash nor can he derive the
password from hash value since hash function possesses the property of
pre-image resistance.
Data Integrity Check
The integrity check helps the user to detect any changes made to original file. It
however, does not provide any assurance about originality. The attacker, instead
of modifying file data, can change the entire file and compute all together new
hash and send to the receiver. This integrity check application is useful only if
the user is sure about the originality of file.
3)DIGITAL SIGNATURE:
Encryption – Process of converting electronic data into another form,
called ciphertext, which cannot be easily understood by anyone except the
authorized parties. This assures data security.
Decryption– Process of translating code to data.
• The message is encrypted at the sender’s side using various
encryption algorithms and decrypted at the receiver’s end with the
help of the decryption algorithms.
• When some message is to be kept secure like username, password,
etc., encryption and decryption techniques are used to assure data
security.
Types of Encryption
1. Symmetric Encryption– Data is encrypted using a key and the
decryption is also done using the same key.
2. Asymmetric Encryption-Asymmetric Cryptography is also known
as public-key cryptography. It uses public and private keys to encrypt
and decrypt data. One key in the pair which can be shared with
everyone is called the public key. The other key in the pair which is
kept secret and is only known by the owner is called the private key.
Either of the keys can be used to encrypt a message; the opposite key
from the one used to encrypt the message is used for decryption.
Public key– Key which is known to everyone. Ex-public key of A is 7, this
information is known to everyone.
Private key– Key which is only known to the person who’s private key it is.
Authentication-Authentication is any process by which a system verifies the
identity of a user who wishes to access it.
Non- repudiation– Non-repudiation means to ensure that a transferred
message has been sent and received by the parties claiming to have sent and
received the message. Non-repudiation is a way to guarantee that the sender of
a message cannot later deny having sent the message and that the recipient
cannot deny having received the message.
Integrity– to ensure that the message was not altered during the transmission.
Message digest -The representation of text in the form of a single string of
digits, created using a formula called a one way hash function. Encrypting a
message digest with a private key creates a digital signature which is an
electronic means of authentication..
Digital Signature
A digital signature is a mathematical technique used to validate the
authenticity and integrity of a message, software, or digital document.