Chpt.4-Cryptographic Concepts
Chpt.4-Cryptographic Concepts
Definition:
Cryptography is the science and art of securing
communication and information through the use of
mathematical techniques and algorithms to transform data
into a form that is unintelligible to unauthorized entities.
1. Encryption is the process of converting, readable data (plaintext) into an unreadable format
(ciphertext) using an algorithm and a key.
The primary purpose of encryption is to secure information by making it difficult for unauthorized
individuals or entities to comprehend the original data without the corresponding decryption key.
1. What is Cryptography? • Basic concepts: Encryption & Decryption
2. Decryption is the process of converting encrypted or ciphertext data back into its original, readable
form, known as plaintext. Decryption requires the use of a specific decryption key, which complements
the key used in the encryption process.
The decryption key allows authorized users to transform the ciphertext back into its original, meaningful
content, restoring the information to its original state.
Decryption Key
2. Cryptographic Keys
Keys are essential components in cryptographic systems, providing a means to control access to the
protected information.
Symmetric cryptography is generally faster and less computationally intensive than its counterpart,
asymmetric cryptography.
Common symmetric key algorithms:
Triple DES (3DES): A more secure variant of DES that applies the
algorithm three times with different keys.
*Challenge:
Key Distribution: One of the challenges in symmetric cryptography is secure key distribution. If two parties want to
communicate securely, they need to share the secret key without it being intercepted by unauthorized entities.
3. Symmetric Key Cryptography - Applications
Data Encryption:
File and Disk Encryption: Symmetric key algorithms are commonly employed to encrypt entire files or disks. Tools like BitLocker (Windows) and FileVault
(macOS) use symmetric key cryptography to protect the contents of hard drives.
Secure Messaging:
Messaging Apps: Some messaging applications use symmetric key cryptography for end-to-end encryption. The same key is used by both the sender and
the recipient to encrypt and decrypt messages.
Payment Transactions:
Point of Sale (POS) Systems: Symmetric key cryptography is used to secure payment transactions in POS systems. The same key encrypts the transaction
data during transmission and decrypts it on the receiving end.
Smart Cards:
Credit Cards and Access Cards: Smart cards often use symmetric key cryptography to secure transactions. The card and the card reader share the same
key for encryption and decryption.
3. Asymmetric Key Cryptography
Asymmetric cryptography, also known as public key cryptography, is a cryptographic approach that uses
a pair of mathematically related keys for secure communication: a public key and a private key. Each key
performs a specific function—data encrypted with one key can only be decrypted by the other key in the
pair.
*Challenge:
Computationally Intensive: Asymmetric cryptography addresses some of the challenges of key distribution faced by
symmetric cryptography. However, it is computationally more intensive, and for this reason, it is often used in
combination with symmetric cryptography in hybrid systems that leverage the strengths of both approaches..
3. Asymmetric Key Cryptography - Applications
Email Encryption (PGP/GPG):
Pretty Good Privacy (PGP) and its open-source counterpart, GnuPG (GPG), employ asymmetric key cryptography for securing email communications. Users
have a pair of keys (public and private), and the public key can be shared to receive encrypted emails, while the private key is kept secret for decrypting
received messages.
Code Signing:
Developers use digital signatures based on asymmetric keys to sign their software or code. This ensures that the code has not been altered or tampered
with during distribution.
4. Hashing
Hashing is a process in cryptography where a mathematical function, called a hash function, takes input
data (often of variable size) and produces a fixed-size string of characters, which is typically a hash value or
hash code. The output, known as the hash, is a unique representation of the input data.
Important properties:
Deterministic: The same input will always produce the same hash
value.
Fixed Output Size: Regardless of the input size, the hash function
produces a fixed-size output.
Digital Signatures:
Digital signatures often involve the use of hash functions. A hash of the data is created, and the hash value is then encrypted with
the sender's private key. The recipient can verify the signature using the sender's public key.
File Deduplication:
Hashing is employed to identify duplicate files efficiently. By comparing hash values of files, systems can quickly determine if a file
already exists and avoid storing redundant copies.
Fingerprint Verification:
Biometric systems often use hash functions to represent and compare fingerprints. The unique features of a fingerprint are
transformed into a hash, allowing for efficient and secure matching.
Email Security: Verifying the sender's identity and ensuring the integrity
of email content.
The process of obtaining a digital certificate typically involves the following steps:
Request:
The certificate holder generates a key pair (public key and private key) and sends a certificate request to the
CA.
Verification:
The CA verifies the identity of the certificate requester through various means, such as physical documents,
legal agreements, or other authentication processes.
Issuance:
If the verification is successful, the CA issues a digital certificate, associating the public key with the verified
identity.
Distribution:
The digital certificate is distributed to the certificate holder, who can then use it to prove their identity in
digital communications.
Digital Signature Vs Digital Certificate
Features Digital Signature Digital Certificate
It is similar to a fingerprint or an attachment to a digital It is a file that verifies the identity of the holder and offers
Definition
document that verifies its validity and integrity. security.
Security It offers non-repudiation, authentication, and integrity. It offers security and authentication.
Wireless Communication:
Stream ciphers are commonly used in wireless communication protocols, such as Wi-Fi (WEP, WPA, WPA2). They enable the secure
transmission of data between devices, ensuring privacy and preventing unauthorized access to the communication channel.
Bluetooth Communication:
Bluetooth technology employs stream ciphers for securing the communication between devices. This is crucial for maintaining the privacy
and integrity of data exchanged between devices like smartphones, headphones, and other Bluetooth-enabled devices.
Satellite Communication:
Stream ciphers are employed in the secure communication of satellites. This ensures that data transmitted between ground stations and
satellites remains confidential and cannot be easily intercepted or tampered with.
Database Encryption:
Block ciphers are utilized for encrypting sensitive data stored in databases. Database encryption helps protect sensitive information,
ensuring that even if unauthorized access occurs, the data remains confidential.
It is essential to distinguish encoding from encryption, as encoding is not intended to provide security or
confidentiality; rather, it focuses on representing data in a different format.
9. Encoding and Decoding
Decoding in cryptography refers to the process of reversing the encoding or transformation of data back to
its original form. While encoding involves transforming data into a different representation, decoding is the
process of reverting that transformed data back to its original state.
Decoding
• Base64 Encoding:
•Description: Base64 is a widely used encoding scheme that represents binary data in an ASCII string format
using a set of 64 characters (A-Z, a-z, 0-9, '+' and '/').
•Example:
•Original Binary Data: 01001000 01000101 01001100 01001100 01001111
•Base64 Encoded String: SGVsbG8=
• Secure Communication
• SSL/TLS protocols
• Data Encryption
• File encryption, disk encryption
• Digital Signatures
• Authenticating messages and documents
• Virtual Private Networks (VPNs)
• Secure data transmission over networks
• Steganography
11. Steganography
Steganography is the practice of concealing information within other non-secret data in a way that does not
raise suspicion. Unlike cryptography, which focuses on making the content of a message unintelligible,
steganography aims to hide the existence of the message itself.
In cybersecurity, steganography is used to covertly embed data within various types of digital media, such as images, audio
files, video files, or even text.
Types of Steganography:
•Image Steganography: Embedding data within digital images.
•Audio Steganography: Concealing information within audio files.
•Video Steganography: Hiding data within video files.
•Text Steganography: Concealing information within text documents.
Applications:
•Covert Communication: Steganography can be used to hide communication between parties, without drawing attention.
•Digital Watermarking: Embedding information within digital media to verify authenticity or ownership.
•Concealing Malware: Cyber attackers may use steganography to hide malicious code within harmless files to evade detection.
11. Steganography
12. Practical – THM Lab