CH4 Cryptography
CH4 Cryptography
04/16/2024
What Is Cryptography?
ATTACK AT DAWN
DWWDFN DW GDZQ
§ A keyword mixed alphabet cipher uses a cipher alphabet that consists of a keyword, minus
duplicates, followed by the remaining letters of the alphabet. For example, using the key
word CRYPTOGRAPHY, this type of cipher would yield the following:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
CRYPTOGAHBDEFIJKLMNQSUVWXZ
§ Thus, the plaintext word ALPHABET would encrypt to CEKACRTQ
Types of Ciphers (Substitution )
The Vigenère Cipher:
§ The Vigenère cipher uses a 26×26 table with A to Z as the row heading and
column heading This table is usually referred to as the Vigenère Tableau.
§ the Vigenère cipher also requires a keyword, which is repeated so that the
total length is equal to that of the plaintext.
Example:
Plaintext:
ATTACKATDAWNTOMORROW
Key (repeated to match plaintext length):
PARTYPARTYPARTYPARTYPA
Ciphertext (shift characters using the key): PTKTAZAKWYLNKHKDRIHU
Types of Ciphers (Substitution )
Vigenère Tableau
Types of Ciphers (Substitution )
You must do three things to make sure a substitution cipher stays secure:
1. Make sure that the key is a random sequence without repetition.
2. Make sure it is as long as the encrypted information.
3. Use it only once.
The one-time pad (OTP): is an encryption technique that cannot be cracked, but
requires the use of a one-time pre-shared key the same size as, or longer than, the
message being sent. In this technique, a plaintext is paired with a random secret
key (also referred to as a one-time pad). Then, each bit or character of the
plaintext is encrypted by combining it with the corresponding bit or character
from the pad using modular addition.
Types of Ciphers (Substitution )
Example
Types of Ciphers (Transposition ciphers)
§ Symmetric Key Ciphers: use the same key to encrypt and decrypt. As a
result, they require that both parties first exchange keys to communicate.
§ Before you can send a message to another party, you must first talk
securely to exchange keys.
Key Key
Block versus stream ciphers
§ Asymmetric encryption use two keys: Public Key - to encrypt the data
Private Key - to decrypt the data.
§ These keys are generated together.
§ The Private Key is only used for Decryption and will not be shared
between the sender and receiver.
Hash Functions:
§ To ensure that the values of a message have not changed either deliberately or through
transmission error you can append some summary of the information that you can verify
through a repeatable process.
§ A hash is like a checksum but operates so that a forged message will not result in the
same hash as a legitimate message.
§ Hashes are usually a fixed size usually have to be long enough so that creating an
alternative message that matched the hash value would take far too much time.. The result
is a hash value act as a fingerprint for the data.
§ Software publishers often provide hash values so that customers can check the integrity of
the software they receive.
Hash Functions and Digital Signatures
Credit cards have a hash digit that validates the card number. The algorithm
for calculating this digit is the LUHN formula, based on ANSI X4.13. To
calculate whether a credit card number is valid, follow these four steps:
1. From the rightmost digit, which is the check digit, and moving left,
double the value of every second digit.
2. Take the sum of all the digits.
3. If the total modulo 10 is equal to 0 (if the total ends in zero) then the
number is valid according to the Luhn formula; else it is not valid.
Hash Functions and Digital Signatures
Hash Functions and Digital Signatures
Digital Signatures:
§ ensure the integrity of a message and verify who wrote it.
§ Digital signatures require asymmetric key cryptography as shown in Figure
below:
Hash Functions and Digital Signatures
Digital Signatures:
Cryptanalysis and Public Versus Private Keys
You can break almost any cipher, given enough time and resources. However, a
cipher’s main purpose is to make it so difficult to break that it is computationally
infeasible to crack. For example, assume that an organization generates new keys
every week. If an attacker can crack any key in 13 days, the cracked keys would
be useless by the time the attacker tried to use it; it would already have been
superseded by a new key.
Cryptanalysis and Public Versus Private Keys