Introduction to Cryptography
and Security
Course Description
• Name: Software and Cybersecurity (3-0-2-4)
• Course Code: CS445/ IT445
• Lectures: Tuesday (9:15am) and Friday (11:00am)
• Lab: Monday 2:00pm-4:00pm
Major division of the course
• Software security
– C/C++/java/python
• Cybersecurity
– Computer network/DBMS/Linux
• Cybersecurity professionals for industry
– tools
Course evaluation
• Mid semester – 20%
• End semester – 30%
• Assignments – 20%
• Quizzes – 30%
Security issues
The world before computers: much simpler
• Signing, legalizing a paper would authenticate it
– One can recognize each other’s face, voice, hand signature, etc.
• Photocopying easily detected
• Erasing, inserting, modifying words on a paper document easily
detectable
• Secure transmission of a document: seal it and use a reasonable
mail carrier (hoping the mail train does not get robbed)
Security issues
Electronic world: the ability to copy and alter information has
changed dramatically
• No difference between an “original” file and copies of it
• Removing a word from a file or inserting others is undetectable
• Adding a signature to the end of a file/email: one can
impersonate it – add it to other files as well, modify it, etc.
• Electronic traffic can be monitored, altered, often without
noticing
• How to authenticate the person electronically communicating
with you
Possible adversaries
• Student: to have fun snooping on other people’s email
• Businessman: to discover a competitor’s strategic marketing plan
• Ex-employee: to get revenge for being fired
• Accountant: to withdraw money from a company
• Stockbroker: to deny a promise made to a customer by email
• Convict: to steal credit card numbers for sale
• Spy: to learn an enemy’s military or industrial secrets
• Terrorist: to steal secret information
• Point to make: making a network or a communication secure
involves more than just keeping it free of programming errors
• It involves intelligent, dedicated and often well-funded adversaries
Security issues: some practical situations
• A sends a file to B: E intercepts it and reads it
– How to send a file that looks unintelligible to all but the intended receiver?
• A send a file to B : E intercepts it, modifies it, and then forwards it to B
– How to make sure that the document has been received in exactly the form it has
been sent?
• E sends a file to B pretending it is from A
– How to make sure your communication partner is really who(s) he claims to be?
• A sends a message to B : E is able to delay the message for a while
– How to detect old messages?
• A sends a message to B. Later A (or B) denies having sent (received) the
message
– How to deal with electronic contracts?
• E learns which user accesses which information although the information
itself remains secure
• E prevents communication between A and B : B will reject any message from
A because they look unauthentic
Information Security
• Information Security is the practice of protecting
information by mitigating information risks
• It involves the protection of information systems
and the information processed, stored and
transmitted by these systems from unauthorized
access, use, disclosure, disruption, modification or
destruction.
• Types: Application Security, Internet Security,
Cloud security, Cryptography, etc.
Classes of network security problems
• Confidentiality (or secrecy)
– Keep the information out of the hands of unauthorized users, even if it
has to travel over insecure links
– Privacy defines the ability to secure personally identifiable data
• Authentication
– Determine whom you are talking to before revealing sensitive
information
• Data integrity (or message authentication)
– Make sure that the message received was exactly the message you
sent (not necessarily interested here in the confidentiality of the
document)
• Non-repudiation (or signatures)
– the assurance that someone cannot deny the validity of something
What is Cryptography
• Cryptography is the study of mathematical
techniques related to aspects of information
security such as confidentiality, data integrity,
authentication, and non-repudiation.
• Cryptology = Cryptography + Cryptanalysis
– Cryptography --- code designing
• study of secret (crypto-) writing (-graphy)
– Cryptanalysis --- code breaking
What is a cryptographic system
composed of?
Sender Receiver
C
P (encryption) (decryption) P
(encryption key) (decryption key)
• Plaintext (P): original message or data (also called cleartext)
• Encryption: transforming the plaintext, under the control of the key
• Ciphertext (C): encrypted plaintext
• Decryption: transforming the ciphertext back to the original
plaintext
• Cryptographic key: used with an algorithm to determine the
transformation from plaintext to ciphertext, and v.v.
Basic situation in cryptography
• A(lice) sends a message (or file) to B(ob) through an open channel (say,
Internet), where E(vil, nemy) tries to read or change the message
• A will encrypt the plaintext using a key transforming it into a
“unreadable” cryptotext or ciphertext
– This operation must be computationally easy
A B
C
P (encryption) (decryption) P
(encryption key) (decryption key)
Basic situation in cryptography
• B also has a key (say, the same key) and decrypts the
cryptotext to get the plaintext
– This operation must be computationally easy
• E tries to cryptanalyze: deduce the plaintext (and the key)
knowing only the ciphertext
– This operation should be computationally difficult
• We will use cryptography to cover both the design of
secure systems and their cryptanalysis
– Do not think in terms of good guys do cryptography and bad
guys do cryptanalysis?
Cryptanalysis – types of attacks
• Fundamental rule: one must always assume that the attacker knows the
methods for encryption and decryption; he is only looking for the keys
– Creating a new cryptographic method is a very complex process involving
many people – difficult to keep it confidential
– Bonus for publishing the methods: people will try to break it for you (for
free!)
• Passive attack: the attacker only monitors the traffic attacking the
confidentiality of the data
• Active attack: the adversary attempts to alter the transmission attacking
data integrity, confidentiality, and authentication.
• Cryptanalysis: rely on the details of the encryption algo. plus perhaps
some knowledge about the general characteristics of the plaintext –
sometimes the plaintext is known and the key is being looked for
• Brute-force attack: try every possible key on the ciphertext until an
intelligible translation into a plaintext is obtained
Average time required for exhaustive
key search
Attacks on encryption schemes
How secure is secure?
Evaluating the security of a system is a crucial and most difficult task
• Unconditionally secure system
– If the ciphertext does not contain enough information to determine
uniquely the corresponding plaintext: any plaintext may be mapped into
that ciphertext with a suitable key
– Consequently, the attacker cannot find the plaintext regardless of how
much time and computational power he has because the information is
not there!
– Bad news: only one known system has this property: one-time pad
Conditional or Complexity-theoretic security
Consider a model of computation (e.g., Turing machine) and adversaries
modeled as having polynomial computational power
Consider the weakest possible assumptions and the strongest possible
attacker and do worst-case or at least average-case analysis
One-Time pad
• Idea: use a (truly) random key as long as the
plaintext – change the key for every plaintext
• It is unbreakable since the ciphertext bears no
statistical relationship to the plaintext
• Moreover, for any plaintext & any ciphertext
there exists a key mapping
– Thus, a ciphertext can be decrypted to any plaintext of
the same length
– The cryptanalyst is in an impossible situation
Security of the one-time pad
• The security is entirely given by the randomness of the
key
– If the key is truly random, then the ciphertext is random
– A key can only be used once if the cryptanalyst is to be
kept in the “dark”
• Problems with this “perfect” cryptosystem
– Making large quantities of truly random characters is a
significant task
• Key distribution is enormously difficult: for any
message to be sent, a key of equal length must be
available to both parties
How secure is secure?
Evaluating the security of a system is a crucial and most difficult task
Unconditionally secure system
If the ciphertext does not contain enough information to determine
uniquely the corresponding plaintext: any plaintext may be mapped into
that ciphertext with a suitable key
Consequently, the attacker cannot find the plaintext regardless of how
much time and computational power he has because the information is
not there!
Bad news: only one known system has this property: one-time pad
• Conditional or Complexity-theoretic security
– Consider a model of computation (e.g., Turing machine) and adversaries
modeled as having polynomial computational power
– Consider the weakest possible assumptions and the strongest possible
attacker and do worst-case or at least average-case analysis
How secure is secure?
• Provable security
– Prove that breaking the system is equivalent with
solving a supposedly difficult (math) problem (e.g.,
from Number Theory)
• Computationally secure
– The cost of breaking the system exceeds the value of
the encrypted information
– The time required to break the system exceeds the
useful lifetime of the information
Cryptography – some notations
• Notation for relating the plaintext (P),
ciphertext (C), the key (K),
encryption algo. E() and decryption algo. D()
– C=EK(P) denotes that C is the encryption of the
plaintext P using the key K
– P=DK(C) denotes that P is the decryption of the
ciphertext C using the key K
– Then DK(EK(P))=P
Symmetric Key Algorithms
• Historic ciphers – Caesar, shift, mono alphabetic,
Playfair, Hill, Autokey, polyalphabetic, Rail fence,
Affine
• Stream Ciphers and Block Ciphers
• DES, Double DES, Triple DES,
• AES
• RC4, RC6
• RSA, Deffie-Hellman, ECC
• Hash functions….