Cryptography
Cryptography
SECURE COMMUNICATION
THROUGH OPEN
CHANNELS
Mathematics is like checkers in being
suitable for the young, not too
difficult, amusing and without peril to
the state
- Plato (429-347 BC)
Cryptosystem: Collection of
Encryption
Decryption
Cryptography is used for:
Military
Diplomatic ( to prevent wiki leaks!)
Commercial (banks, companies etc)
becomes
ATTACK AT ONCE
with
READY
17 23 19 03 00 0104 19 17 11 19 08
Or converted to letters:
RXTDAB ET RLTI
XOR
Symmetric algorithms:
Block ciphers operates on groups of
bits.
Each block is processed many
times.
Stream Cipher operates on one bit
at a time. Key stream is same
Data Encryption Standard (DES)
Created by IBM.
1. Provides a high level of security
2. The security depends on the keys,
not the secrecy of the algorithm.
3. The security is capable of being
evaluated.
4. The algorithm is completely
specified and easy to understand.
5. It is efficient to use and adaptable.
6. Must be available to all users.
DEA has a 64 bit block size and uses a
56 bit key during execution (8 parity
bits are removed from the 64 bit key).
N=AxB
T = (A-1) x (B-1)
To decrypt:
M = CD mod N
Example:
A = 37
B = 23
N = 37 x 23 = 851
T = (37-1)x(23-1) = 792
E must have no common factors with T
(792)
D (private key) = 5-1 mod 792 = 317
To decrypt
M = 638317 mod 851 = 7
C M E (mod N )
D
C M E D
M 1Tn
M (mod N )
N 1
a ( N 1)! ( N 1)!(mod p )
Note that the converse of Fermats
little theorem does not hold.
That is if some integer N satisfies the
relation it is not necessarily prime.
Questions:
1. Why does E have to co-prime with
T?
. Sieve of Eratosthenes
. Choosing a number at random (or
which can possibly be a prime and
then testing it for primality.
For example multiply all prime
Sometimes this number,i.e, p# + 1
( where p# is the product of all primes
upto p) is not prime.
For example:
2 x 3 x 5 x 7 x 11 x 13
+1= 30031
= 59 x 509
So p# + 1 is a possible candidate, but
it has to be tested for primality.
JAMES
Example:
Consider the set {2,3,4,5,6,9,12} and if the
encrypted output is 17. How do you decode
it?
1 x 31 mod(110) = 31
2 x 31 mod(110) = 62
4x 31 mod(110) = 14
10 x 31 mod(110) = 90
20 x 31 mod(110) = 70
40 x 31 mod(110) = 30
So the public key is: {31, 62, 14, 90,
70, 30} and
the private key is {1, 2, 4, 10, 20, 40}.
100100
111100
This corresponds to three sets of
weights with totals as follows:
100100 = 31 + 90 = 121
100100111100101110.
Warning:
Simple and short knapsack codes are
far too easy to break to be of any real
use.
For a knapsack code to be reasonably
secure it would need well over 200
terms each of length 200 bits.
It has been shown that Knapsack
problem is solvable in Polynomial
time! This was done by Shamir (of