Unit 3-Digital-Signature
Unit 3-Digital-Signature
Why Digital Signature :- Authenticity , Integrity , Non-repudiation to eletronic dicument use as secure medium
Private Key:- used for making digital signatures
Sender message (Authenticate using Digital Signature(Private key)) =======> Verify digital signature(Public key) Receiver
Note:-
Encryption:-
Encryption means plain text to coded form.
Decryption:-
Decryption means coded text to plain text.
A digital signature can provide 3 services for security system/approaches.
1) Message Integrity.
MessageAuthentication
2) Message Integrity:- (Permission)
1.integrity of message is preserve of message where there is transmission of message from sender to receiver
2.senderNon-repudiation
3) Message send message with signature(using # Function) with private key
3.receiver receive message and decrypt signature (using # Function) with public key
1) Message Integrity:-
The integrity of the message preserve of the message when there is a transmission from the
sender to the receiver by using # Function , you can check the original message when the
sender send the message in the encrypted form with the digital signature. The sender also
calculate some value by using # Function & send the receiver. The receiver after decrypting
the message also re calculate the value by using # function, if that value match then we can
Message Authentication:-
1.Digital signal
keep the can provideof
originality authentication
the messagereceiver
as it is &can verify that
accepted message
otherwise send
it is by authorize person
rejected.
2.receiver can authenticated sender information
2) Message Authentication:
A secure digital signature can provide the message authentication, the receiver can
verify that message send by the authorize person. The sender‟s publicity can create
If the sender send the message to the receiver but after some times sender deny that
message is send by he sender. One solution is use a trusted third parity. People can create a
third party among them selves, age & send the message sender identity, receiver identity &
signature to the trusted third party after checking that the public key is valid verify thought
the senders public key that the message come from the sender.
Q) Why do need digital signature?
- Integrity
- Faster Procedure
- Completely Secure
- Eliminate the use of paper
- Authentication
Message Digest:-
- Non-repudiation 1.hash function is a math function
2.hash function arbitrary length but output always
- Low cost. 3. value return by hash function called message digest/hash value
4. even if tiny changes in input changes the output
Message digests
Hash functions are extremely useful and appear in almost all information security applications.
A hash function is a mathematical function that converts a numerical input value into another
compressed numerical value. The input to the hash function is of arbitrary length but output is
always of fixed length.
Values returned by a hash function are called message digest or simply hash values. The
following picture illustrated hash function −
Efficiency of Operation
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
What is MD5 ? Explain in detail?
to it.hash algorithm called MD5(Message Digest Method 5)
1. cryptographic
2.used to create 128 bit digest from arbitrary string length.
In 2004,
3. hexadecimal numbercollisions wereto found
of 32 bit used in digest
represent MD5. An analytical attack was reported to be
4. method was created in 1991 by RONALD RIVEST enable verification on digital signature
successful
5. it was include severalonly in an hour
framework by using
to improve computer cluster. This collision attack resulted in
security
compromised MD5 and hence it is no longer recommended for use.
Answer:-
A cryptographic hash algorithm called MD5 (Message Digest Method 5) can be used to create a
128-bit digest from a string of arbitrary length. Hexadecimal numbers of 32 digits are used to
represent the digests.
The method was created in 1991 by Ronald Rivest to enable the verification of digital signatures.
It was included into several different frameworks in order to improve security measures.
Working of MD5
Verify that the input string's size is 64 bits less than a multiple of 512 when you receive it. In
order to round off the extra characters, you must add zeroes after adding one (1) to the bits of
padding. Padding bits:-
1.to digest message hash function need string size multiples of 512
2.when algorithm receive size less than multiples of 512 then it add bit to fulfill requrement
3. by adding zeros after adding one
4.Definition: These are the individual bits (typically '1' followed by '0's) added to the input data to adjust
its length.
Padding Length
The final string needs to include a few more characters in order to be a multiple of 512. To
achieve this, take the original input's length and represent it as 64 bits. Once the two are
combined, the last string is prepared for hashing.
padding length:-
1. final string need few more char to get in multiples of 512
2. in order to get required length few more char added to input
Initialize MD Buffer
The entire string is divided into several blocks, each having 512 bits. In addition, four buffers (A,
B, C, and D) need to be initialised. Each of these 32-bit buffers is initialised as follows –
A 512-bit block can be further divided into 16 sub-blocks, each containing 32 bits. Each of the
four operation rounds makes use of all of the buffers, constant array values, and sub-blocks.
Application of MD5
Message digests are used to authenticate and check the integrity of files.
Data encryption and security were handled using MD5.
It is used for both password verification and message digestion, whatever the message
size.
It is also used for graphics and game boards.
Application of MD5:-
1. Authenticate & check integrity of files
2. data encryption and security handled using MD5
3. used for both password verification and message digestion
This algorithm is frequently used for email address hashing, password hashing, and digital record
verification. SHA-512 is also used in blockchain technology, with the BitShares network
becoming the most known example. Properties of SHA-512:-
1. Deterministic: same input =====> same output
2. data can be calculated very quickly
What is SHA-512? 3. irreversible input (can get input from output)
4.collision resistance: can get same output for different 2 inputs
SHA-512 generates a hash value of 512 bits (64 bytes), making it one of the largest hash
functions in the SHA-2 family. SHA-512, like all cryptographic hash algorithms, has the
following basic properties −
Deterministic − The same input will always get the same result.
Fast to compute − The hash for any given data can be calculated very quickly.
Irreversible − You can not determine the original input from its hash.
Avalanche effect − A small change in input (even flipping a single bit) results in a significantly
different hash.
Without going too far into the mathematical concepts, SHA-512 operates as follows −
Initialization − It starts with eight hash values calculated from the square roots of the initial
eight prime numbers.
Pre-processing − The input message is padded so that it is a multiple of the Block size. The
original message's 128-bit length (before padding) is added to the very end of the padded
message.
Main Loop − The main loop analyses each 1024-bit block in 80 rounds, manipulating the data
via logical operations, bitwise shifts, and modular arithmetic.
Output − After all of the blocks have been processed, the resulting 512-bit message digest is
output as the hash.
Padding means adding some extra bits and the original message's length at the end.
Algorithm 2. Initial Values (Starting Point)
SHA-512 starts with 8 secret numbers (they're calculated from math, but you don’t need to
The SHA-512 algorithm
know how). consists of the following steps −
− First,
These are
Message Padding used your
as themessage is padded
starting point for thetoprocess.
ensure that it is the correct size for the
algorithm. This ensures that it can be broken down into blocks and processed.
3. Breaking the Message
The message is broken into parts. Each part is 1024 bits long.
Initial hash values − The algorithm starts with eight initial hash values. These set values serve
as the basis for thedividing
Like hashing procedure.
a long sentence into smaller boxes of the same size.
Essentially, a MAC is an encrypted checksum generated on the underlying message that is sent
along with a message to ensure message authentication.
The process of using MAC for authentication is depicted in the following illustration −
Message Authentication Code:-
1. use symmetric key cryptography technique provide message authentication
2. sender and receiver receive symmetric key K
3. receiver check message authentication and decrypt message
It can provide message authentication among pre-decided legitimate users who have
shared key.
1. One-time MAC
A one-time MAC is a lot like one-time encryption in that a MAC algorithm for a single use is
defined to secure the transmission of data. One-time MACs tend to be faster than other
authentication algorithms.
Types of MAC:-
|
|-- One-time MAC: used for Y.K
Prof.Nanaware one time in message or session Page 9
|-- Carter Wegman MAC similar to One time MAC
|--
|
2. Carter-Wegman MAC
3. HMAC
With a Keyed-Hash Message Authentication Code (HMAC) system, a one-way hash is used to
create a unique MAC value for every message sent. The input parameters can have various
values assigned, and making them very different from each other may produce a higher level of
security.
The approved general-purpose MAC algorithms are HMAC, KECCAK Message Authentication
Code (KMAC), and Cipher-based Method Authentication Code (CMAC). Message
authentication in cryptography depends on hashes, which are used to verify the legitimacy of the
transmission, ensuring the message has not been altered or otherwise corrupted since it was first
transmitted by the sender.
The HMAC is based on an approved hash function. It performs a function similar to that of the
Rivest-Shamir-Adelman (RSA) cryptosystem, which is one of the oldest methods of sending data
securely. The functions that can be used in HMAC are outlined in the following publications:
KMACs consist of keyed cryptographic algorithms, and their parameters are specified in FIPS
202, SHA-3 Standard: Permutation-Based Hash and Extendable-Output Functions. Two variants
of KECCAK exist: KMAC256 and KMAC128.
As outlined in SP 800-38B, Recommendation for Block Cipher Modes of Operation: The CMAC
Mode for Authentication, CMAC is built using an approved block cipher, which is an algorithm
that uses a symmetric encryption key, similar to the NIST‟s Advanced Encryption Standard
(AES), which also uses a symmetric key and was used to guard classified information by the
U.S. government.
How it works?
The main concept behind the algorithm is to transform a message or the information into a series
of many bits which are then multiplied with another sequence generated from super-increasing
integers. This produces an encrypted code, which can only be deciphered by someone who
knows how to reverse-engineer these calculations using their knowledge of prime factors or
other cryptographic techniques, only possible with possession or knowledge of the private key.
One advantage of Knapsack Encryption is its ability to perform quick computations compared to
other encryption methods like RSA without compromising data security. However, one
disadvantage is its vulnerability when used alone since it has fallen out favor as encryption
standards have evolved over time.
Advantages
1. Optimization: The Knapsack Algorithm helps find the optimal solution for resource-
constrained problems.
2. Efficient: It provides an efficient way to solve problems with a large number of items and
constraints.
3. Scalability: The algorithm can be applied to various problem sizes and complexities.
4. Wide Applicability: The Knapsack Algorithm has applications in various fields, such as:
- Resource allocation
- Logistics
Disadvantages
1. Computational Complexity: The Knapsack Algorithm has a high computational complexity,
especially for large problem instances.
2. Approximation: Heuristics and approximation algorithms are often used to solve Knapsack
Problems, which may not always yield the optimal solution.
3. Sensitivity to Parameters: The algorithm's performance can be sensitive to the choice of
parameters, such as the capacity of the knapsack.
Elliptic curves have some special properties that make them interesting and useful to both
mathematicians and cryptographers. First, elliptic curves are horizontally symmetrical. When
reflected across the x-axis (the horizontal line), both sides are the same, like a mirror image.
Additionally, any non-vertical straight line drawn through an elliptic curve will always intersect
the curve in, at most, three places. In the example below, those points are labeled as P, Q and R.
This property means that ECC can provide comparable or even better security than other public
key encryption algorithms like RSA, with far lower key sizes.
ECC requires fewer computational resources and less bandwidth for key generation,
encryption and decryption.
Due to ECC‟s smaller key size, ECC operations, such as key generation, encryption and
decryption, can be performed faster compared to RSA, which means less latency for the end
user.
Cyber security protocols are procedures and guidelines put in place to protect computer
systems and networks from unauthorised access, attacks, and damage. They are important
because they help prevent cyber attacks, maintain data confidentiality and integrity, and ensure
the availability of systems and networks
let us look at the various types of Internet Security Protocols :
1. SSL Protocol :
SSL Protocol stands for Secure Sockets Layer protocol, which is an encryption-based
Internet security protocol that protects confidentiality and integrity of data.
SSL is used to ensure the privacy and authenticity of data over the internet.
SSL is located between the application and transport layers.
At first, SSL contained security flaws and was quickly replaced by the first version of
TLS that‟s why SSL is the predecessor of the modern TLS encryption.
TLS/SSL website has “HTTPS” in its URL rather than “HTTP”.
SSL is divided into three sub-protocols: the Handshake Protocol, the Record Protocol,
and the Alert Protocol.
2. TLS Protocol :
Dual Signature :-
An important innovation introduced in SET is the dual signature. The purpose of the
dual signature is to link two messages that are intended for two different recipients. In this
case, the customer wants to send the order information (OI) to the merchant and the payment
information (PI) to the bank.
The merchant does not need to know the customer's credit-card number, and the bank
does not need to know the details of the customer's order. The customer is afforded extra
protection in terms of privacy by keeping these two items separate.
However, the two items must be linked in a way that can be used to resolve disputes
if necessary. The link is needed so that the customer can prove that this payment is intended
for this order and not for some other goods or service.
4. PGP Protocol :
PGP Protocol stands for Pretty Good Privacy, and it is simple to use
and free, including its source code documentation.
It also meets the fundamental criteria of cryptography.
When compared to the PEM protocol, the PGP protocol has grown in
popularity and use.
The PGP protocol includes cryptographic features such as encryption,
non-repudiation, and message integrity.
Change-Cipher Protocol
This protocol uses the SSL record protocol. Unless Handshake Protocol is completed, the SSL
record Output will be in a pending state. After the handshake protocol, the Pending state is
converted into the current state.
Change-cipher protocol consists of a single message which is 1 byte in length and can have
only one value. This protocol‟s purpose is to cause the pending state to be copied into the
current state.
Alert Protocol
This protocol is used to convey SSL-related alerts to the peer entity. Each message in this
protocol contains 2 bytes.
E-Mail Security:-
E-mail communication is insecure. E-mails can be read and modified as they are passed
through the Internet as clear-text.
E-Mail is usually sent over the Internet as plain text. It can be read and altered by anyone
whose server it passes through.
Therefore, two basic needs have emerged:
4. Sending an e-mail is a one-time activity. In e-mail, there is no session. „A‟ and „B‟
cannot create a session. „A‟ sends a message to „B‟; sometime later, „B‟ reads the
message and may or may not send a reply.
Services:-
PGP can provide several services based on the requirements of the user. An e-mail
Services:- can use one or more of these services.
|
|--Plaintext:- simplest1.case in whichThe
Plaintext: sender send the
simplest casemessage in the
is to send plaintext
e-mail(no services)
message in plaintext (no service). The
|--Message Authentication:- let sender sign a message. sender create digest of the message send it to the receiver message
sender composes a message and sends it to the receiver. The message is stored in
stored in the message box & retrived by user
receiver
|--Compression:- further improvement mailbox
is tountil it is retrieved
let sender compress bymessage
him. and digest to make package more compact . this
process has no improvement in security but it ease the traffic, compression save transmission time, space .
|--Confidentiality with one time session key:- can be achieves using one time session key sender create session key use it to
encrypt message and send Y.K
Prof.Nanaware key with encrypted message to protect session key sender encrypt the sender's Page public
23key.
|-- Code Conversion:- another service provide by PGP is Code conversion , most email allow message in ASCII characters
to translate in another character not in ASCII set PGP use Radix 64 conversion. each character to be sent converted
into Radix 64
|-- Segmentation :- PGP allow segmentation of the message it has been converted into Radix 64 to make each transmitted unit
the uniform size allowed by the underlying email protocol.
2. Message Authentication: Probably the next improvement is to let sender sign the
message. Sender creates a digest of the message and signs it with her private key. When
receiver receives the message, he verifies the message by using sender‟s public key.
Two keys are needed for this scenario. Sender needs to know her private key; receiver
needs to know Senders public key.
3. Compression: A further improvement is to compress the message and digest to make
the packet more compact. This improvement has no security benefit, but it eases the
traffic. Compression saves modem transmission time and disk space and more
importantly, strengthens.
4. Confidentiality with One- Time Session Key: Confidentiality in an e-mail system can
be achieved by using conventional encryption with a one-time session key. Sender can
create a session key, use the session key to encrypt the message and the digest, and
send the key itself with the message. However, to protect the session key, Sender
encrypts it with receiver‟s public key.
5. Code Conversion: Another service provided by PGP is code conversion. Most e-mail
systems allow the message to consist of only ASCII characters. To translate other
characters not in the ASCII set, PGP uses Radix 64 conversion. Each character to be
Multipurpose
sent (after encryption) Internet mail
is converted extension
to Radix 64 code.
1. Internet standard help extend limited capabilities of email allow insertion of image, video,
6. Segmentation:text
PGP message
allows segmentation of the message after it has been converted to
2. proposed by Bell Communication 1991 specification defines in 1992 for RFCs 1341 &
Radix 64 to make
1342
each transmitted unit the uniform size allowed by the underlying e-
mail protocol.
3. designed to extend format of email to support ASCII characters other than text format
4. MIME describe message content type of encoding used with the help of header
5. manually composed email shared using SMTP in MIME format association called
MIME:- SMTP/MIME
1. Stands for Multipurpose Internet Mail Extensions.
2. Multipurpose Internet Mail Extensions (MIME) is an Internet standard that helps extend
the limited capabilities of email by allowing insertion of images, sounds, video and
text in a message.
3. It was proposed by Bell Communications in 1991, and the specification was originally
defined in June 1992 for RFCs 1341 and 1342.
4. MIME was designed to extend the format of email to support non-ASCII characters,
attachments other than text format, and message bodies which contain multiple parts.
5. MIME describes the message content type and the type of encoding used with the help
of headers.
6. All manually composed and automated emails are transmitted through SMTP in MIME
format. The association of Internet email with SMTP and MIME standards is such that
the emails are sometimes referred to as SMTP/MIME email.
7. The features offered by MIME to email services are as follows:
a. Support for multiple attachments in a single message
b. Support for non-ASCII
Features of MIME characters
1. Support multiple attachments in single page
Prof.Nanaware Y.K 2.Support non ASCII characters Page 24
3.Support for layout, font and colors which are categorized as rich text
4. support multiple file format may contain executable audio and video & files
5. support unlimited message length
MIME describes |--MIME version= Describe MIME format used or not value of header is 1.0 show version of header
| |--Content Type= data's intenet media type and the subtype
|-- Special header directive |--Encoding = it use 8 bit , 7 bit , base64 and binary
|-- Encoding used |--Content Description= more info about content of message
|-- Type of message content|--Content ID- unique ID of msg
c. Support for layouts, fonts and colors which are categorized as rich text.
d. Support for attachments which may contain executables, audio, images and video
files, etc.
e. Support for unlimited message length.
8. The format of a message body is described by MIME using special header directives.
Using headers, MIME describes the type message content and the encoding used.
a. MIME Version: The presence of MIME Version generally indicates whether the
message is MIME formatted. The value of the header is 1.0 and it is shown as
MIME-Version: 1.0. The idea behind this was to create more advanced versions of
MIME like 2.0 and so on.
b. Content-Type: This describes the data’s Internet media type and the subtype. It
may consist of a „charset‟ parameter separated by a semicolon specifying the
character set to be used.
For example: Content-Type: Text/Plain.
E.g.: A GIF image, has following MIME type-
Content-Type: image/gif
c. Content-Transfer-Encoding: It specifies the encoding used in the message body.
E.g.: 7 bit, 8 bit, base64, and binary.
d. Content-Description: Provides additional information about the content of the
message.
e. Content-Disposition: Defines the name of the file and the attachment settings and
uses the attribute 'filename'.
f. Content ID: Represents a unique identification for each message segment.
Signed Mail:
Prof.Nanaware Y.K Page 25
1. In general, a message could be signed by person A by just encrypting the message
using his private key (= signing).
2. Recipient B can try to decrypt the message using A‟s public key (= verifying).
3. If he succeeds, he can be sure that the message is authentic and has not been altered
with, because a message, that can be decrypted using A‟s public key must have been
encrypted using A‟s private key (to which only A has access).
4. However, for the sake of performance and ease-of-use, S/MIME does signing a bit
differently:
a. Only a message digest is encrypted, which is faster than encrypting the entire
message.
b. Therefore, a copy of the original, unsigned message must be included with the
mail.
The following steps are taken in order to create a signed message:
i. The user writes the message as clear-text.
ii. The message digest is being calculated (using SHA-1[2] or MD5 [3]).
iii. The message digest is being encrypted using the signer‟s private key (DSS [4] or
RSA [5]).
2. This is ensured by encrypting the message using B‟s public key, which is available
to everyone.
3. However, only B can decrypt the message, because only he owns his private key.
a. The message is not encrypted using B‟s public key but instead using a
randomly created symmetric session key. Symmetric encryption/decryption is
faster than asymmetric algorithms.
b. The temporary session key is being encrypted using B‟s public key. Therefore,
only B can retrieve the session key and thus decrypt the original message.
The following steps are taken in order to create an encrypted message:
i. The user writes the message as clear-text.
ii. A random session key is being created (triple DES [6] or RC2 [7])
iii. The message is being encrypted using the random session key.
iv. For every recipient, the session key is being encrypted using the recipient‟s public
key (DH[8] or RSA[5]).