You are on page 1of 5

Cryptography is the field dedicated to securing communication in the presence of

adversaries. It employs mathematical algorithms to encode information, making it


challenging for unauthorized parties to understand. The main objectives of cryptography are
to ensure the confidentiality, integrity, and authenticity of data.
Cryptology = cryptography + cryptoanalysis

There are two primary types of cryptographic techniques:


Symmetric-key cryptography: This method uses the same key for both encryption and
decryption. The key challenge in symmetric-key cryptography lies in securely sharing the key
between communicating parties. Once the key is shared, it facilitates secure communication
between them.
Asymmetric-key cryptography (Public-key cryptography): This approach utilizes a pair of
keys – a public key for encryption, widely distributed, and a private key for decryption, kept
confidential. The security of asymmetric-key cryptography relies on the mathematical
relationship between these two keys.

Services provided are :-

Secure Communication: Encrypting data to protect it during transmission over networks.

Data Integrity: Verifying that data has not been altered or tampered with during storage or
transmission.

Authentication: Confirming the identity of parties involved in a communication.

Digital Signatures: Providing a way to verify the authenticity and integrity of a digital
message or document.
The Caesar Cipher, also known as the shift cipher, is one of the simplest and oldest
encryption techniques. It is a type of substitution cipher where each letter in the plaintext is
shifted a certain number of places down or up the alphabet. This method is named after
Julius Caesar, who is reputed to have used it to communicate with his generals.
The Caesar Cipher operates based on a simple mathematical expression that involves
shifting each letter in the plaintext by a fixed number of positions in the alphabet. Let's
denote:

 P as the position of the letter in the plaintext (e.g., A is 1, B is 2, and so on),

 C as the position of the corresponding letter in the ciphertext,

 k as the shift value.


The mathematical expression for encryption in the Caesar Cipher is:

C ≡ (P + k) mod 26

In this expression, mod26 is used to ensure that the result wraps around the alphabet. For
example, if the shift is 3 and the letter is Y (25 in the alphabet), the calculation would be:

C ≡ (25 + 3) mod 26 ≡ 2

So, Y in plaintext would be encrypted to B in the ciphertext.

To decrypt a letter in the Caesar Cipher, the reverse operation is performed:


P ≡ (C − k) mod 26

This expresses that you shift back by the same amount. For example, if the ciphertext is B
and the shift is 3:
P ≡ (2 − 3) mod 26 ≡ 25
So, B in ciphertext would be decrypted to Y in plaintext.

/////////\
A transposition cipher is a type of encryption where the positions of the characters in the
plaintext are rearranged according to a certain system or key. Unlike substitution ciphers,
which replace characters with other characters, transposition ciphers shuffle the order of
characters without changing their identity.

One common type of transposition cipher is the columnar transposition cipher. Here's a brief
explanation along with a mathematical expression:

Columnar Transposition Cipher:


1. Encryption:
 Choose a key, which is the order in which the columns are read.
 Write the plaintext in rows, filling the rows left to right.
 Read the columns based on the key to get the ciphertext.

2. Mathematical Expression:
 Let P be the plaintext, C be the ciphertext, K be the key, and n be the
number of columns. If P is written in rows of n columns, the encryption
can be expressed as:

Cij = Pkj

Here, i represents the row number, j represents the column number, and k is the key. The
ciphertext is obtained by reading the columns in the order specified by the key.
Decryption:

 Write the ciphertext in columns based on the key.


 Read the columns left to right to get the original plaintext.
Mathematical Expression:
Decryption involves rearranging the columns based on the key:

Pki = Cij

Here, i represents the row number, j represents the column number, and k is the key. The
original plaintext is obtained by reading the columns in the order specified by the key.
Columnar transposition ciphers provide a way to obfuscate the order of characters in a
message. However, they are vulnerable to attacks, and their security is relatively low
compared to modern encryption methods.

Affine Cipher
The Affine Cipher is a type of monoalphabetic substitution cipher, where each letter in the
plaintext is mapped to its numeric equivalent, encrypted using a simple mathematical
function, and then converted back to a letter in the ciphertext.
The affine cipher requires two keys: a and b.
a must be chosen such that it is co prime with the size of the alphabet
b is an integer that represents the shift.
Encryption function e(x,k)=(a*x+b) mod 26
Decryption function d(c,k)=((c.b) a−1) mod 26

The Playfair Cipher


The Playfair Cipher is a digraph substitution cipher that encrypts pairs of letters (digraphs),
rather than single letters as in the case of monoalphabetic ciphers. It uses a key table to
determine the substitution of digraphs. The key table is typically a 5x5 matrix (a 5x5 grid) of
letters constructed from a keyword.
The Playfair Cipher does not involve a straightforward mathematical expression like some
other ciphers. Instead, it relies on the rules mentioned above for digraph substitution based
on the key table. However, the key table itself is constructed using the keyword and the rules
mentioned earlier.

To demonstrate the encryption process:


Key Table: Suppose the key is "KEYWORD."
K E Y W O
R D A B C
F G H I L
MN P Q S
T U V X Z

Encryption: Given the key table, the digraphs are substituted based on the rules.
Example: Encrypting "HELLO"
H -> (H, E) -> EY
E -> (E, L) -> OL
L -> (L, L) -> LT
L -> (L, O) -> OL
O -> (O, H) -> HO
The encrypted message is "EYOLLOLTHO."

You might also like