0% found this document useful (0 votes)
5 views19 pages

Encryption and Decryption

The document provides an overview of cryptography, defining key terms such as plaintext, ciphertext, and the types of cryptographic methods including symmetric and asymmetric key cryptography. It explains traditional ciphers, substitution and transposition techniques, and details specific examples like the Caesar and Vigenère ciphers. Additionally, it discusses the importance of cryptographic protocols in ensuring secure communication between parties.

Uploaded by

himanshu8verma08
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views19 pages

Encryption and Decryption

The document provides an overview of cryptography, defining key terms such as plaintext, ciphertext, and the types of cryptographic methods including symmetric and asymmetric key cryptography. It explains traditional ciphers, substitution and transposition techniques, and details specific examples like the Caesar and Vigenère ciphers. Additionally, it discusses the importance of cryptographic protocols in ensuring secure communication between parties.

Uploaded by

himanshu8verma08
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Cryptography and Cryptographic

Protocols:
Some Basic Terminology
• plaintext - original message meet me (Original Data)

• ciphertext - coded message PHHW PH

• cipher - algorithm for transforming plaintext to ciphertext

• key - info used in cipher known only to sender/receiver

• encipher (encrypt) - converting plaintext to ciphertext

• decipher (decrypt) - recovering ciphertext from plaintext

• cryptography - study of encryption principles/methods

• cryptanalysis (codebreaking) - study of principles/ methods


of deciphering ciphertext without knowing key

2
• cryptology - field of both cryptography and cryptanalysis
Cryptography and Cryptographic
Protocols:
• Cryptography is the process of hiding or
coding information so that only the person
a message was intended for can read it.
– Symmetric key Cryptography
– Asymmetric key Cryptography (popularly
known as public key cryptography).
• Cryptographic protocols provide secure
connections, enabling two parties to
communicate with privacy and data
integrity.
Cryptography and Cryptographic
Protocols:
• Symmetric Key Cryptography
– The same key is used for encryption and
decryption.
– One key → lock and unlock
– Key: 3 Caesar Cipher (shift by 3)
– Encryption:
– meet me → PHHW PH
– Decryption:
– PHHW PH → meet me
– 🔑 Same key (3) is used by both sender and
receiver.
Secret-key encryption

In secret-key encryption, the same key is used by the sender


(for encryption) and the receiver (for decryption). The key is
shared.

Secret-key encryption is often called symmetric encryption


because the same key can be used in both directions.

Secret-key encryption is often used for long messages.


Cryptography and Cryptographic
Protocols:
• Asymmetric key Cryptography
– popularly known as public key cryptography).
– Uses two different keys:
• Public Key → encryption
• Private Key → decryption
– One key to lock, another key to unlock
Letter box
– Anyone can drop letters (public key)
– Only owner can open box (private key)
Traditional ciphers
Traditional ciphers used two techniques for
hiding information from an intruder:
substitution and transposition.
The difference between substitution and
transposition is that in:

•Substitution: each letter retains its position


but changes its identity,

•Transposition: each letter retains its


identity but changes its position.
Caesar Cipher

• Earliest known substitution cipher


• Replaces each letter by 3rd letter on
• Example:
meet me after the toga party
PHHW PH DIWHU WKH WRJD SDUWB
Transposition Ciphers

• Now consider classical transposition or


permutation ciphers
• These hide the message by rearranging the
letter order, without altering the actual letters
used
• Can recognise these since have the same
frequency distribution as the original text
• For example, the message THE GAME IS AFOOT becomes
encoded as EHT EMAG SI TOOFA. Such "backward writing" is easy
to recognize and decode.
Column Transposition Cipher

– Column Transposition Cipher is a


transposition cipher where plaintext is written
in rows under a keyword, and ciphertext is
obtained by reading columns in the
alphabetical order of the key letters.
Cipher text:

EMFRAXMTAELSEETCSX
Step 4: Read row-wise
MEETMEAFTERCLASSXX
✅Remove padding: Recovered Plaintext:
MEETMEAFTERCLASS
Ciphers
• Monoalphabetic ciphers: each letter in the
plaintext is encoded by only one letter from
the cipher alphabet, and each letter in the
cipher alphabet represents only one letter in
the plaintext.
• A monoalphabetic cipher uses one fixed
substitution alphabet.
• Each plaintext letter is always replaced by the
same ciphertext letter
• m→p
• e→h
• t→w
Monoalphabetic Cipher
• Rather than just shifting the alphabet
• Could shuffle (jumble) the letters arbitrarily
• Each plaintext letter maps to a different random
ciphertext letter
• Key is 26 letters long

Plain: abcdefghijklmnopqrstuvwxyz
Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN
Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
Ciphers
• Polyalphabetic ciphers: each letter in the
plaintext can be encoded by any letter in the
cipher alphabet, and each letter in the cipher
alphabet may represent different letters from
the plaintext each time it appears.
• A polyalphabetic cipher uses multiple
substitution alphabets.
• The same plaintext letter can be encrypted as
different ciphertext letters.
• One letter → many possible replacements
Example: Vigenère Cipher
Vigenere cipher
• Pick a keyword (for our example, the keyword will be "MEC").
• Write your keyword across the top of the text you want to encipher,
repeating it as many times as necessary.
• For each letter, look at the letter of the keyword above it (if it was 'M', then
you would go to the row that starts with an 'M'), and find that row in the
Vigenere Table.
• Then find the column of your plaintext letter (for example, 'w', so the
twenty-third column).
• Finally, trace down that column until you reach the row you found before
and write down the letter in the cell where they intersect (in this case, you
find an 'I' there).
ROW

0 A B C D E F G
Vigenere table.
H I J K L M N O P Q R S T U V W X Y Z
1 B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
2 C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
3 D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
4 E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
5 F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
6 G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
7 H I J K L M N O P Q R S T U V W X Y Z A B C D E F G
8 I J K L M N O P Q R S T U V W X Y Z A B C D E F G H
9 J K L M N O P Q R S T U V W X Y Z A B C D E F G H I
10 K L M N O P Q R S T U V W X Y Z A B C D E F G H I J
11 L M N O P Q R S T U V W X Y Z A B C D E F G H I J K
12 M N O P Q R S T U V W X Y Z A B C D E F G H I J K L
13 N O P Q R S T U V W X Y Z A B C D E F G H I J K L M
14 O P Q R S T U V W X Y Z A B C D E F G H I J K L M N
15 P Q R S T U V W X Y Z A B C D E F G H I J K L M N O
16 Q R S T U V W X Y Z A B C D E F G H I J K L M N O P
17 R S T U V W X Y Z A B C D E F G H I J K L M N O P Q
18 S T U V W X Y Z A B C D E F G H I J K L M N O P Q R
19 T U V W X Y Z A B C D E F G H I J K L M N O P Q R S
20 U V W X Y Z A B C D E F G H I J K L M N O P Q R S T
21 V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
22 W X Y Z A B C D E F G H I J K L M N O P Q R S T U V
23 X Y Z A B C D E F G H I J K L M N O P Q R S T U V W
24 Y Z A B C D E F G H I J K L M N O P Q R S T U V W X
25 Z A B C D E F G H I J K L M N O P Q R S T U V W X Y
Vigenere cipher
• Decipherment of an encrypted message is equally
straightforward. One writes the keyword repeatedly above the
message:
• one uses the keyword letter to pick a column of the table and
then traces down the column to the row containing the cipher
text letter
• Key Word M E C M E C
• Cipher Text I I P Q I F
• Plain Text W E N E E D

You might also like