home | articles | links | fun | about
Up to: CS432 Information Security

Data Confidentiality (9/26/02)

Don't get something for nothing

One-time pad (only provably secure method)

Provably secure: Zeke can't guess any better

Huge drawback: consume 1 bit of pad for each bit sent

Obvious "improvement: use pseudorandom numbers. But numbers must look random to adversary.

Cryptographic pseudorandom number generator (CPRNG)

Worst acronym ever

Important, but often done wrong. Consultant will ask: "Where do you get your numbers from?"

Treat as function that takes small seed and outputs long sequence of bits (deterministic)

Kerckoff's Principle: Don't hide algorithm

Old principle, accepted as truth

Don't rely on secrecy of alg., rely on secrecy of key

Quantifies probability adv. can guess: he chooses randomly

Choosing the seed

Needs to be random

Extract randomness

How CPRNG's work

         seed -----> [ state ] -------> [ f ] --------> output
                       ^          |
                       |          |
                       |----[g]---|

Have seed and g() go into state. Output of state goes back into g() and f(). Iterative.

Easy method: ith output = MAC(seed, i).

Diagram:

         seed -> [ seed, i ] ----------> [ MAC ] --------> output
                         ^          |
                         |          |
                         |--[i++]---|

Using CPRNG as a cipher (to encrypt)

A, B agree on random secret K

Use K as seed, generate random bits

Use stream of bits as one-time pad

If CPRNG strong, this is a strong cipher

Drawbacks of XOR-based cipher

Block ciphers

Most commonly used cipher; build on a function that encrypts file-size blocks w/ reusable key

Cipher not one-way (need to encrypt and decrypt)

Requirement: can only decrypt (run backwards) if know key

                          input
 
                            |
                            |
                     left   | right
                     <-----[ ]----->
                     |             |                
                     |     key     |                
                     |      |      v                
                     |---->[f]--->[XOR]              
                     |             |                
                     |             |                
                     ------[ ]------                
                            |                       
                            |                       
                            |                       
                            v                       
                                                    
                     L              R               
                     |     key      | 
                     |      |       | 
       encrypt{      |---->[f]---->[XOR]   R XOR f(L,key)
                     |              |
                     |              |
                     .              .
                     .              .
                     .              .
                     
                     L              R_scrambled     
                     |     key      | 
                     |      |       | 
       decrypt{      |---->[f]---->[XOR]   R XOR f(L,key) XOR f(L,key) = R
                     |              |
                     |              |
                     .              .
                     .              .
                     .              .
                     L              R

Split input into two halves: Left (L) and Right (R)

Feistel cipher: iterated sequence of Feistel steps

     [                ]               
     [ L     f      R ]               
       |           /                  
       --------------                 
                /   |                 
       --------     |
       v            v                 
     [                ]               
     [ L     f      R ]  

L output of one network goes to R input of other, and vice versa

Inversion: run backwards (reverse order)

Use different keys for each step

Tradeoff between goodness of F and number of rounds