NISyteyteytetretretretretretretretretretretr

balajihegade1648 13 views 63 slides Mar 01, 2025
Slide 1
Slide 1 of 63
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63

About This Presentation

NIS


Slide Content

Chap 3 Cryptography

3.1 Introduction The Internet connects millions of computers. It allows fast communication and sharing of information worldwide. People use email to talk to each other. The World Wide Web (WWW) is used for online business, data sharing, marketing, research, learning, and more. The main concern is the security of shared data. Cryptography is used to make websites and online communication safe. 3.1.1 Plaintext Plaintext is also called clear text . Anyone who understands the language can read it easily. The original message is called plaintext. 3.1.2 Ciphertext When plaintext is changed into a coded form using a method, it is called ciphertext. Ciphertext is a message that is not easily readable.

3.1.3 Cryptography Cryptography is the ancient method of writing secret messages. In areas like data and telecommunications, cryptography is very important for communication over unsafe networks, such as the Internet. Cryptography not only protects data from changes but also helps to verify the user’s identity. Uses of Cryptography Data Hiding : Cryptography is used to hide written messages. Digital Coding : It can be applied to coding software, images, or voice data. Electronic Payment : When payments are sent online, cryptography helps prevent fake messages and changes in payment details. Message Authentication : It helps detect if a message was changed during transmission. Digital signatures are one of its important uses.

3.1.4 Cryptanalysis Cryptanalysis is the process of breaking a coded message to find the original message. It is a technique used to decode a message without knowing how it was coded.

3.1.5 Cryptology Cryptology is the combination of cryptography (making secret codes) and cryptanalysis (breaking secret codes). In cryptography, a cipher (or cypher) is a method used for encryption and decryption.

3.1.6 Encryption Encryption is the process of converting plaintext into ciphertext using a key. A key is a secret code used in encryption. Without the key, it is very difficult or nearly impossible to change the ciphertext back into readable text.

3.1.7 Decryption Decryption is the process of converting ciphertext back into plaintext. It is the reverse of encryption. When sending a message, the sender’s computer converts plaintext into ciphertext using encryption. Then, the encrypted message is sent over the Internet. The receiver’s computer takes the encrypted message and converts it back into plaintext using decryption.

Sender performs encryption, with the help of different encryption algorithms. Receiver performs decryption, with the help of different decryption algorithms.

3.2 Substitution and Transposition Technique

Substitution Techniques :- In substitution technique letters of plain text are replaced by the other letters or by numbers or by symbols. Substitution techniques are as follows:- a) Caesar cipher b) Modified version of Caesar cipher c) Mono-alphabetic cipher d) Vigener’s cipher

Caesar cipher : It is proposed by Julius Caesar. In cryptography Caesar cipher also known as Caesar cipher/code, shift cipher/code. It is one of the simplest and most widely known encryption techniques. It is a type of substitution technique in which each letter in the plain text is replaced by a letter some fixed number of position down the alphabet. For example, with a shift of 3, A would be replaced by D, B by E, and so on as shown in the table below.

Using this scheme, the plain text “SECRET” encrypts as Cipher text “VHFUHW”. To allow someone to read the cipher text, you tell them that the key is 3 For S:= ( p+k ) mod 26 = (18 + 3) mod 26 = 21 = V To allow someone to read the cipher text, you tell them that the key is 3

Algorithm to break Caesar cipher : Read each alphabet in the cipher text message, and search for it in the second row of the table above. 2. When a match in found, replace that alphabet in the cipher text message with the corresponding alphabet in the same column but the first row of the table. (For example, if the alphabet cipher text is J, replace it with G). 3. Repeat the process for all alphabets in the cipher text message.

Q. Consider plain text “COMPUTER ENGINEERING” and convert given plain text into cipher text using “Caesar Cipher‟ with shift of position three- write down steps in encryption. A: Caesar cipher technique is proposed by Julius Caesar. It is one of the simplest and most widely known encryption techniques. It is a type of substitution technique in which each letter in the plain text is replaced by a letter some fixed number of position down the alphabet. The Caesar cipher involves replacing each letter of the alphabet with the letter three places further down the alphabet. For example, with a shift of 3, A would be replaced by D, B would became E, and so on as shown in the table below

PLAIN TEXT -COMPUTER ENGINEERING CIPHER TEXT–FRPSXWHU HQJLQHHULQJ

2. Modified Ceasor’s Cipher: In this version an alphabet ‘A’ can be replaced by any other alphabet in the English alphabet set i.e. B to Z. So for each alphabet in string we have 25 possibilities of replacement. An attack on a Cipher text message, wherein the attacker attempts to use all possible permutations and combinations is known as a Brute-force attack.

3.2.2 Transposition Technique: Transposition technique does not replace alphabets from plaintext with other whereas; it performs some permutation on alphabets of plaintext. 1. Simple Columnar Transposition In a columnar transposition, the message is written out in rows of a fixed length, and then read out again column by column, and the columns are chosen in any order. Both the length of the rows and the permutation of the columns are usually defined by a keyword. For example The word ZEBRAS is of length 6 (so the rows are of length 6), and the permutation is defined by the alphabetical order of the letters in the keyword.

in this case, the order would be "6 3 2 4 1 5". (Z E B R A S) Plaintext WELCOME HOME with Key ZEBRAS (Length is 6 ). Consider the rectangle with 6 columns because the length of key is 6. Write the message in rectangle in row-by-row manner. Now, read it with some random order of (4, 6, 1, 2, 5, 3). The Ciphertext is "CMMWEEHOELO".

Plaintext Come Home Tomorrow with key = 6. As length of key is 6, the rectangle should be of 6 columns. Now write Plaintext message in these columns row-by-row. Now, read the text of column in random order like (4, 6, 1, 2, 5, 3). Ciphertext "EOWOOCMROERHMMTO". Algorithm 1. Write the Plaintext message row-by-row in a rectangle of a pre-defined size. 2 Read message column-by-column. However, it can be any order like 2, 3, etc. 3. The message thus obtained is the Cipher text message.

3.3: Steganography: Steganography is the art and science of writing hidden message in such a way that no one apart from sender and intended recipient suspects the existence of the message. Steganography works by replacing bits of useless or unused data in regular computer files (such as graphics, sound, text, html or even floppy disks) with bits of different, invisible information. ( Steganography is a technique used to hide secret data inside other files (like images, audio, or text) without altering the visible content .)

(How Does It Work? It replaces unused or less important bits in a file with hidden data . The hidden data can be plain text, cipher text, or even another image . The file looks normal, but only someone with the right method can extract the hidden data. Examples of Steganography: Image Steganography → Hiding text inside an image by changing pixel values slightly. Audio Steganography → Embedding secret messages in sound files. Text Steganography → Using invisible characters or font changes to hide messages)

This hidden information can be plain text, cipher text or even images. In modern steganography, data is first encrypted by the usual means and then inserted, using a special algorithm, into redundant data that is part of a particular file format such as a JPEG image. Steganography process: Cover-media + Hidden data + Stego -key = Stego -medium

Cover media is the file in which we will hide the hidden data, which may also be encrypted using stego -key. The resultant file is stego medium. Cover-media can be image or audio file. Steganography takes cryptography a step further by hiding an encrypted message so that no one suspects it exists. Ideally, anyone scanning your data will fail to know it contains encrypted data. Stenography has a number of drawbacks when compared to encryption. It requires a lot of overhead to hide a relatively few bits of information. i.e. One can hide text, data, image, sound, and video, behind image. ( Hiding data in images or audio increases file size and processing time.)

Applications : Confidential communication and secret data storing 2. Protection of data alteration 3. Access control system for digital content distribution 4. Media Database systems

3.4 Symmetric and Asymmetric Cryptography Cryptographic algorithms are a set of rules used to code and decode messages. There are two types of cryptographic algorithms: Symmetric Algorithm Asymmetric Algorithm 3.2.1 Symmetric Encryption In symmetric encryption, the same key is used for both encryption and decryption . This is why it is also called a single-key, secret-key, or shared-key algorithm . The key must be kept secret. Both the sender and receiver use the same key to read the encrypted message. Before communication, both sender and receiver must agree on a key. If different people need private communication, each pair must have a different key. Managing many secret keys can be difficult.

Types of Symmetric Encryption Block Cipher : Encrypts data in fixed-size blocks (e.g., 64-bit blocks). Security depends on the encryption design. Each block of the same document is encrypted using the same key. 2. Stream Cipher : Encrypts data in small parts, such as bits or bytes. It continuously changes the encryption key for security. Symmetric encryption is usually faster than asymmetric encryption.

Data Encryption Standard (DES): DES encrypts 64 bit clear text blocks under the control of 56 bit keys.

Initial Permutation (IP) : It happens only once. It replaces the first bit of the original plain text block with the 58th bit of the original plain text block, the second bit with the 50th bit of original plain text block and so on. The resulting 64-bits permuted text block is divided into two half blocks. Each half block consists of 32 bits. The left block called as LPT and right block called as RPT. 16 rounds are performed on these two blocks. Details of one round in DES:

Step 1 : Key Transformation: The initial key is transformed into a 56- bit key by discarding every 8th bit of initial key(64 bits). Thus, for each round , a 56 bit key is available, from this 56-bit key, a different 48-bit sub key is generated during each round using a process called as key transformation.

Step 2: Expansion permutation: During Expansion permutation the RPT is expanded from 32 bits to 48 bits. The 32-bit RPT is divided into 8 blocks, with each block consisting of 4-bits. Each 4-bits block of the previous step is then expanded to a corresponding 6-bit block, per 4-bit block, 2 more bits are added. They are the repeated 1st and 4th bits of the 4-bit block. The 2nd and 3rd bits are written as they were in the input. The 48 bit key is XOR ed with the 48-bit RPT and the resulting output is given to the next step.

Step 3: S-box substitution: It accepts the 48-bits input from the XOR operation involving the compressed key and expanded RPT and produces 32-bit output using the substitution techniques. Each of the 8 S-boxes has a 6-bit input and a 4-bit output. The output of each S-box then combined to form a 32-bit block, which is given to the last stage of a round

Step 4: P- Box permutation: the output of S-box consists of 32-bits. These 32-bits are permuted using P-box.

5: XOR and Swap: The LPT of the initial 64-bits plain text block is XORed with the output produced by P box-permutation. It produces new RPT. The old RPT becomes new LPT, in a process of swapping.

Final Permutation : At the end of 16 rounds, the final permutation is performed. This is simple transposition. For e.g., the 40th input bit takes the position of 1st output bit and so on.

3.4.2 Asymmetric Key Cryptography Asymmetric Encryption uses two keys: one for encryption and the other for decryption. If one key encrypts a message, only the other key can decrypt it. These keys are often interchangeable, meaning either key can be used for encryption or decryption. It is also called Public Key Cryptography because: One key (public) is shared with others. The other key (private) is kept secret. Users can sign messages using their private key. Anyone with the public key can verify the sender’s identity. This ensures the message is from the real sender, not a fraud person.

Users can send secret messages by encrypting them with the recipient's public key . Only the intended recipient can decrypt it using their private key . A Key Management System is needed for Asymmetric Encryption. It helps verify and manage public keys. Without it, finding and trusting public keys is difficult. Main advantage: The private key stays secure , making the system safer.

Digital Signature: 1. Digital signature is a strong method of authentication in an electronic form. 2. It includes message authentication code (MAC), hash value of a message and digital pen pad devices. It also includes cryptographically based signature protocols. 3. Digital Signature is used for authentication of the message and the sender to verify the integrity of the message. 4. Digital Signature may be in the form of text, symbol, image or audio. 5. In todays world of electronic transaction, digital signature plays a major role in authentication. For example, one can fill his income tax return online using his digital signature, which avoids the use of paper and makes the process faster.

6. Asymmetric key encryption techniques and public key infrastructure are used in digital signature. 7. Digital signature algorithms are divided into two parts- Signing part: It allows the sender to create his digital signature. b. Verification part: It is used by the receiver for verifying the signature after receiving the message. Working: Message digest is used to generate the signature. The message digest (MD) is calculated from the plaintext or message. The message digest is encrypted using users private key. Then, the sender sends this encrypted message digest with the plaintext or message to the receiver.

4. The receiver calculates the message digest from the plain text or message he received. 5. Receiver decrypts the encrypted message digest using the senders public key. If both the MDs are not same then the plaintext or message is modified after signing.

Advantages of Digital Signatures  Speed: Businesses no longer have to wait for paper documents to be sent by courier. Contracts are easily written, completed, and signed by all concerned parties in a little amount of time no matter how far the parties are geographically.  Costs: Using postal or courier services for paper documents is much more expensive compared to using digital signatures on electronic documents.  Security: The use of digital signatures and electronic documents reduces risks of documents being intercepted, read, destroyed, or altered while in transit.

 Authenticity: An electronic document signed with a digital signature can stand up in court just as well as any other signed paper document.  Non-Repudiation: Signing an electronic document digitally identifies you as the signatory and that cannot be later denied.  Time-Stamp: By time-stamping your digital signatures, you will clearly know when the document was signed

Disadvantages of Digital Signatures Uncertain Date & Time Digital signatures do not guarantee the exact date and time of signing. A signer can backdate a document, leading to misuse . Solution: Use trusted time stamping to prevent backdating.

2. Non-Repudiation Issues Repudiation means denying responsibility for a message. A recipient may request a digital signature to prevent the sender from denying the message later. However, if a private key is stolen , all signatures made with it become questionable . Lack of time stamps makes it hard to separate old and new documents after a key is compromised.

3. Certificate Management Certificate Authorities (CAs) maintain a list of public keys to verify digital signatures. Expired certificates are usually removed , which can affect long-term verification. Security policies must decide how long old certificates should be kept for verification.
Tags