0% found this document useful (0 votes)
6 views22 pages

Secure Application Development - 02 (1)

The document discusses secure application development with a focus on cryptography, covering symmetric and asymmetric encryption, key distribution, and message authentication. It explains the workings of symmetric block encryption algorithms, the importance of key security, and the role of public-key encryption in confidentiality and authentication. Additionally, it highlights the efficiency of symmetric cryptography compared to asymmetric methods, particularly in data encryption and key exchange.

Uploaded by

p66zxz4fd4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views22 pages

Secure Application Development - 02 (1)

The document discusses secure application development with a focus on cryptography, covering symmetric and asymmetric encryption, key distribution, and message authentication. It explains the workings of symmetric block encryption algorithms, the importance of key security, and the role of public-key encryption in confidentiality and authentication. Additionally, it highlights the efficiency of symmetric cryptography compared to asymmetric methods, particularly in data encryption and key exchange.

Uploaded by

p66zxz4fd4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Secure Application Development

- 02
Cryptography
Chapter Objectives
● Explain the basic operation of symmetric block encryption
algorithms.
● Compare and contrast block encryption and stream encryption.
● Discuss the use of secure hash functions for message
authentication.
● Explain the basic operation of asymmetric block encryption
algorithms.
● Present an overview of the digital signature mechanism.
Symmetric Encryption
Similar keys, similar encryption/decryption algorithms, transparent
a;gorithm (known to everyone)
Symmetric Encryption (cont.)
● Plaintext: This is the original message or data that is fed into the algorithm as
input.
● Encryption algorithm: The encryption algorithm performs various substitutions
and transformations on the plaintext.
● Secret key: The secret key is also input to the encryption algorithm. The exact
substitutions and transformations performed by the algorithm depend on the key.
● Ciphertext: This is the scrambled message produced as output. It depends on
the plaintext and the secret key. For a given message, two different keys will
produce two different ciphertexts.
● Decryption algorithm: This is essentially the encryption algorithm run in
reverse. It takes the ciphertext and the secret key and produces the original
plaintext.
Symmetric Encryption Requirements
There are two requirements for secure use of symmetric encryption:

● We need a strong encryption algorithm. At a minimum, we would like the


Algorithm to be such that an opponent who knows the algorithm and has
access to one or more ciphertexts would be unable to decipher the
ciphertext or figure out the key. This requirement is usually stated in a
stronger form: The opponent should be unable to decrypt ciphertext or
discover the key even if he or she is in possession of a number of
ciphertexts together with the plaintext that produced each ciphertext.
● Sender and receiver must have obtained copies of the secret key in a secure
fashion and must keep the key secure. If someone can discover the key and
knows the algorithm, all communication using this key is readable.
Fiestel Structure
● Used in many symmetric key algorithms and multiple operations are
performed such as:
○ Expansion: The right half of the plaintext is expanded to match the size of the key.
○ Key Mixing (XOR): The expanded right half is XORed with a subkey derived from the main
encryption key.
○ Substitution (S-Box): The result of the XOR operation is then passed through a series of
substitution boxes (S-boxes). S-boxes are used to provide the non-linearity in the encryption
process. They replace certain bit patterns with others, based on predefined tables.
○ Permutation (P-Box): After substitution, the output from the S-boxes is permuted according
to a fixed permutation table called the P-box.
○ XOR with Left Half: The output of the permutation step is XORed with the original left half of
the plaintext.
○ Swap: After each round, the left and right halves of the data block are swapped.
● Those operations are performed over multiple rounds.
Symmetric Key Considerations
● The exact realization of a symmetric block cipher depends on the choice of the following
parameters and design features:
○ Block size: Larger block sizes mean greater security (all other things being equal) but reduced
encryption/decryption speed. A block size of 128 bits is a reasonable tradeoff and is nearly universal among
recent block cipher designs.
○ Key size: Larger key size means greater security but may decrease encryption/ decryption speed. The most
common key length in modern algorithms is 128 bits.
○ Number of rounds: The essence of a symmetric block cipher is that a single round offers inadequate
security but that multiple rounds offer increasing security. A typical size is 16 rounds.
○ Subkey generation algorithm: Greater complexity in this algorithm should lead to greater difficulty of
cryptanalysis.
○ Round function: Again, greater complexity generally means greater resistance to cryptanalysis.
○ Fast software encryption/decryption: In many cases, encryption is embedded in applications or utility
functions in such a way as to preclude a hardware implementation. Accordingly, the speed of execution of the
algorithm becomes a concern.
○ Ease of analysis: Although we would like to make our algorithm as difficult as possible to cryptanalyze,
there is great benefit in making the algorithm easy to analyze.
3DES
How To
Exchange
keys
securely
Key Distribution
● For symmetric encryption to work, the two parties to an exchange
must share the same key, and that key must be protected from
access by others.
● Frequent key changes are usually desirable to limit the amount of
data compromised if an attacker learns the key.
● Therefore, the strength of any cryptographic system rests with the
key distribution technique, a term that refers to the means of
delivering a key to two parties that wish to exchange data, without
allowing others to see the key.
Key Distribution (Cont.)
● Key distribution can be achieved in a number of ways. For two
parties A and B:
○ A key could be selected by A and physically delivered to B.
○ A third party could select the key and physically deliver it to A and B.
○ If A and B have previously and recently used a key, one party could transmit the
new key to the other, encrypted using the old key.
○ If A and B each have an encrypted connection to a third party C, C could deliver a
key on the encrypted links to A and B.
Public-key Encyption
● Public-key encryption, first publicly proposed by Diffie and Hellman in
1976, is the first truly revolutionary advance in encryption in literally
thousands of years.
● Public-key algorithms are based on mathematical functions rather
than on simple operations on bit patterns, such as are used in
symmetric encryption algorithms.
● More important, Public- key cryptography is asymmetric, involving the
use of two separate keys, in contrast to symmetric encryption, which
uses only one key. The use of two keys has profound consequences in
the areas of confidentiality, key distribution, and authentication.
Public-Key Encryption (Confidentiality)
Public-Key Encryption (Integrity, Authentication)
What about
Authenticity?
Message Authentication
● Encryption protects against passive attack (eavesdropping).
● A different requirement is to protect against active attack
(falsification of data and transactions)
● Protection against such attacks is known as message or data
authentication
● A message, file, document, or other collection of data is said to be
authentic when it is genuine and came from its alleged source.
● The two important aspects are to verify that the contents of the
message have not been altered and that the source is authentic
Message Authentication Code
Hash Function
Hash Function + Authentication (Symmetric)
Hash Function + Authentication (Asymmetric)
Hash Function + Authentication (Secret Key)
Cryptography Discussion
● Symmetric cryptography is faster than asymmetric cryptography.
(efficient)
● Asymmetric cryptography is mandatory to exchange keys between
parties but not for large messages.
● Asymmetric cryptography is mainly relying on mathematical
operations which makes it slower than symmetric cryptography
● Nowadays, Asymmetric is used to exchange keys, digital signature
where symmetric cryptography is used to encrypt data.

You might also like