Taxonomy of Cryptography มี cipher 3 ประเภท
Three categories of ciphers
- Symmetric ciphers
- Public key cryptosystems
- Hash functions
Symmetric ciphers เร็วกว่า Public key cryptosystems
The goal of cryptanalysis is to recover the plaintext, the key, or both
ป้องกันทั้ง plaintext และ key
By KerckhoffsPrinciple, we assume that
Trudy the cryptanalyst has complete knowledge of the inner workings of the algorithm
Another basic assumption is that Trudy has access to the ciphertext
If Trudy only knows the algorithms and the ciphertext,
then she must conduct a ciphertextonlyattack.
Known plaintext-Trudy might know some of the plaintext
and observe the corresponding ciphertext.
รู้เนื้อความแค่บางส่วน แล้วนำมาใช้เจาะ
Chosen plaintext–Choosing the plaintext to be encrypted and
see the corresponding ciphertext
เข้ารหัสใหม่แล้วเอาข้อมูลมาเปรียบเทียบกัน
Adaptively chosen plaintext-Trudy chooses the plaintext,
views the resulting ciphertext, and chooses the next plaintext based
on the observed ciphertext.
เข้ารหัสใหม่แล้วเอาข้อมูลมาเปรียบเทียบกันแบบหลายข้อมูลและมีการวิเคราะห์มากขึ้น
Forward search-Suppose Trudy intercepts a ciphertext that was encrypted with
Alice’s public key.
If Trudy suspects that the plaintext message was either “yes”or “no,”then she can encrypt both
of these putative plaintexts with Alice’s public key.
If either matches the ciphertext, then the message has been broken.
Symmetric Cryptography
Stream ciphers (เลิกใช้ไปแล้ว)
- The key is “stretched”into a long stream of bits
- Confusion only
- A5/1, RC4
Block ciphers
- Based of the codebook concept
- Confusion and diffusion
- DES, Triple DES,
- AES
Stream Ciphers
- Takes a key K of n bits
- Stretches it into a long keystream
- XOR with the plaintext P to produce a ciphertext C
- To decrypt, use the same key stream and XOR it with C
Function
StreamCipher(K) = S
เข้ารหัสทีละ bit
ถอดรหัสทีละ bit เช่นกัน
Stream Ciphers –RC4
A look up table containing a permutation of the 256-byte values
Each time a byte is produced, the look up table is modified in such a way that the table always contains a permutation of {0,1,2, …,255}
First phase สร้างตาราง
Initialisesthe lookup table using the key
generate key ขึ้นมาเป็น array 2 อัน
RC4 is used in many applications –SSL and WEP
Little effort to develop new stream ciphers
“Death of stream ciphers”
Block ciphers are in ascendency
Block Ciphers
- A block cipher is a function that maps n-bit plaintext blocks to n-bit ciphertext
blocks, nis called the blocklength
- Splits plaintext into fixed sized blocks
- Generates fixed sized blocksof ciphertext
- The ciphertext is obtained from the plaintext by iterating a function
F over some number of rounds
- The function F, which depends on the output of the previous round and the key K,
is known as a round function
Confusion
Complicate relations between keysand ciphertexttoprohibit cryptanalyst from gaining useful information of key from statistical analyses of ciphertext
Diffusion
Dissipate plaintext redundancyand other characteristicsby defusing/maskingthem within entire ciphertext
Transposition, Composition
Block Ciphers -DES
- Data Encryption Standard
- Processes plaintext blocks of n = 64 bits, producing 64-bit ciphertext blocks
- The effective size of the secret key K is k = 56 bits
- Encryption proceeds in 16 rounds วน loop 16 ครั้ง
- From the input key K, sixteen 48-bit subkeysKiare generated, one for each round
- Within each round, 8 fixed substitution mappings (S-boxes) Siare used
แบ่งเนื้อความเป็น 2 ส่วน ส่วนซ้ายกับขวา
- The 64-bit plaintext is divided into 32-bit halves L0and R0
- Each round takes 32-bit inputs Li-1andRi-1from the previous round
- Produces 32-bit outputLiand Rifor 1 ≤i ≤16, as follows
- E is a fixed expansion permutation mappingRi-1from 32 to 48 bits
- P is another fixed permutation on 32 bits
- An initial bit permutation (IP) precedes the first round
- Following the last round, the left and right halves are exchanged
- The resulting string is bit-permutated by the inverse of IP
Decryption
- The same key and algorithm
- But with subkeysapplied to the internal rounds in the reverse order
Initial / Final Permutation
- Shuffle input/output bits by table look-up
- NO security effect
Round Key Generation
- Produce 16 48-bit keys
- Takes different subset of 56-bit master key
DES Internal Rounds
- Perform confusion by mangling S-boxes
- Perform diffusion by two-part shuffle and XOR
Strengths of DES
- Even if you have the plaintext and ciphertext, it seems difficult to get the key
- Altering 1 bit of the plaintext block alters about half of the bits of the ciphertextblock
- The functions are a mixture of different mathematical structures with no apparent shortcut
- DES is tried and tested
Weaknesses of DES
The key size of 56 bits is now too small. It is feasible these days to
exhaustively search a key space of size 2
Block Ciphers –Triple DES
- One way to improve the security of DES is to increase the key size
- This is done by using a variation called Triple DES
- 3 DES keys K1,K2and K3
- The key size is now 3*56 = 168 bits which is long enough to defeat exhaustive key search attacks with current technology
Sender (Alice):
- First Alice encrypts the message Mwith key K1 to get C
- She then Decrypts C with key K2 to get M’,
- Finally she encrypts M’ with key K3 to get C’ which she sends to Bob
Receiver (Bob):
- Bob also has the 3 keys K1, K2 and K3
- Bob decrypts C’ using key K3 to get M’,
- He then encrypts M’ using key K2 to get C
- Finally Bob decrypts Cusing key K1to get the original message M
Block Ciphers –AES
- Advanced Encryption Standard
- Rijndael algorithm
- Can process data blocks of 128 bits
- Using cipher keys with lengths of 128, 192 and 256 bits
- AES-128, AES-192 and AES-256
- Input and output –sequences of 128 bits
- The sequences –known as blocks
- The basic unit for processing in AES is a byte
- For an input, output and cipher key denoted by a, the resulting array will be referenced as a nor a[n],where
- The length of the input block, the output block and the State is 128 bits
- Represented as Nb= 4 (number of columns in the State)
- The length of the Cipher Key, K, is 128, 192 or 256 bits
- Represented as Nk= 4, 6 or 8 (number of columns in the Cipher Key
นำมาสลับ ขยับ และรวมกัน