Security in Computing & Information Technology (COSC2536) : Lectorial 1: Basic Cryptographic Techniques
Security in Computing & Information Technology (COSC2536) : Lectorial 1: Basic Cryptographic Techniques
Lecture Overview
•During this session, we will discuss:
Introduction to the course
Part -I: Symmetric Key Cryptography
– Concepts of Symmetric Key Cryptography
– One-Time Pad, Stream Cipher, Block Cipher
Part –II: Cryptographic Hash Functions
–Basics of Hash Functions
–How Hash works, properties of Hash
–Applications of Hashes
2
RMIT Classification: Trusted
Staff
•Course Coordinator and lecturer:
–Shekhar Kalra (SK)
–[email protected]
–Consultation: set up a time via email
3
RMIT Classification: Trusted
4
RMIT Classification: Trusted
6
RMIT Classification: Trusted
7
RMIT Classification: Trusted
8
RMIT Classification: Trusted
9
RMIT Classification: Trusted
11
RMIT Classification: Trusted
plaintext
plaintext encrypt decrypt
ciphertext
12
RMIT Classification: Trusted
What is XOR and how XOR works
13
RMIT Classification: Trusted
h e i l h i t l e r
Plaintext: 001 000 010 100 001 010 111 100 000 101
Key: 111 101 110 101 111 100 000 101 110 000
Ciphertext: 110 101 100 001 110 110 111 001 110 101
s r l h s s t h s r
14
RMIT Classification: Trusted
s r l h s s t h s r
Ciphertext: 110 101 100 001 110 110 111 001 110 101
Key: 111 101 110 101 111 100 000 101 110 000
Plaintext:
001 000 010 100 001 010 111 100 000 101
h e i l h i t l e r
15
RMIT Classification: Trusted
P K=C C K=P
s r l h s s t h s r h e i l h i t l e r
16
RMIT Classification: Trusted
Reference: http://www.jscape.com/blog/stream-cipher-vs-block-cipher
17
RMIT Classification: Trusted
18
RMIT Classification: Trusted
19
RMIT Classification: Trusted
Stream Ciphers
Reference: http://www.jscape.com/blog/stream-cipher-vs-block-cipher
20
RMIT Classification: Trusted
Stream Ciphers
http://www.jscape.com/blog/stream-cipher-vs-block-cipher
21
RMIT Classification: Trusted
• Stream ciphers are often used for their speed and simplicity
implementation in hardware, and in applications where
plaintext comes in quantities of unknowable length like a
secure wireless connection (e.g. older technology GSM mobile
phones)
22
RMIT Classification: Trusted
23
RMIT Classification: Trusted
24
RMIT Classification: Trusted
$ cat bigfile
This is a larger file that contains more characters.
This demonstrates that no matter how big the input
stream is, the generated hash is the same size (but
of course, not the same value). If two files have
a different hash, they surely contain different data.
25
RMIT Classification: Trusted
$ cat file1
This is a very small file with a few characters
$ cat file2
this is a very small file with a few characters
$ md5sum file?
75cdbfeb70a06d42210938da88c42991 file1
6fbe37f1eea0f802bd792ea885cd03e2 file2
26
RMIT Classification: Trusted
Encryption Vs Hash (IMPORTANT)
Encryption transforms
data from a cleartext to
ciphertext and
back (given the right
keys), and the two texts
should roughly
correspond to each other
in size: big cleartext
yields big ciphertext, and
so on. "Encryption" is
a two-way operation.
This is a common
confusion, especially
because all these words
are in the category of
"cryptography", but it's
important to understand
the difference.
27
RMIT Classification: Trusted
Encryption Vs Hash (IMPORTANT)
• Hashes compile a
stream of data
into a small
digest, and it's
strictly a one way
operation.
• All hashes of the
same type - this
example shows
the "MD5" variety
- have the same
size no matter
how big the
inputs are.
28
RMIT Classification: Trusted
Hash Collision
When different chunks of data produce the same hash value, this
is known as a collision.
29
RMIT Classification: Trusted
Hash Collision: Applications Fail
30
RMIT Classification: Trusted
31
RMIT Classification: Trusted
Applications of Hash
• Authentication (HMAC)
• Message fingerprint
32
RMIT Classification: Trusted
Applications of Hashes: Data integrity
33
RMIT Classification: Trusted
Applications of Hashes: Passwords
34
RMIT Classification: Trusted
35
RMIT Classification: Trusted
Applications of Hashes: Digitally Signing Documents
36
RMIT Classification: Trusted
Conclusions
• One big issue with using symmetric algorithms is the key
exchange problem, which can present a classic catch-22.
• The other main issue is the problem of trust between two
parties that share a secret symmetric key. Ensuring the
integrity of received data and verifying the identity of the
source of that data can be very important.
• The key exchange problem arises from the fact that
communicating parties must somehow share a secret key
before any secure communication can be initiated, and
both parties must then ensure that the key remains secret.
Of course, direct key exchange is not always feasible due
to risk, inconvenience, and cost factors.
• Fortunately, asymmetric algorithms can be used to solve
these problems by performing the same basic operations
which we will learn in the forthcoming lectorial(s).
Reference: http://www.informit.com/articles/article.aspx?p=102212
37
RMIT Classification: Trusted
Popular choices of hashing algorithms in
2024
–scrypt
–bcrypt
38