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 Some Code
The Method:
- Consider a string of bytes as a string of
nibbles (4 bits).
- 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 ⊻
Some Code
The Table:
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:
- Choose a random string m
of bits of length divisible by 8, called the
key.
- 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:
0100001101101111 = Co