Beruflich Dokumente
Kultur Dokumente
Code vs ciphers
Encryption is crucial and necessary. However, it is not sufficient to protect and safeguard data.
Ciphers are required as they are hard to read even with lots of computing power.
Hex
Base 64
It is the shortest way to write binary and is a common for key and cryptography. It takes a 6 bit and
encodes in ASCII.
Note: Encryption produces a sequence of bits but cannot be used to send message across email. The
encrypted text is sent using Base 64 and then converted back.
Caesar Cipher
Therefore, the original information is recovered without any losses as compared to when
compressing an image which can result in parts being lost.
Using a key
Kerckhoffs’ Principle: A cipher should be secure even if the attacker knows everything about it apart
from the key.
Frequency analysis
It can be used to break a cipher.
Using the Caesar cipher rotating ‘n’ rotations is easy to break. A better scheme would be replacing
each letter with another letter give 26! Possible keys (around 4 x 1026).
A good cipher requires a small change in plain text to create a large change in cipher text.
One Time Pads
Example
Key: SGFKPQYEIJ
- how many positions you need to move (E moves 5 position further as in alphabet)
- different offset for each letter.
Note: Cannot go back without the key and changing the key gives a different information.
Disadvantage:
Using XOR
(M ⨁k) = M
M1 ⨁ k = M1
M2 ⨁ k = M2
M1 ⨁ k⨁ M2 ⨁ k= M1⨁ M2
Frequency analysis can reveal original message since key is no longer valid.
Block ciphers
Substitution is not enough when encrypting. Block ciphers are made up of a series of permutations
and combinations on each block.
This is approximately 1036 possibilities and makes decryption impossible even with modern
computing power.
Modulo arithmetic
-Arithmetic modulo “n” means that you count up to “n-1” then loop back to 0
For example, a clock is modulo 12 and numbered 0 to 11 and back to 0.
Sub-bytes
- fixed substitution based on matrix multiplication
-arranges bytes in 4x4 matrix and replaces the bytes by looking in a table.
Shift rows
- creates a global change
- therefore, frequency analysis is not possible
MixColumn
- this uses mathematic equations to mix the columns. (ensure the key can decrypt the equations)
AddRoundkey
- Key is used in this process only.
AES
- bit shifting operations followed by use of round key.
Crypto operation
- Should not be implemented by oneself as small mistakes can be omitted. Use from library.
-Timing attacks are the worst.
-it is important for embedded devices.
-Excellent random number generator is important for cryptography
-Key in terms of bytes is not readable. Print as integers.
-Key in terms of hex is the longest