Cryptography (Classic & Modern) Chapter 6: Digital Signature & Digital Signature Algorithm PDF
Document Details
Uploaded by LuxuriantMaracas
King Khalid University
2024
KKU
Dr. Ahmed AlMokhtar Ben Hmida
Tags
Summary
This document presents a chapter focused on cryptography, specifically digital signatures from a course at King Khalid University in 2024. It details various concepts related to digital signature algorithms, principles, steps, and importance in the field of cryptography.
Full Transcript
Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Course Cryptography (Classic & Modern) CHAPTER 6 : DIGITAL SIGNATURE & DIGITAL SIGNATURE ALGORITHM...
Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Course Cryptography (Classic & Modern) CHAPTER 6 : DIGITAL SIGNATURE & DIGITAL SIGNATURE ALGORITHM Dr. Ahmed AlMokhtar Ben Hmida College of Computer Science, King Khaled University 'KKU', KSA okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA CHAPTER 6 : DIGITAL SIGNATURE & DIGITAL SIGNATURE ALGORITHM Principle of DS & DSA Steps Importance Tutorial for DSA okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Digital signature Principle… https://www.youtube.com/watch? v=C7vmouDOJYM&list=PLEiEAq2VkUULgKbiq9J4z517 w8RV3-yJe&ab_channel=Simplilearn okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Digital Signature ‘DS’ Principle… 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. okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA First : What Is Asymmetric Encryption? You utilize two distinct keys in asymmetric encryption methods, one for encryption and the other for decryption. You use the public key for encryption; meanwhile, you use the private key for decryption. However, you must generate both keys from the receiver’s end. For example, if Alice needs to send a message to Bob, both the private and public keys must belong to Bob. okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA First : What Is Asymmetric Encryption? The process for the above image is as follows: Step 1: Alice first uses Bob’s public key to encrypt the message Step 2: The encrypted message reaches Bob Step 3: Bob decrypts the message with his secret key This eliminates the requirement for the sender and recipient to exchange any secret keys, minimizing the window of opportunity for exploitation. Now that you learned how asymmetric encryption happens, you will look at how the digital signature architecture is set up. okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Model of Digital Signature based on public key cryptography. The model of digital signature scheme is depicted in the following okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA 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. okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA 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. okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Digital signature Problem of asymmetric algorithms: Alice will encrypt the message with Bob's key which is available to everyone; a third party could easily pretend to be Alice and send Bob a message encrypted with Bob's public key. Security service attacked : authentication since we are not sure that the message comes from the person who claims to be. Solution: The digital signature is the same as a manual signature. The digital signature confirms the identity of the signer. This is not the digital image of hand written signatures Principle: Alice encrypts a message with her private key. The information can only be decrypted with Alice's public key, this is proof that the information really comes from Alice. okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Digital signature A digital signature is a cryptographic output used to verify the authenticity of data. A digital signature algorithm allows for two distinct operations: a signing operation, which uses a signing key to produce a signature over raw data Example : Digital signatures create a virtual fingerprint that is unique to a person or entity and are used to identify users and protect information in digital messages or documents. In emails, the email content itself becomes part of the digital signature okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA What is Cryptography And How Does It Protect Data ? M - Plaintext H - Hash function h - Hash digest ‘+’ - Bundle both plaintext and digest E - Encryption D - Decryption okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA What are the benefits of digital signatures? Security capabilities are embedded in DS to ensure a legal document isn't altered and signatures are legitimate. Security features include asymmetric cryptography, personal identification numbers (PINs), checksums and cyclic redundancy checks (CRCs), as well as CA and trust service provider (TSP) validation. Timestamping. This provides the date and time of a digital signature and is useful when timing is critical, such as for stock trades, lottery ticket issuance and legal proceedings. Globally accepted and legally compliant. The public key infrastructure (PKI) standard ensures vendor-generated keys are made and stored securely. With digital signatures becoming an international standard, more countries are accepting them as legally binding. Time savings. Digital signatures simplify the time-consuming processes of physical document signing, storage and exchange, enabling businesses to quickly access and sign documents. Cost savings. Organizations can go paperless and save money previously spent on the physical resources, time, personnel and office space used to manage and transport documents. Positive environmental effects. Reducing paper use also cuts down on the physical waste generated by paper and the negative environmental impact of transporting paper documents. Traceability. okhtar BEN HMIDA,Digital Dr. & Full Professor, Head signatures of ATMS create Lab, Expert an audit in Signal trail that makesProcessing internal, record-keeping CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Digital signature: Principle Encrypte d Text PlainTex PlainTex t t Private Key Public Key Alice Alice Bob A digital signature is a form of encryption that provides authentification. If the information is encrypted with a person's private key, only that person can have the information encrypted. okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA CHAPTER 6 : DIGITAL SIGNATURE & DIGITAL SIGNATURE ALGORITHM Principle of DSA Steps Importance Tutorial for DSA ( with revision) okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA How do digital signatures work? Digital signatures are based on public key cryptography, also known as asymmetric cryptography. Using a public key algorithm -- such as Rivest-Shamir- Adleman, or RSA -- two keys are generated, creating a mathematically linked pair of keys: one private and one public. Digital signatures work through public key cryptography's two mutually authenticating cryptographic keys. For encryption and decryption, the person who creates the digital signature uses a private key to encrypt signature- related data. The only way to decrypt that data is with the signer's public key. If the recipient can't open the document with the signer's public key, that indicates there's a problem with the document or the signature. This is how digital signatures are authenticated. Digital certificates, also called public key certificates, are used to verify that the public key belongs to the issuer. Digital certificates contain the public key, information about its owner, expiration dates and the digital signature of the certificate's issuer. Digital certificates are issued by trusted third-party certificate authorities (CAs), such as DocuSign for example. The party sending the document and the person signing it must agree to use a given CA. okhtar BEN HMIDA, Digital Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , signature technology requires all parties trust that the person who CS College at King Kh creates Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Authentication Digital Signatures A digital signature is a data item which accompanies or is logically associated with a digitally encoded message. It has two goals A guarantee of the source of the data Proof that the data has not been tampered with tiersSender’s Sender’s Private Key Public Key Message Digest Digest Message Sent to Algorithm Algorithm Digest Receiver Same? Digital Message Signature Signature Signature Message Digest Algorithm Sent to Algorithm Digest Receiver Sender Receiver okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Authentication Digital Certificates A digital certificate is a signed statement by a trusted party that another party’s public key belongs to them. This allows one certificate authority to be authorized by a different authority (root CA) Top level certificate must be self signed Any one can start a certificate authority Name recognition is key to some one recognizing a certificate authority Verisign is industry standard certificate authority Identity Information Signature Certificate Sender’s Algorithm Public Key Certificate Authority’s Private Key okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Digital signature: steps 1. Alice and Bob must each create a public key\private key pair. 2. Exchange only public keys 3. Alice writes a message to Bob that she encrypts him with her private key. It then sends the data 4. Upon receipt, Bob uses Alice's public key to encrypt the message. 5. Bob writes a response to Alice which he encrypts with his private key. It then sends the data. 6. Upon receipt, Alice uses Bob's public key to encrypt the message. An authenticated exchange is then guaranteed. okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Digital signature attacks Possible attacks on digital signatures include the following: Chosen-message attack. The attacker either obtains the victim's public key or tricks the victim into digitally signing a document they don't intend to sign. Known-message attack. The attacker obtains messages the victim sent and a key that enables the attacker to forge the victim's signature on documents. Key-only attack. The attacker only has access to the victim's public key and can re-create the victim's signature to digitally sign documents or messages that the victim doesn't intend to sign. okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA CHAPTER 6 : DIGITAL SIGNATURE & DIGITAL SIGNATURE ALGORITHM Principle of DSA Steps Importance Tutorial for DSA (with revision,,,) okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Importance of Digital Signature ‘DS’ Out of all cryptographic primitives, the DS 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 DS also provides message authentication and data integrity. Let us briefly see how this is achieved by the DS − 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 DS to a third party as evidence if any dispute arises in the future. okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA 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. Message authentication − Data Integrity − Non-repudiation − 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. Explore our latest online courses and learn new skills at your own pace. Enroll and become a certified expert to boost your career. okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Importance of Digital Signature The importance of digital signatures is not negligible in this digital world, and there are some, Ensures Authenticity: Digital signatures ensure the authenticity of a message or transaction by proving that the message or signature was created using the private key associated with the digital signature. Offers Non-repudiation: A digital signature provides an entire record that a specific individual signed the document or transaction at a particular time. This feature prevents the individual from denying that they signed it. Provides Security: Digital signatures use encryption algorithms to protect the data from unauthorized access and tampering. The cryptographic techniques used by digital signatures also protect the data from being changed or manipulated during transmission. Improves Efficiency: Digital signatures can reduce the time and money spent on paperwork, printing, scanning, and mailing documents. Enhances Compliance: Digital signatures help organizations to meet regulatory and legal compliance requirements by providing an audit trail of signed documents. okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA 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 − okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA CHAPTER 6 : DIGITAL SIGNATURE ALGORITHM Principle of DSA Steps Importance Tutorial for DSA (with revision) okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Signatures Algorithm Tu vis is a federal information processing standard for Re to io ria n digital signatures. l& The National Institute of Standards and Technology proposed it in 1991, and it was universally standardised in 1994. It works on the basis of modular exponentiation and discrete logarithmic problems both of which are difficult to solve via brute force. The following three advantages are offered by the DSA Algorithm − Message Authentication − By providing the correct key combination, you can confirm the sender's identity. Integrity Verification − Since modifying the message will prevent the bundle from being fully encrypted, it is impossible to tamper with it. Non-repudiation − If the signer is verified, the sender cannot argue they never sent the message. okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA The DSA algorithm's full process can be seen in the diagram above. Here, you will be using two distinct functions: a verification function and a signing function. The encryption and decryption steps are shown in the above image apart from the conventional digital signature verification method. They have different parameters, which you will learn about in the next section below. Tu vis Re to io ria n l& okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA How does DSA Work? Tu vis Re to io ria n Digital Signature Algorithm is what DSA stands for. This cryptographic algorithm is used to l& protect messages from alteration, create digital signatures, and verify the sender of a digital communication. Two keys are required for DSA to function: the sender's private key and the recipient's public key. The message is signed by the sender using his private key, and it is sent with the message. The recipient of the communication then uses the sender's public key to confirm that the signature is authentic and that no tampering has occurred with the message. Using special techniques, the verification procedure enables the recipient to verify the signature without needing access to the sender's private key. Algorithm : Check out how the entire process works check in the image above, from producing the key pair to confirming the signature at the end − Key Generation : The process of creating keys consists of two steps: per-user keys and parameter generation − okhtar BEN HMIDA, Dr. & Full Professor, Head of ATMS Lab, Expert in Signal Processing , CS College at King Kh Cryptography (Classic & Modern) College of Computer Science ; King Khalid University ; KKU - KSA Tuto r Rev ial & Parameter Generation isio n A user must first select a cryptographic hash function (H) and an output length in bits, denoted by |H|. When the output length is longer than |H|, modulus length N is used. Then, find a key length L that is a multiple of 64 and ranges between 512 and 1024, as per the original DSS length. However, NIST suggests lengths of 2048 or 3072 for lifetime key security. According to FIPS 186-4, the values of L and N must be selected from the following range: (1024, 60), (2048, 224), (2048, 256), or (3072, 256). In addition, while selecting a modulus length N, the user should make sure that it is smaller than the key length (N