Cryptography
Content
Introduction to Cryptography
Key Cryptographic Concepts
Symmetric vs. Asymmetric Encryption
Overview of hashing functions and applications
Difference between encryption and hashing
Ciphers
Practical: Exercise on Basic Encryption and Decryption
Introduction to Cryptography
Cryptography is the practice of using mathematics and computers to create
secure communication by hiding the contents of messages from third
parties. The science of breaking encrypted messages is called cryptanalysis.
Cryptography is also the practice and study of techniques for securing
communication and information from adversaries. It ensures confidentiality,
integrity, authenticity, and non-repudiation of data.
Key Cryptographic Concepts
Encryption: Encryption is a method of protecting data by scrambling it into a
secret code that can only be unlocked with a unique digital key. The original
representation of the information is called plaintext, while the encrypted form
is called ciphertext
Decryption: Decryption is the process of converting encrypted data into a
readable format. It's the opposite of encryption, which is the process of
converting readable data into an encrypted format. It is also the process of
converting an encrypted message back to its original (readable) format
Symmetric Encryption
Symmetric encryption is a type of cryptography that uses the same key to
encrypt and decrypt data. It's also known as "private key" encryption because
the key must be kept private. Symmetric encryption is often used for high-
volume data processing because it's faster and more efficient than other
types of encryption. it is also ideal for real-time applications like video
streaming and secure communications
Asymmetric Encryption
Asymmetric encryption is a method of encrypting and decrypting data using
two keys, a public key and a private key. It's also known as public key
cryptography. Asymmetric encryption is different from symmetric encryption,
which uses a single secret key to both encrypt and decrypt information.
Differences between symmetric and
asymmetric Encryption
Symmetric Encryption:
Uses the same key for both encryption and decryption.
Faster and simpler, but key management can be challenging.
Examples: AES (Advanced Encryption Standard), DES (Data Encryption
Standard).
Asymmetric Encryption:
Uses a pair of keys: a public key for encryption and a private key for decryption.
Ensures secure communication even if the encryption key (public key) is shared
openly.
Examples: RSA (Rivest-Shamir-Adleman), ECC (Elliptic Curve Cryptography).
Hash Functions
A hash function is a mathematical algorithm that converts a variable number
of characters into a fixed number of characters. The fixed number of
characters is called a hash value or hash.
Characteristics and Applications of a good
hash function
Characteristics
i. Same input always produces the same output.
ii. Quick to calculate the hash value.
iii. Impossible to retrieve the original data from the hash.
iv. No two different inputs should produce the same hash.
Applications
i. Password Storage
ii. Verifying data integrity
iii. Digital signatures
Difference Between Encryption and
Hashing
Encryption and hashing are both techniques used in cryptography, but they serve
different purposes. Encryption is a reversible process designed to protect the
confidentiality of data by converting plaintext into ciphertext using an encryption
algorithm and a key.
hashing is a one-way process that takes an input (or message) and generates a
fixed-length output, known as a hash or digest. Unlike encryption, hashing is
irreversible here is no way to retrieve the original data from the hash.
Ciphers
Ciphers, also called encryption algorithms, are systems for encrypting and
decrypting data. A cipher converts the original message, called plaintext, into
ciphertext using a key to determine how it is done.
Types of Ciphers
Transposition cipher
Caesar cipher
Substitution cipher
Affine cipher
Hill cipher
Personal research : find the meaning of these types of ciphers and how they work
Practical: Exercise on Basic Encryption
and Decryption
Objective:
Understand encryption and decryption through simple ciphers like the Caesar
Cipher.
Exercise: Caesar Cipher
1. Encryption:
1. Shift each letter of the plain text by a fixed number of positions in the alphabet.
2. Example:
1. Plain Text: HELLO
2. Key: 3
3. Ciphertext: KHOOR
Decryption:
• Reverse the shift to retrieve the original text.
• Example:
• Ciphertext: KHOOR
• Key: 3
• Plain Text: HELLO
Conclusion
In conclusion, cryptography forms the backbone of modern cybersecurity,
ensuring the confidentiality, integrity, and authenticity of data. Encryption,
whether symmetric or asymmetric, protects sensitive information by making it
unreadable to unauthorized parties, while hashing verifies data integrity
through irreversible transformations.