View
223
Download
0
Category
Tags:
Preview:
Citation preview
Copyright © - 2004-2014 – Curt Hill
Cryptography
Number Theory’s Practical Application
Introduction• Encryption is mechanism for obscuring a
message from someone else in a reversible way – Decryption is reversing it
• Cryptography is the study• Historically used to send messages
during wars– Non-standard hieroglyphics date back to at
least 1900 BC
• Most of the historic ciphers are relatively easy to break
Copyright © - 2004-2014 – Curt Hill
Terminology• Plain text
– A message that is readable– AKA Clear text
• Cipher text– A message that has been disguised
• Key – A string that allows the encryption and
decryption
Copyright © - 2004-2014 – Curt Hill
What we want• Encryption technique E(M,K) which
takes a message M and a key K• Decryption technique D(M,K) which
also takes message M and key K• Both E and D return a string• M = D(E(M,K),K)• Neither E nor D needs to be concealed• Only secret thing is K the key• E and D are efficiently computable
Copyright © - 2004-2014 – Curt Hill
Historical Ciphers• Any technique that gives one side of
a war an advantage over the other is of interest
• However most of these are not of interest to us in discrete math:
• Transposition and Substitution Cipher• Enigma and Colosus • One time pad• Stream Cipher• Block Cipher• Feistel Cipher• DES, AES
Copyright © - 2004-2014 – Curt Hill
Enigma• Code machine used by Germans in
World War II• Several rotors• A letter is typed in the rotors provide a
single substitution cipher for that letter• The rotors are now advanced• The next letter gets a different
transposition• The key becomes the rotor settings• The Colossus was used to break
Copyright © - 2004-2014 – Curt Hill
Enigma Again• Would have been secure if used
properly• Instead they often used same key for
too long• Predictable openings were often used:
– Common greetings: Mein Fueherer!– This gives away the key to analysis
• Users thought it was magic so did not worry enough
Copyright © - 2004-2014 – Curt Hill
One time pad• The one time pad is a string of
offsets to add to each letter of message
• Two copies of the pad: the sender and receiver
• Pad is never reused • Algorithmically unbreakable if there
is no pattern in the pad• Transfer of the pad may be a problem
Copyright © - 2004-2014 – Curt Hill
OTP ExamplePlain ASCII B A T
ASCII Numeric
66 65 84
One time pad
12 9 23
Cipher numeric
78 74 107
Cipher as ASCII
N J k
Copyright © - 2004-2014 – Curt Hill
Distribution• The problem with most ciphers is
called the key distribution problem• How is the key given to the receiver
by the sender?• Since everything else is known this
becomes a weak link• Public Key Encryption does not suffer
from this problem
Copyright © - 2004-2014 – Curt Hill
Public key encryption• AKA Trapdoor algorithms• Each user has a public and private key• These are usually very large numbers,
based on primes• The key is that multiplying/dividing
very large numbers is easy• Factoring a very large number into its
primes is very difficult– Conceivably taking years
Copyright © - 2004-2014 – Curt Hill
Authors• This algorithm was devised by Ron
Rivest, Adi Shamir and Leonard Adleman
• RSA became the name of the algorithm
• MIT patented• Published in 1977• Proofs of its effectiveness abound• They received Turing award
Copyright © - 2004-2014 – Curt Hill
Key Generation•Find two large primes, P and Q
–Approximately equal in size
•Compute the product N = PQ–N should be 1024 bits or larger–Known as the modulus
•Compute = (P-1)(Q-1) is spelled phi and pronounced fee
Copyright © - 2004-2014 – Curt Hill
Two more• Choose E such that 1 < E <
– E and must be relatively prime– Neither needs to be prime but
relatively prime to each other– This is the public exponent or
encryption exponent
• Find D– 1 < D < – ED mod = 1– This is the secret exponent or decryption
exponent
Copyright © - 2004-2014 – Curt Hill
How it works• The public key is a pair (E,N) and the
private key is also a pair (D,N)• Everyone participating in concealed
messages publishes their public key where anyone can access
• The private key as well as P, Q and N are also kept secret
Copyright © - 2004-2014 – Curt Hill
Sending a message• Albert wants to send Bob a secret
message• Obtains Bobs public key (E,N)• Convert the clear text into numeric
chunks of the suitable length, call one of these M
• Compute cipher text: C = ME mod N• Repeat for subsequent chunks and
send
Copyright © - 2004-2014 – Curt Hill
Reading sent message• Bob now wants to read Albert’s
message• Use his own private key to restore
the plain text– M = CD mod N
Copyright © - 2004-2014 – Curt Hill
Another Thought• Anyone may send a message to
anyone else• How do we determine if someone has
falsified a message? • The digital signing process is not that
much different than the encryption and decryption
Copyright © - 2004-2014 – Curt Hill
Digital Signing• Albert extracts pieces of the message
to make a digest• Albert uses his private key to compute
S = MD mod N• Bob uses Albert’s public key to compute
V = SE mod N• Bob uses the same extraction method
and compares this with the sent signature
Copyright © - 2004-2014 – Curt Hill
Some practicalities• Common choices for E are 3, 17 and
65537 which are Fermat primes– This makes the modular exponentiation
quick
• Computing D often uses the Extended Euclidean Algorithm
Copyright © - 2004-2014 – Curt Hill
Is it breakable?• The usual thought is that factoring
very large numbers is extremely difficult
• The current unclassified belief is that factoring these size numbers would take centuries or longer– Of course, rumors abound
• The open question is if there is a technique that can crack this that does not require factorization
Copyright © - 2004-2014 – Curt Hill
Summary• Encryption maintains the data but
make it unusable to those without the key
• Use decryption to return to plain text• Used for transmitting sensitive data
and for stored data on disk• With this background we may now
consider database security
Copyright © - 2004-2014 – Curt Hill
Recommended