lesson_03.md 2.3 KB

Computer Security - lesson 3

Stefano Zanero

17 March 2016

Note on previous exercize

Transposition exercize To solve the symmetric cypher exercize with transposition, we can use the unix tool 'aspell' as an oracle, it will return the syntactically corrected version and the number of errors, and we can find the string with the minimum number of errors. Zipfile exercize We can look at the magic number (first 4 bytes) to distinguish which file is Then i can compare the encrypted header with the standard one and find the key (if it is 4bytes) or the first 4 bytes of the key (if it is longer).

##Keyspace and bruteforcing Halving the size of the key we are not halving the number of bruteforce attempts required because the number of attempts (or different keys) is exponential to the size of the key (#bits) We have to evaluate if the time and the money needed for bruteforcing is worth for the content i'm bruteforcing.

##Asymmetric encryption It is called asymmetric because we use two keys for encryptyng and decrypting respectively Contrary to the simmetric example, now the sender uses the public key of the recipient for encrypting and its private key for signing. Common asymmetric cyphers

  • Diffie Hellman, RSA, ECC, DSS Diffie-Hellman exchange Alice and Bob exchange two files. The matemathical mechanism is a one-way trapdoor function:
  • It is very easy to compute example a^x
  • It is very difficult knowing y to compute x=loga(x)

We can use the exponentiation to compute the public key Y, but given Y it is practically impossible to find X (the secret key) In particular Pick p prime number, a primitive root of p Primitive root: a number a such that raising it to any number between 1 and p-1 and computing the modulo p we obtain each number between 1 and p-1 So Alice and Bob chooses a key: number between 1 and P-1 and compute the exponentiation: Ya^Xb mod p

RSA Algorithm

Instead of using the modulo calculus, we can use two large prime numbers

  • Factoring n is exponential to the number of bits of n
  • Computation time for encryptions grows linearly in the number of bits of n (square-and-multiply algorithm in hardware) Usually the asymmetric encryption is used to exchange a common secret then a symmetric encryption is used because of performance.

Hashing function