css exp 1 vansh
css exp 1 vansh
1
Aim: Design and implementation of product cipher using substitution and transposition cipher.
Software Used: Python.
Theory:
Product cipher:
A product cipher is a type of encryption algorithm that combines two or more simple ciphers to create a more
complex and secure encryption method. It typically applies multiple rounds of different ciphers (such as
substitution and transposition) to the plaintext, making it much harder to break than a single cipher alone.
The concept behind a product cipher is to apply two or more types of encryption operations in succession. The
idea is that each individual cipher may be weak on its own, but when combined, the result is a much stronger
encryption scheme. Product ciphers were used in the design of historical ciphers, and they laid the foundation for
modern cryptographic techniques like the Data Encryption Standard (DES) and Advanced Encryption Standard
(AES), which also use multiple rounds of various operations.
Substitution cipher:
In a Substitution cipher, any character of plain text from the given fixed set of characters is substituted by
some other character from the same set depending on a key. For example with a shift of 1, A would be
replaced by B, B would become C, and so on.
Note: A special case of Substitution cipher is known as Caesar cipher where the key is taken as 3.
Mathematical representation
The encryption can be represented using modular arithmetic by first transforming the letters into numbers,
according to the scheme, A = 0, B = 1,…, Z = 25. Encryption of a letter by a shift n can be described
mathematically as.
Algorithm for Substitution Cipher:
Encryption:
Decryption:
Substitution Cipher Program: Vansh Bohra. 605
Output:
Transposition Cipher:
Transposition Ciphers are an essential part of cryptography that uses systematic shuffling of plain text
characters or bits to secure data by altering their positions based on some defined way or algorithm. Moreover,
unlike substitutive codes where different letters substitute others, in these, you just shift about original letters
hence it does not at all look like any message.
The Transposition Cipher Technique is an encryption method used to encrypt a message or information. This
encryption method is done by playing with the position of letters of the plain text. The positions of the
characters present in the plaintext are rearranged or shifted to form the cipher text. It makes use of some kind
of permutation function to achieve the encryption purpose. It is very easy to use and so simple to implement.
Encryption:
Decryption:
Transportation Cipher Program Vansh Bohra, 605
Output:
Conclusion: The aim of designing and implementing a product cipher combining substitution and transposition
techniques is to enhance cryptographic security by leveraging the strengths of both methods. Substitution ciphers
ensure confusion by altering plaintext symbols, while transposition ciphers provide diffusion by rearranging their
positions. Together, these techniques create a robust encryption scheme that is resistant to various cryptanalytic
attacks, achieving a balance of complexity and efficiency in secure data communication.