112 Lesson 2 Cryptography in Cybersecurity Link to digital less www.len.edu.sa Introduction to Cryptography The Importance of Cryptography Cryptography is the science of secret writing with the goal of hiding the meaning of a message. It is the science of keeping information secure and secret through codes, algorithms, and encryption. Cryptography has a long history, evolving from simple substitution ciphers used by ancient civilizations to sophisticated encryption algorithms employed in modern digital communication. The evolution of cryptography throughout history reflects the continuous innovation and adaptation of encryption techniques in response to changing needs and technological advances. At its core, cryptography relies on two fundamental concepts: encryption and decryption. Encryption converts plaintext, readable information, into ciphertext, unreadable information, using a secret key and a specific algorithm. Decryption, conversely, is the process of converting ciphertext back into plaintext. Cryptography remains vital to secure communication and data protection in an increasingly connected world. The following points outline the importance of cryptography: Data Confidentiality Cryptography encrypts sensitive data so only authorized parties with the correct keys can access it, safeguarding personal, financial, and confidential information from unauthorized access. This is essential for sectors such as finance, healthcare, and government agencies. Authentication Cryptography enables the use of digital signatures to verify the authenticity of messages, establishing sender identity and preventing tampering during transmission. Integrity Cryptography helps ensure data integrity, using advanced techniques for verification and change detection. Non-repudiation Cryptographic techniques provide non-repudiation, ensuring parties cannot deny the authenticity of their actions or transactions. This is important int legal, financial, and other settings where maintaining data and transaction integrity is essential. وزارة التعليم Proces Plaintext FORE - U-brix 03 10 позах Secret key phertext Network ic tax Ciphertext Secret key Maintext Figure 3.3: Representation of a typical enervation decryption process 073-1445

Lesson 2 Cryptography in Cybersecurity

Introduction to Cryptography

Applications of Cryptography The applications of cryptography are vast and diverse, playing a critical role in securing communications, protecting sensitive data, and ensuring trust across a wide range of industries and technologies in the digital landscape. Table 3.1 illustrates the most common applications of cryptography. Table 3.1: Common applications of cryptography Application Secure Messaging Email Security Secure Web Browsing E-commerce Security Virtual Private Network Description Cryptography is essential fer securing communication channels between users, ensuring the confidentiality and Integrity of messages. For example, applications like Signal and WhatsApp use end-to-end encryption (EZEE) to protect messages from unauthenzed access er eavesdropping. With EZEL, only the intended recipients can decrypt and read the messages, providing a high level of security and privacy. Cryptographic techniques, such as PGP (Pretty Good Privacy), are instrumental in securing email communications. PGP encrypts both the messages and attachments, ensuring the confidentiality and integrity of the content it allows only the intended recipient to access and decipher the information, providing robust security for email communication Additionally, digital signatures provided by PGP help verify the authenticity of the sender, establishing trust in the email exchange Cryptography, particularly through the use of HTTPS, is essential for securing web browsing sessions. It encrypts the connection between the user's browser and the web server, providing confidentiality and integrity for sensitive data exchanged during the browsing session. Cryptography protects sensitive data in e-commerce. It encrypts Information like credit card detalls, ensuring confidentiality and non- repudiation, It also verifies website authenticity, using methods like Kerberos and Public Key Infrastructure (PKI), for a safe shopping experience. Cryptography, along with the IPsec (Internet Protocol Security) protocol. Is used in VPNs to create secure, encrypted connections between remote devices and a private network. IPsec is a suite of protocols that provides authentication, encryption, and integrity verification for IP communications. With cryptography, IPsec ensures the confidentiality and integrity of the data transmitted over a VPN. Internet of Things Wion) Security With the rapid growth of loT devices, cryptography plays a crucial role in ensuring secure communication and data protection. Lightweight cryptographic techniques encrypt data transmitted between loT devices and backend servers اد التعليم 2073-1445 113

Lesson 2 Cryptography in Cybersecurity

Applications of Cryptography

Application Description Blockchain and Digital Currencies Cryptography is a core component of blockchain technology and digital currencies. It is used to secure transactions, maintain the Integrity of the distributed ledger, and ensure the authenticity of participants. Types of Cryptography Cryptography encompasses a variety of techniques that can be broadly classified into three main types, symmetric key cryptography, asymmetric key cryptography, and hash functions. Each type serves a distinct purpose and has advantages and limitations depending on the specific security requirements and use cases. The following is an introduction to each one of these types: Symmetric Key Cryptography Symmetric key cryptography, or secret key cryptography, uses a single key for encryption and decryption processes and its main operation is substitution and transposition. When a sender wants to transmit encrypted data, they use the shared secret key to encrypt the plaintext, turning it into ciphertext. The recipient, who also possesses the same secret key, then decrypts the ciphertext back into plaintext. The length of the key is very important in symmetric key cryptography. One common symmetric key algorithm is Advanced Encryption Standard (AES). Asymmetric Key Cryptography Asymmetric key cryptography, or public key cryptography, involves using two distinct but mathematically related keys: public and private keys. The public key is openly distributed, while the private key remains confidential to the owner and it is infeasible to find the private key from the public key. For asymmetric key cryptography to work properly, there must be trust in public key providers. When a sender wants to encrypt data, they use the recipient's public key. Upon receiving the encrypted data, the recipient uses their private key to decrypt the message. Conversely, the private key can be used to sign data for authentication purposes, and the public key can verify the signature. Some widely used asymmetric key algorithms include RSA, Diffie-Hellman, and Elliptie Curve Cryptography (ECC). It is important to note Plaintexs Secret key Cipheren Ciphertext Secret key DULIMINA Pontext Figure 3.4 Process of Symmetric Key Ervitography 8.9 Plaintan Pub kay Private key Ciplientext 8.9 Ciphertext Public lay Private key Plaintext that the length of the key in bits directly affects the security Figure 3.5 Process of Asymmetric Key Cryptograptiv Ful of the lencryption, with longer key lengths providing stronger protection against attacks. 2073-1465 114

Lesson 2 Cryptography in Cybersecurity

Blockchain and Digital Currencies

Symmetric Key Cryptography

Asymmetric Key Cryptography

Types of Cryptography

Hash Functions Hash functions are a cryptographic technique that takes variable size input and generates fixed size output. Hash functions are one-way, meaning it is computationally infeasible to reverse-engineer the original input from the hash and any change in the input most likely results in changes in the output. This makes hashing particularly useful for ensuring data integrity and authentication. When data is transmitted or stored, a hash can be generated and sent along with the data. The recipient can then compute a new hash for the received data and compare it with the original hash. The data has not been tampered with or altered if the hashes match. Some popular hashing algorithms include the Secure Hash Algorithm 3 (SHA3) family, and Message- Digest Algorithm 5 (MD5) and the HMAC hash functions. -EXE -x doura Plaintext Hast Hashed tert function Figule 36 Process of Hash function Table 3.2: Advantages and disadvantages of cryptography types Type Symmetric Key Cryptography Asymmetric key Cryptography Advantages Faster and more computationally efficient S Suitable for large-scale data encryption Simplified key distribution (public key sharing) ▸ Enables digital signatures and authentication Disadvantages ■ Key distribubon and management challenges. ▸ Not providing a digital signature, can't guarantee the correctness of user identity. Slower and more computationally Intensive Less suitable for large-scale data Encryption Hashing ■ Fast process • Hard to reverse-engineer Fixed-length output regardless of input size • Vulnerable to collisions in weak algorithms, meaning two different inputs, produce the same output Validation of Public Keys One of the challenges of asymmetric key cryptography is the validation of the public key that is used for the encryption and decryption of a message. In order to verify that a public key does not come from a hacker, the two following methods are used: 21173-1445 115

Lesson 2 Cryptography in Cybersecurity

Hash Functions

Symmetric Key Cryptography

Validation of Public Keys

Ful Webs of trust Webs of trust are a decentralized approach used in cryptography to validate the authenticity of public keys. This concept can be explained through the following example: Suppose Khalid wants to verify the public key of Ahmed. Instead of relying on a centralized authority, Khalid checks the web of trust. She finds that Fahd, a trusted entity on the web, has signed off on Ahmed's public key, affirming its authenticity. Khalid knows and trusts Fahd, so she can now trust that the public key belongs to Ahmed. Furthermore, Khalid notices that other web members have vouched for Ahmed's key, establishing a stronger web of trust. This means that the more users who confirm the validity of a public key, the more trustworthy it becomes within the network. This decentralized approach helps prevent malicious actors from using fake or unauthorized public keys to gain access to encrypted data. By relying on a network of trusted entities, cryptography leverages webs of trust to validate public keys and ensure the security and integrity of communications. Certificate Authorities A Certificate Authority (CA) is a trusted entity that validates public keys in cryptography. It plays a central role in authenticating digital certificates, such as SSL (Secure Sockets Layer) certificates, which establish secure connections between websites and users. For example, when a website wants to obtain an SSL digital certificate, the website owner submits a request to a trusted CA. The CA verifies the owner's identity through various authentication methods, including domain ownership verification. Once the owner's identity and associated public key are verified, the CA issues an SSL digital certificate for the website. This certificate binds the website's identity to its public key, enabling secure communication and encryption between the website and its users. Cryptography Attacks There are numerous methods and techniques that are used by hackers to gain access to data that is encrypted by cryptographic algorithms. The following are two of the most common methods used: Brute Force Attacks Brute force attacks are used in cryptography attacks as an exhaustive trial-and-error method to crack encrypted data. In these attacks, the attacker systematically tries all possible combinations of keys or passwords until the correct one is found. For example, in a brute force attack against an encrypted password, the attacker would attempt different combinations of characters until they discover the correct password that decrypts the data. This method can be time-consuming and resource-intensive, especially if the encryption algorithm employs strong, lengthy keys. The National Institute of Standards and Technology (NIST) recommends a minimum key size of 2048 bits for RSA and 224 bits for Elliptic Curve Cryptography (ECC) to secure against brute force attacks. Cryptanalysis Cryptanalysis analyzes encrypted data to find weaknesses in the encryption scheme that can be exploited for data extraction or manipulation, Hackers use it to access encrypted data, such as passwords, credit card numbers, and confidential documents. Hackers often employ techniques to break encryption schemes, including analytical, brute-force, and side-channel attacks. Analytical attacks involve algorithms to determine the likely keys to encrypt data. Brute-force attacks probe all possible keys until the correct key is found. Side-channel attacks exploit known flaws in hardware or software to bypass security measures. 21173-1445 116

Lesson 2 Cryptography in Cybersecurity

Webs of trust

Certificate Authorities

Cryptography Attacks

Implementing Cryptographic Algorithms You will now implement some cryptographic algorithms with the use of the Python programming language. Caesar Cipher This is a simple substitution cipher where each letter is replaced by another letter based on the key. It is a very simple cryptographic algorithm that is not used in production systems. x Y Z A C DE F A BC D E F G Figure 3.X Repreammmmmf Ces Cphy @ypograpmlgorithm where key = 3 1 Example For example, let's use a right shift of 3 (also known as a key of 3) in our Caesar cipher. Our plaintext (the original message) is HELLO We then shift each letter in "HELLO" three places to the right: HELLO Encryption IJK EFGH LMNO LMNO OPOR HIJK EFGH LMNO LMNO OPQR KHOOR So, in this case, "HELLO" encrypted with a Caesar cipher using a shift of 3 becomes "KHOOR". To decrypt the message, we just do the opposite operation: we shift each letter 3 places to the left (or 23 places to the right, as the effect is the same in a 26 letter alphabet). Decryption HIJK EFGH LMNO LMNO OPQR KHOOR HELLO FGH LMNO EMNO OPQR And we get back our original message, "HELLO". وزارة التعليم 21173-1445 117

Lesson 2 Cryptography in Cybersecurity

Implementing Cryptographic Algorithms

Encrypting the message def caesar_encrypt (message, key); # Create a list of alphabet characters alphabet lower "abcdefghijklmnopoirstdoorye alphabet_upper = "ABCDEFGHI ILMNOPQRSTUVWXYZ" # Create an empty string to store the encrypted message Encrypted message = #Herow through each character the message for char in imessage: # Check if character is a lowercase letter if char in alphabet_Tower: #Find index of the character in alphabet list char_index alphabet lower.find(char) #Move the character to the night by the key new char_index (char_index + key) % 10 #Add the replaced character to the encruited message encrypted message TE alphabet lower [new_char_index] #Check if character is an uppercase letter elif char in alphabet_upper: char_index = else: alphabet upper.find(char) new_char_index (char_index - key) * 28 encrypted message alphabet upper [new char_index] #Add the character to the encrypted message as leis encrypted message = char Return the encrypted message return encrypted message Decrypting the Message def caesar decrypt (encrypted message, key): Create a list of lowercase alphabet characters العليم alphabet lower = "abcdefghimnopqrstuvwxyz Great oligoppercase alphabet charactery alphaber upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" If Create an empty string to store the decrypted message alpted_message 4 173-1445 118

Lesson 2 Cryptography in Cybersecurity

Encrypting the message

Decrypting the Message

Iterate through each character in the encrypted message for char in encrypted message: #Cleck of character is a lowercase letter if char in alphabet lower: find the index of the character in the lowercase alphabet ist cnar index alphabet lower. find(char) # Move the character to the left by the key new_char_index (char_index - key) % 26 = #Aild Nte replaced character to Ne decrypted message decrypted message F= alphabet lower [new_char_index] Check of character is an uppercase letter elif char in alphabet_upper: #Find the index of the character in the uppercase alphabet jist char_index alphabet_upper. find(char) #Move the character to the left by the key new char_index (char_index - key) % 26 * Aild Nre replaced character to Ne decrypted message decrypted message else: alphabet_upper[new_char_index] # the character is not a letter, add it to the decvated message it is decrypted message = char #Resum the decrypted message retor decrypted_message Testing the Cipher #Testing the Caesar spher message = "There are twenty three items in the inventury." key 5 encrypted message decrypted message caesar_encrypt (message, key) caesar_decrypt(encrypted message, key) print(encrypted message) print(decrypted message) wybyd ymwjj nyjrx ns ymj nsajsytwd. There are twenty three items in the inventory. حرارة التعليم 2173-1945 119

Lesson 2 Cryptography in Cybersecurity

# Iterate through each character in the encrypted message

Testing the Cipher

18 L JM N x MN 0 EET 5 L MINO F 口 14 0 ኢሳ M 0 0 0 MAQ P P H T I MIN 0 . R S L N D MNO P च K5 R MMD MN SP QRS TUVWXYZ A MT NO P C 75179 T Vigenère Cipher This is an extension of the Caesar cipher, where each letter is shifted based on a keyword. Like the Caesar cipher, it can encrypt messages but its complexity is inadequate for production systems. ALP FFFFE BBCDETGH COEF DDE FGH EH KIMNARS KIMMOGR MNDFQKS 17 י T M 2 JU KV W X Y The Key ה E F 0 EFGH S Ա A S T K5 T W 7 A V W X 5 2 A B V MI V B U V W X 2 H 517 U W × Y VWX ZA N b GH 18 FG H B x E GTH VW 8 2 A 日 S RS v W Y ZA DE E F FXG W 2. D Έ F 10 The Encrypted Letter U V W × A B CID E H Y Η VWXY 2 The Decrypted Letter M X Z A A B TC E E 0 YZA B E 2 N B Q B C D DE F 14 Π E F G H E H J k X ZA 2 C 0 E ABCDE 13 H 12 A RCDEFSH KLM EMINIO PAR MIN 0 K L MINTO 7 QRS1 I KNP Q T MNOPQR 5 MINT&P ORSTUVW U W A EMNOPQRSTUVWKY Figure 39: Representation of Vigenère Cipher cryptographic algorithm F 6H F GH K 6 H I I MIN 0 T S Example Let's say our plaintext (the original message) is HELLO and we'll use the keyword KEY. First, you align the keyword with your plaintext, repeating the keyword as necessary: So, for our keyword "KEY", the shifts would be K-10, E-4, Y=24. Applying these shifts to each letter in "HELLO" yields: "H" (shifted by 10 places) becomes "R" KAMN L L MINORS L MIND plaintext HELLO ILILL KEYKE keyword Z Ε ^ A A H 8 DE T GH U V W DTV WIX TW பட CDEF DOEFBH L J #M N T L UTW × x W X Y 2 Z A B D 5 t E F EH H MINE P a P S M MNOP R UV TUVW V W W WXY 2 2 A 2 ZABIC D E ABGEF AB C EF وزارة التعليم 11173-1445 120 "E" (shifted by 4 places) becomes "|" ITER DEF E D EG H1 GH L KI M L K WINDR MNO K M NDP LMN பா BS 3' ป v wil Y WWIXIV Z A Σ T ம V.TW X AZ ሰ E MN0Q8STU ww 0 D URST U V W Y 5 CD.

Lesson 2 Cryptography in Cybersecurity

Vigenère Cipher

"L" (shifted by 24 places) becomes "J" MIL 11859 MNOT 12 FE S VW KY 2 U V ww 2 芜 I LMM 00 J K S T A LIMINIOP 口 AL 5. T II ww x V z D 10 H T E Ī GH R MIN MEN OO A PKS T U vw v V WXP 2 AB F C " JM H x MW N о ST % X Z A Y 7 B F H T N L M 0 .. BS K LIMIND P 0 MNOPLA A MNOCKS FIG "L" (shifted by 10 places) becomes "V" TU V W VW 2 Ji B 3 D E VWXY2A9E DA GH V Z EC LI EF 2 IMNO ABCDE FIGH BE B L 10 E Et E F 4TH SEMINO PGR 5 V WIK LM 00 10 S T K LMNOP A F G H L . K E F9 T GH L I MIN MNDIPO B 5 TU IN W UTV TW v Wa × 2 Z JK 8 V 2 L 5 VWX 2 AB " J L 18 " U UW 8 H X I M T U V W X V MNOPQPST UV W X 2 A B F UE Y 4 ZA B [ A B C DIEIF M Z A K MNOPG W x Y N 9. 814 CD E E E GH MNOPQ ST V Y 2 WB C DE F 0 IBICID GH "O" (shifted by 4 places) becomes "S" t ABCDEFGH TYMI IMINO PAR SYD V WIK Y 2 8 I DE EF R MADEP . ST VW 3 K Z 9 G H D G A R L 16 LMNOGR 5 T MNDY 8 WX A 8 U V W B Ħ L M 0 00K S UIV Um X × 2 N E 2 ^ LL C D H # ILIM N OPARS T 0 || QRST VWX S WXY h 9 W A 且 D 드 K MN 0 MN G 81 t A B 고 6 P Q L V 4 C 0 T G H K I W M MOTP G NOV H E G R 5 L M 0 S MNO PIA U V WW 2 W B C W 22 √ LC U V W X V ZABC D E F C " D FGH H UVWX Y 2 VZA So, in this case, "HELLO" encrypted with a Vigenère cipher using the keyword "KEY" becomes "RUVS". To decrypt the message, we perform the reverse operation: shifting each letter in "RIJVS" back by the amount specified by the corresponding letter in the keyword "KEY". Encrypting the message def vigenere encrypt(plaintext, keyword): Calculate the length of the Keywor! keyword gan Len(keyword) Convert each Character in the keyword to its ASCII value keyword as int [ord(i) for i in keyword] pulent each character in the plaintext to its ASCII value 0123-1445 ASCII is an encoding system, which is a standard code for representing all English alphanumeric characters. T21

Lesson 2 Cryptography in Cybersecurity

"L" (shifted by 24 places) becomes "J"

Encrypting the message

plaintext int [ord(i) for i in plaintext] ciphertext if Loop over each character in the plaintext for i in range(lent plaintext_int)}: #Calculate Nte new charracher by adding the ASCII value of the plaintext #chorocter and the commesponding keyword character (modulo 26) value (plaintext int[i] keyword as int[i keyword Length] 26 #Convert the arw character back to a string and append it to the ciphertext #Adding 65: converts the value to its ASC representation is an uppermove letter ciphertext chr(value 65) return ciphertext Decrypting the Message def vigenere decrypt(ciphertext, keyword): #Calculate the length of the keyword keyword length = len(keyword) - #Convert each character in the keyword to its ASCN value keyword_as_int fora(i) for i in keyword] #Convert each character in the ciphertext to ASCN volue ciphertext int fora(i) for i in caphertext] plaintext = # Loop over each character in the aphertext for i in range(Lent ciphertext int )): # Calculate Nte Chijinal character by subtracting the ASEH value of the #corresponding keyword character from the ciphertext viharacter imbulo 251 value = (cichertext_int[1] keyword as int[i % Keyword Length]) % 26 # Convent Nte orignal character back to u string and bend it to the plaintext # Adalg 65 converts the decrypted Value back to its ASCII representation as an uppercase letter plaintext chr(value = 85) return plaintext Testing the Cipher encrypted message = vigenere_encrypt("THERE ARE TWENTY THREE ITEMS IN THE INVENTORY", "4EMON") (encrypted message) decrypted message = vigenere decrypt(encrypted message, "LEMON") print(decrypted message) ELQFREEDSGEAQBGJXFVEPIFWGPQEHVYXFVREMZJRYXAFL THERETARETTWENTYTTHREETITEMST INTTHETINVENTORY وزارة التعليم 2173-1445 122

Lesson 2 Cryptography in Cybersecurity

plaintext_int = [ord(i) for i in plaintext]

Decrypting the Message

Testing the Cipher

The Diffie-Hellman (DH) Key Exchange Algorithm The Diffie-Hellman (DH) Key Exchange Algorithm is a cryptographic protocol for secure communication over an unsecured network. It allows two parties to establish a shared secret key that can be used to encrypt and decrypt messages exchanged between them. User 1 User 1 Private Key: Cambi Kays User 2 Public Key 751A606C 24097009 User 1 and User 2 shared secret Use 1 Public Key 75LA696C ZAD37009 Glambid Kays User 2 Used and tix 2 shared secret User 2 Private Key Figure 3.10 Representation of DH Key Exchange Algorithm Example For simplicity, let's use small numbers as an example. In real life, much larger numbers would be used to provide sufficient security. 1. First, both parties agree on two large prime numbers. For our example, let's use 5 (a primitive root modulo) and 23 (the modulus). These numbers can be public. 2. Next, each party chooses a secret number. Ali chooses 6 and Ahmed chooses 15. These numbers are private and should not be shared. 3. Both parties calculate a public value to share with each other Ali calculates (5 mod 23) which equals 8, and Ahmed calculates (51 mod 23) which equals 19. 4. Ali and Ahmed exchange these public values. 5. Now, each party calculates the shared secret. Ali calculates (19 mod 23) and gets 2, and Ahmed calculates (8¹s mod 23) and also gets 2. All Ahmed Public Keys Private Keys 45 Public values inv0-11 2 11-2 Sp, Ali and Ahmed have now agreed on a shared secret (2 in this case) over an unsecured channel without sending the secret itself. An eavesdropper would need to solve a discrete logarithm problem to figure out the secret, which is computationally difficult and time-consuming, especially .with larger numbers التعليم 21173-1445 123

Lesson 2 Cryptography in Cybersecurity

The Diffie–Hellman (DH) Key Exchange Algorithm

124 Preparing the Algorithm import random import hashlib * Modular exponentiation (base exisoner.modulus def mod exp(base, exponent, modulus): return pow(base, exponent, modulus) W. Generate a large prime number def generate large prime(bits-2848): return random.getrandbits (bits) | 1 # Command to create a prime number Implementing the Key Exchange def di_key_exchange(); p Agree on large prime numbers und g generate_large_prime() g generale large_prime() Each party selects a privately ali private key ahmed_private_key generate large_prime() generate_large_prine() #Each party computes they pubhe key ali_public_keynod exple, ali private_key, p) ahmed_public_key = mod_exp(g, anmed_private_key, p) if Each party exchanges then public key and commutes the stored secret ali_shared_secret = mod_explatimed_public_key, ali private key, p) ahmed_shared_secret = mod exp(ali public key, ahmed_private_key, p) it Veriju Not the shored secrels mich assert ali_shared_secret == atimed_shared_secret if Optionally. Hasil Me shared secret to derive a symmetric key shared_secret_hash hashlib.sha2-a(str(ali shared secret), encode())hexdigest() return shared secret_hash Generating the Secret Shared Key *Profuce the shared secret kev shared_secret = dh_key_exchange() "Smard seclet: ", shared secret) Shared secret: 74b40ad75c4d76edcef424bcb1e27be184c60c22072e0aad55b5a29b60d1ddab وزارة التعليم 173-1445

Lesson 2 Cryptography in Cybersecurity

Preparing the Algorithm

Implementing the Key Exchange

Generating the Secret Shared Key

Cybersecurity, Cryptography and Blockchain In recent years, blockchain technology has gained attention in cybersecurity systems. Blockchain is a decentralized and transparent ledger that securely records transactions. However, it is not immune to vulnerabilities and cyberattacks. One area of concern is smart contracts, which are self-executing contracts written in code and executed on a blockchain For example, imagine a smart contract designed to manage supply chain transactions. If a coding error or vulnerability exists in the smart contract, an attacker could exploit it to manipulate or disrupt the supply chain process. This could lead to fraudulent activities or unauthorized access to sensitive information. A visual explanation of the processes that blockchain technolgies use, is illustrated in figure 3.11. New Data (transaction) block is created The block is broadcast to all the nader in the blockchain network A block is approved the transaction is accepted the new block is added to the chain Figure 3.1.1. Representation of Blockchain technology Blockchain technologies can help in cybersecurity in several ways, including: Identity management Blockchain can create a secure and decentralized identity management system where users can control their data and share it with others as needed. For example, blockchain-based identity systems can store and verify user identities, making it more difficult for attackers to steal or alter user data. Supply chain management Blockchain can create a secure and transparent supply chain management system that records all transactions in a tamper-resistant ledger. For example, blockchain-based supply chain systems can track the movement of goods and ensure that they are not tampered with or counterfeited. Smart contracts Blockchain can create secure and automated smart contracts, which can help reduce the risk of fraud and ensure that transactions are executed as intended. For example, blockchain-based smart contracts can automate payment processing, reducing the risk of payment fraud. Distributed networks Blockchain can create secure and decentralized networks, which can help reduce the risk of single points of failure and ensure that data is distributed across multiple nodes. For example, blockchain-based networks can create more secure and efficient peer-to-peer file-sharing systems. Data storage Blockchain can be used to create secure and decentralized data storage systems, which can help reduce the risk of data breaches and ensure that stored data is tamper-resistant. For example, blockchain-based data storage systems can store sensitive data such as medical records or financial information. 173-1445 125

Lesson 2 Cryptography in Cybersecurity

Cybersecurity, Cryptography and Blockchain

126 Exercises I Read the sentences and tick True or False. 1. Encryption.converts plaintext into readable information. 2. Authentication is used to verify the integrity of messages. 3: Data confidentiality is essential for communications within the finance industry. 4. Cryptography plays a vital role in securing web browsing sessions. 5. VPNs do not use cryptography for secure connections. 6. Symmetric key cryptography is faster and more computationally efficient than asymmetric key cryptography. 7. Hashing is primarily used for data encryption. 8. Cryptanalysis is a technique used by hackers to gain access to encrypted data. 9. A web of trust is made up of users who have agreed to sign off on one another's public keys. 10. A certificate authority issues a digital certificate that binds a public key to an identity. Describe the core principles of cryptography and how it works وزارة التعليم True False

Lesson 2 Cryptography in Cybersecurity

Read the sentences and tick True or False.

Describe the core principles of cryptography and how it works.

3 Outline the various applications of cryptography in the modern digital word. List The three main types of cryptographic algorithms. وزارة التعليم 127

Lesson 2 Cryptography in Cybersecurity

Outline the various applications of cryptography in the modern digital word.

List the three main types of cryptographic algorithms.

5 Design a representation of asymmetric key cryptography. 6 List the advantages and disadvantages of the three main types of cryptographic algorithms. وزارة التعليم 125

Lesson 2 Cryptography in Cybersecurity

Design a representation of asymmetric key cryptography.

List the advantages and disadvantages of the three main types of cryptographic algorithms.

7 Analyze how webs of trust are used to validate public keys in cryptography B Explain how hackers can use cryptanalysis to gain access to encrypted data. وزارة التعليم 129

Lesson 2 Cryptography in Cybersecurity

Analyze how webs of trust are used to validate public keys in cryptography.

Explain how hackers can use cryptanalysis to gain access to encrypted data.