Symmetric Encryption (eK = dK )

Definition: Symmetric Encryption - A type of encryption where the same algorithm and key is used to encrypt and decrypt the message.


Two Symmetric Encryption Technologies


Symmetric Nibble Permutations:

ASCII

Definition: A nibble is a 4 bit string. Thus, a byte is composed of two nibbles.

The Method:

  1. Consider a string of bytes as a string of nibbles.
  2. Permute the nibbles with a permutation p such that p∘p=id.

The goal is to mitigate frequency attacks.

A Simple Example (using just 6 bytes):

p=    [ 3,10, 8, 0,11, 6, 5, 9, 2, 7, 1, 4]

p∘p=[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11]

Encode "Codeit":

CodeIt    to nibbles → 436F64656974   p → F76446496536    to "ASCII" → ÷dFIe6

4 is in the 0th position so it goes to the 3rd position, and F is in the 3rd position so it goes to the 0th position


XOR (exclusive or) Bit Masking

The Table:

 ⊻   0   1 
 0   0   1 
 1   1   0 

The Equation:

X⊻(Y⊻Y) = (X⊻Y)⊻Y = X

For our purposes (X⊻Y)⊻Y = X is the relevent part of the equation.

The Method:

  1. Choose a random string m of bits of length divisible by 8, called the key.
  2. For a given string s of bytes of the same bit length as m XOR each bit of s with the corresponding bit of m.

An Example:

The Mask m:
1011001011001110

The String:
Co = 436F= 0100001101101111

Mask:

The Result:
ñ¡ = 1111000110100001

Mask Again:

The Result:
Co = 0100001101101111