Chapter6 Cryptography
Chapter6 Cryptography
CHAPTER 6
NGUYEN MINH TRI Reference: Cisco Academy, Networking Security v1.0 [Online],
available at: www.netacad.com
Networking Security
Nguyen Minh Tri - Department of Telecommunications - Networks 3 Nguyen Minh Tri - Department of Telecommunications - Networks 4
DATA INTEGRITY DATA CONFIDENTIALITY
Data integrity ensures that messages are not altered in transit. Data confidentiality ensures privacy so that only the receiver
With data integrity, the receiver can verify that the received can read the message. This can be achieved through
message is identical to the sent message and that no encryption. Encryption is the process of scrambling data so
manipulation occurred. that it cannot be easily read by unauthorized parties.
When enabling encryption, readable data is called plaintext, or
cleartext, while the encrypted version is called encrypted text
or ciphertext. The plaintext readable message is converted to
ciphertext, which is the unreadable, disguised message.
Decryption reverses the process. A key is required to encrypt
and decrypt a message. The key is the link between the
plaintext and ciphertext.
Nguyen Minh Tri - Department of Telecommunications - Networks 5 Nguyen Minh Tri - Department of Telecommunications - Networks 6
Nguyen Minh Tri - Department of Telecommunications - Networks 9 Nguyen Minh Tri - Department of Telecommunications - Networks 10
Nguyen Minh Tri - Department of Telecommunications - Networks 29 Nguyen Minh Tri - Department of Telecommunications - Networks 30
KEY MANAGEMENT
Key Exchange Key management procedures should provide a secure key exchange mechanism that allows secure
agreement on the keying material with the other party, probably over an untrusted medium.
Key Storage On a modern multi-user operating system that uses cryptography, a key can be stored in memory. This
presents a possible problem when that memory is swapped to the disk, because a Trojan horse program
installed on the PC of a user could then have access to the private keys of that user.
Key Lifetime Using short key lifetimes improves the security of legacy ciphers that are used on high-speed connections. In
IPsec a 24-hour lifetime is typical. However, changing the lifetime to 30 minutes improves the security of the
algorithms.
NGUYEN MINH TRI - DEPARTMENT OF TELECOMMUNICATIONS - NETWORKS 35 Key Revocation Revocation notifies all interested parties that a certain key has been compromised and should no longer be
and Destruction used. Destruction erases old keys in a manner that prevents malicious attackers from recovering them.
36
KEY LENGTH AND KEYSPACE THE KEYSPACE
Two terms that are used to describe keys are: The keyspace of an algorithm is the set of all possible key
Key length - Also called the key size, this is the measure in bits. values. A key that has n bits produces a keyspace that has
In this course, we will use the term key length. possible key values. By adding one bit to the key, the
Keyspace - This is the number of possibilities that can be keyspace is effectively doubled.
generated by a specific key length.
Almost every algorithm has
As key length increases, the keyspace increases some weak keys in its keyspace
exponentially. The table displays the characteristics of the AES that enable an attacker to break
encryption algorithm. AES Characteristics Description Advanced Encryption Standard
the encryption via a shortcut.
Timeline Official standard since 2001
Type of Algorithm Symmetric
Weak keys show the regularities
Key Size (in bits) 128, 192, and 256
Speed High in encryption.
Time to Crack(assuming a computer 149 trillion years
could try 255 keys per second)
Resource Consumption Low
Nguyen Minh Tri - Department of Telecommunications - Networks 37 Source: https://en.wikipedia.org/wiki/Power_of_two#/media/File:Powers_of_two_cuboids.svg 38
E0E0E0E0F1F1F1F1
1F1F1F1F0E0E0E0E
Nguyen Minh Tri - Department of Telecommunications - Networks 39 Nguyen Minh Tri - Department of Telecommunications - Networks 40
CHOICE OF CRYPTOGRAPHIC KEYS
Performance is another issue that can influence the choice of
a key length. An administrator must find a good balance
between the speed and protective strength of an algorithm,
because some algorithms, such as the Rivest, Shamir, and
Adleman (RSA) algorithm, run slowly due to large key lengths.
The estimated funding of the attacker should also affect the
choice of key length. CONFIDENTIALITY
The rule is valid, except for
possible performance reasons. Shorter keys equal faster
processing but are less secure. Longer keys equal slower
processing but are more secure. NGUYEN MINH TRI - DEPARTMENT OF TELECOMMUNICATIONS - NETWORKS 42
Nguyen Minh Tri - Department of Telecommunications - Networks 43 Nguyen Minh Tri - Department of Telecommunications - Networks 44
SYMMETRIC ENCRYPTION SYMMETRIC ENCRYPTION
Symmetric encryption algorithms are sometimes classified as Stream ciphers encrypt plaintext one byte or one bit at a time.
either a block cipher or a stream cipher. Stream ciphers are basically a block cipher with a block size of
Block ciphers transform a fixed-length block of plaintext into a one byte or bit. Stream ciphers are typically faster than block
common block of ciphertext of 64 or 128 bits. Common block ciphers because data is continuously encrypted.
ciphers include DES with a 64-bit block size and AES with a
128-bit block size.
Nguyen Minh Tri - Department of Telecommunications - Networks 45 Nguyen Minh Tri - Department of Telecommunications - Networks 46
cryptographic privacy and authentication. It is often used to EIGamal 512 - An asymmetric key encryption algorithm for public-key cryptography which is based
1024 on the Diffie-Hellman key agreement. A disadvantage of the ElGamal system is that
increase the security of email communications. the encrypted message becomes very big, about twice the size of the original
message and for this reason it is only used for small messages such as secret keys.
Elliptic curve techniques 224 or Elliptic curve cryptography can be used to adapt many cryptographic algorithms,
higher such as Diffie-Hellman or ElGamal. The main advantage of elliptic curve
Nguyen Minh Tri - Department of Telecommunications - Networks 49 50
cryptography is that the keys can be much smaller.
When the public key is used to encrypt the data, the private key
must be used to decrypt the data. Only one host has the private
key; therefore, confidentiality is achieved.
Alice wants to send a message to Bob ensuring that only Alice also wants to ensure message authentication and integrity.
Bob can read the document. In other words, Alice wants Authentication ensures Bob that the document was sent by Alice,
Bob then uses his private key to to ensure message confidentiality. Alice uses the public and integrity ensures that it was not modified Alice uses her
decrypt the message. Since Bob is key of Bob to cipher the message. Only Bob will be able private key to cipher a hash of the message. Alice sends the
the only one with the private key, to decipher it using his private key encrypted message with its encrypted hash to Bob.
Alice's message can only be
message using an agreed-upon algorithm. decrypted by Bob and thus
Alice sends the encrypted message to Bob. 51
confidentiality is achieved. Nguyen Minh Tri - Department of Telecommunications - Networks 52
ASYMMETRIC ENCRYPTION - INTEGRITY DIFFIE-HELLMAN
Diffie-Hellman (DH) is an
was not modified. The received hash is equal to the asymmetric mathematical
Bob uses his private key to decipher the
Additionally, this verifies that Alice is definitely the message. algorithm that allows two
sender of the message because nobody else has
computers to generate an
identical shared secret without
having communicated before.
Nguyen Minh Tri - Department of Telecommunications - Networks 53 Nguyen Minh Tri - Department of Telecommunications - Networks 54
EXAMPLE DIFFIE-HELLMAN
The simplest and the original implementation of the protocol Diffie-Hellman uses different DH groups to determine the
uses the multiplicative group of integers modulo p, where p is strength of the key that is used in the key agreement process.
prime, and g is a primitive root modulo p. The higher group numbers are more secure but require
additional time to compute the key.
Alice Bob
Known Unknown Known Unknown The following identifies the DH groups supported by Cisco IOS
p = 23 p = 23 Software and their associated prime number value:
g=5 g=5 DH Group 1: 768 bits
2.
AUTHORITIES AND
step reveals the assumed hash value of THE PKI TRUST SYSTEM
the sending device.
3.
received document, without its signature,
and compares this hash to the decrypted
signature hash. If the hashes match, the
NGUYEN MINH TRI - DEPARTMENT OF TELECOMMUNICATIONS - NETWORKS 64
document is authentic.
Nguyen Minh Tri - Department of Telecommunications - Networks 63
PUBLIC KEY MANAGEMENT PUBLIC KEY INFRASTRUCTURE
When establishing an asymmetric connection between two PKI is needed to support large-scale distribution and
hosts, the hosts will exchange their public key information. identification of public encryption keys. The figure shows the
An SSL certificate is a digital certificate that confirms the main elements of the PKI.
identity of a website domain. To implement SSL on your
website, you purchase an SSL certificate for your domain from
an SSL Certificate provider.
The trusted third party does an in-depth investigation prior to
the issuance of credentials. After this in-depth investigation,
the third-party issues credentials (i.e., digital certificate) that
are difficult to forge. From that point forward, all individuals
who trust the third party simply accept the credentials that the
third-party issues.
Nguyen Minh Tri - Department of Telecommunications - Networks 65 Nguyen Minh Tri - Department of Telecommunications - Networks 66
Practices Framework (RFC 2527). The X.509 University of Science Vietnam National University Ho Chi Minh City