Chapter 3 Cryptographic Tools
Chapter 3 Cryptographic Tools
Principles and
Practice
Fourth Edition, Global Edition
Stream
Cipher
• Processes the input bytes continuously
• Produces output one byte at a time
• Primary advantage is that they are almost always faster
and use far less code
• Encrypts plaintext one byte at a time
• Pseudorandom stream is one that is unpredictable
without knowledge of the input key
Practical Security
Issues
Typically symmetric encryption is applied to a unit
of data larger than a single 64-bit or 128-bit block
Electronic codebook (ECB) mode is the simplest
approach to multiple-block encryption
Each block of plaintext is encrypted using the same key
Cryptanalysts may be able to exploit regularities in the
plaintext
Modes of operation
Alternative
techniques developed to increase the security
of symmetric block encryption for large sequences
Overcomes the weaknesses of ECB
ECB Mode
CBC Block
https://github.com/abid134/Sample.git
Confusion and
Diffusion
• Confusion means that each binary digit (bit) of the
ciphertext should depend on several parts of the key,
obscuring the connections between the two.
3.16
Table 2.1
Strength concerns:
Concerns about the algorithm itself
DES is the most studied encryption
algorithm in existence
Concerns about the use of a 56-bit key
The speed of commercial off-the-shelf
processors makes this key length woefully
inadequate
Table 2.2
Significantly
3DES was not improved efficiency
Published as
reasonable for
long term use FIPS 197
Symmetric block
cipher
Protects against
active attacks
• Contents have not been
Verifies received altered
message is • From authentic source
• Timely and in correct
authentic sequence
Can use
• Only sender and receiver
conventional share a key
encryption
Message
Authentication
• The following methods are used for Message
Authentication without encryption:
1) MESSAGE AUTHENTICATION CODE
https://xorbin.com/tools/sha1-hash-calculator
2) ONE-WAY HASH FUNCTION
https://cryptotools.net/hmac
Latest Algorithms
• Message Authentication Code (MAC):
o HMAC (Hash-based Message Authentication Code)
o CBC-MAC (Cipher Block Chaining Message Authentication Code)
o CMAC (Cipher-based Message Authentication Code)
SHA-512
Asymmetri
c
Publicly • Uses two Some form
proposed Based on separate of protocol
by Diffie mathemati keys is needed
and cal • Public key for
Hellman in functions and private distributio
1976 key n
• Public key
is made
public for
others to
use
Plaintext
Readable message or data that is fed into the algorithm as input
Encryption algorithm
Performs transformations on the plaintext
Public and private key
Pair of keys, one for encryption, one for decryption
Ciphertext
Scrambled message produced as output
Decryption key
Produces the original plaintext
User encrypts data using his or
her own private key
Anyone who knows the
corresponding public key will be
able to decrypt the message
Table 2.3
Computationally
Computationally infeasible for
easy for receiver
an opponent, knowing the
knowing private key
public key, and the cipher text
to decrypt
to recover the original message
ciphertext
Computationally
infeasible for
opponent to
determine private
key from public key
Asymmetric Encryption
Algorithms
RSA (Rivest, Most widely accepted
Block cipher in which
the plaintext and
Shamir, Developed in 1977
and implemented
approach to public-key
ciphertext are integers
between 0 and n-1 for
Adleman) encryption
some n.
symmetric encryption
algorithm of messages
Digital
Signature Provides only a digital
signature function with
Cannot be used for
encryption or key
Standard SHA-1 exchange
(DSS)
Elliptic curve
cryptography Security like RSA, but
with much smaller keys
(ECC)
RSA
Digital Signatures
NIST FIPS PUB 186-4 defines a digital signature as:
”The result of a cryptographic transformation of data that,
when properly implemented, provides a mechanism for
verifying origin authentication, data integrity and
signatory non-repudiation.”
Thus, a digital signature is a data-dependent bit pattern,
generated by an agent as a function of a file, message, or other
form of data block
FIPS 186-4 specifies the use of one of three digital signature
algorithms:
Digital Signature Algorithm (DSA)
RSA Digital Signature Algorithm
Elliptic Curve Digital Signature Algorithm (ECDSA)
Random Keys for public-key
Numbers algorithms
Stream key for
symmetric stream
Uses include cipher
generation of: Symmetric key for use
as a temporary session
key or in creating a
digital envelope
To prevent replay
Random Number
Requirements
Uniform distribution Unpredictability
Frequency of occurrence Opponent should not be able
of each of the numbers to predict future elements of
should be approximately the sequence on the basis of
the same earlier elements
Independence Repeatability
Each random number It should be deterministic.
generated should be
The sequence of pseudo-
statistically independent
random numbers should be
of previous or subsequent
repeatable given the same
numbers
initial state or seed value.
Summary
• Confidentiality with
symmetric encryption • Public-key encryption
Symmetric encryption Structure
Symmetric block encryption Applications for public-key
algorithms cryptosystems
Stream ciphers Requirements for public-key
• Message authentication cryptography
Asymmetric encryption
and hash functions algorithms
Authentication using symmetric
encryption
• Digital signatures and
Message authentication without key management
message encryption Digital signature
Secure hash functions Public-key certificates
Other applications of hash Symmetric key exchange using
functions public-key encryption
Digital envelopes
• Random and
• Practical Application:
pseudorandom numbers Encryption of Stored
The use of random numbers
Random versus pseudorandom
Data