- Playfair Cipher:
The Playfair cipher is a substitution cipher that encrypts pairs of letters of a text using a 5x5 matrix of letters derived from a keyword.
Encryption:
i) If the two letters are in the same row, replace them with the letters to their immediate right.
ii) If they are in the same column, replace them with the letters directly below them.
iii) If they form a rectangle, replace them with the letters on the same row but at the opposite corners of the rectangle.
Functions:
Input: plaintext, keytext
Output: Key matrix, ciphertext, decrypted plaintext
construct_key_matrix(key)prepocess_plaintext(plaintext)encryptdecryptget_positions(element, keymatrix): called in encrypt and decrypt functions
- Hill Cipher: Polygraphic substitution cipher using matrix multiplication
- C = (K*P) mod 26
- P = (K_inv*C) mod 26
Functions: Input: plaintext, keymatrix Output: ciphertext, decrypted plaintext
encrypt()decrypt()text_to_numbers(text): called by enc and dec functionsnumbers_to_text(numbers): called by enc and dec functions
- DES Initial and Final Permutation Boxes: Input: plaintext(64-bit)
' '.join(input_bits[i-1] for i in INITIAL/FINAL_PERM_TABLE)
-
DES S-boxes:
Input: binary input (48 bits) -
AES Mix Columns operation:
-
AES Key Expansion
-
RSA
-
Diffie-Hellman