Practical 2: CrypTool and HashCalc

===== SOURCE: Cryptool_prac2_Eh.docx =====

Practicle 2:-
Cyptool 

1.Symmetric Algorithms

a.Caesar Cipher 

Explanation:-
The Caesar Cipher is one of the simplest and oldest methods of encrypting messages, named after Julius Caesar, who reportedly used it to protect his military communications. This technique involves shifting the letters of the alphabet by a fixed number of places. For example, with a shift of three, the letter 'A' becomes 'D', 'B' becomes 'E', and so on. Despite its simplicity, the Caesar Cipher formed the groundwork for modern cryptographic techniques. 

Encrypt:-


Decrypt:-







2.vigenere Cipher
EXPLAIN:
Vigenere Cipher is a method of encrypting alphabetic text. It uses a simple form of polyalphabetic substitution. A polyalphabetic cipher is any cipher based on substitution, using multiple substitution alphabets. The encryption of the original text is done using the Vigenère square or Vigenère table.
The table consists of the alphabets written out 26 times in different rows, each alphabet shifted cyclically to the left compared to the previous alphabet, corresponding to the 26 possible Caesar Ciphers.
At different points in the encryption process, the cipher uses a different alphabet from one of the rows.
The alphabet used at each point depends on a repeating keyword.

Encrypt:-

Decryption:-



3.Hill Cipher
Explain:-
In the context of classical cryptography, the Hill Cipher uses a polygraphic substitution cipher, which means homogeneous substitution over many levels of blocks. This polygraphic substitution cipher allows Hill Cipher to function easily with digraphs (two-letter blocks), trigraphs (three-letter blocks), or any other multiple-sized blocks to create a uniform cipher.
Hill Cipher is based on linear algebra, advanced matrices (matrix multiplication and matrix inverses), and modulo arithmetic principles. Obviously, it is a more mathematical cipher than others.
Hill Cipher is also a block cipher. A block cipher uses a deterministic algorithm and a symmetric key to encrypt a block of text. Unlike stream ciphers, it does not require encrypting one bit at a time. Hill Cipher is a block cipher, which means it can function with any block size.
While Hill Cipher is digraphic in nature, it can grow to multiply any letter size, adding complexity and reliability for improved usage. Because most of Hill Ciphers' problems and solutions are mathematical in nature, it is simple to hide letters with precision.
Since the Hill cipher is fairly difficult, let's encrypt the text "CODE" and then decipher the resulting ciphertext to learn how it works. To keep the example basic, we will use a simple substitution method in which the letter A is mapped to 0, B is mapped to 1, and so on to adhere to a 2x2 key matrix. The Hill cipher becomes more complicated as the key matrix size grows. 
Encrypt:-


Decrypt:-



4.Playfair cipher
EXPLAIN:
The Playfair cipher, also known as the Playfair square or the Wheatstone-Playfair cipher, is a manual symmetric encryption scheme that was the first that used literal digram substitution. Charles Wheatstone created the technique in 1854, but it is named after Lord Playfair to promote the use of it.
The approach encrypts pairs of letters rather than single letters, as is the case with the simple substitution cipher and the more complex Vigen ere cIpher systems that were previously used.
The Playfair cipher is thus substantially more difficult to break because the frequency analysis used for basic substitution ciphers does not apply to it. Frequency analysis of bigrams is possible, but extremely complex. 
Encryption Technique
The algorithm consists of 2 steps: 
Generate the key Square (5x5): 

The key square is a 5×5 grid of alphabets that acts as the key for encrypting the plaintext. Each of the 25 alphabets must be unique and one letter of the alphabet (usually J) is omitted from the table (as the table can hold only 25 alphabets). If the plaintext contains J, then it is replaced by I. 
The initial alphabets in the key square are the unique alphabets of the key in the order in which they appear followed by the remaining letters of the alphabet in order. 
Algorithm to encrypt the plain text: The plaintext is split into pairs of two letters (digraphs). If there is an odd number of letters, a Z is added to the last letter.  
Decryption Technique
Decrypting the Playfair cipher is as simple as doing the same process in reverse. The receiver has the same key and can create the same key table, and then decrypt any messages made using that key.
The Algorithm consists of 2 steps: 
Generate the key Square(5x5) at the receiver's end: 

The key square is a 5×5 grid of alphabets that acts as the key for encrypting the plaintext. Each of the 25 alphabets must be unique and one letter of the alphabet (usually J) is omitted from the table (as the table can hold only 25 alphabets). If the plaintext contains J, then it is replaced by I. 
The initial alphabets in the key square are the unique alphabets of the key in the order in which they appear followed by the remaining letters of the alphabet in order. 
Algorithm to decrypt the ciphertext: The ciphertext is split into pairs of two letters (digraphs).

Encryption:-




Decryption:-



5.Byte Addition
A "byte addition cipher" refers to an encryption technique that modifies data by adding a secret key to the numerical value of each plaintext byte (typically modulo 256). In modern computing, this modular addition or subtraction is widely used in algorithms like AES, where bitwise XOR acts as a specialized, carryless version of addition. [1, 2, 3, 4, 5]
How It Works (Modulo 256)
Since a standard byte consists of 8 bits, its value ranges from 0 to 255. In a simple byte-addition cipher, the process uses modular arithmetic:
Encryption Formula: \(Ciphertext\ Byte = (Plaintext\ Byte + Key\ Byte) \pmod{256}\)
Decryption Formula: \(Plaintext\ Byte = (Ciphertext\ Byte - Key\ Byte) \pmod{256}\)

encryption:-


Decryption:-

===== SOURCE: HashCalc_prac2.docx =====

HashCalc


Text:-



File:-



Hex:-