Unit 1: Introduction and mathematics of cryptography - Subjective Questions
CSE403 — Network Security And Cryptography • Practice Questions with Detailed Answers
20 questions
Explain the major security goals of cryptography and discuss how confidentiality, integrity, authentication, and non-repudiation protect information.
Cryptography provides several important security goals:
- Confidentiality: Ensures that only authorized users can access or read information. Encryption converts plaintext into unreadable ciphertext.
- Integrity: Ensures that data is not modified, deleted, or corrupted without detection. Hash functions and message authentication codes help provide integrity.
- Authentication: Verifies the identity of a communicating entity or confirms the origin of a message.
- Non-repudiation: Prevents a sender from denying that they sent a message or performed an action. Digital signatures are commonly used for this purpose.
- Availability: Ensures that authorized users can access systems and information when required. Although cryptography alone cannot guarantee availability, it supports secure access control and protection against certain attacks.
Together, these goals form the foundation of secure communication and information systems.
Define cryptographic attacks and explain the difference between passive and active attacks with suitable examples.
A cryptographic attack is an attempt to discover secret information, alter protected data, or bypass the security provided by a cryptographic system.
- Passive attack: The attacker observes communication without modifying it. The main objective is to obtain information.
- Example: Eavesdropping on encrypted network traffic.
- Example: Traffic analysis based on message timing and volume.
- Active attack: The attacker modifies, injects, deletes, or blocks information.
- Example: Modifying a message during transmission.
- Example: Replaying a previously captured authenticated message.
- Example: Impersonating a legitimate user.
Passive attacks mainly threaten confidentiality, whereas active attacks threaten integrity, authentication, and availability. Encryption, authentication codes, digital signatures, timestamps, and sequence numbers can reduce these risks.
Describe cryptographic services and mechanisms. How do cryptographic mechanisms support the security services provided by a network?
Cryptographic services are security functions supplied to protect communication and data. Common services include:
- Confidentiality service: Protects information from unauthorized disclosure.
- Integrity service: Detects unauthorized modification.
- Authentication service: Confirms the identity of users, devices, or message sources.
- Non-repudiation service: Provides evidence of message origin or an approved transaction.
- Access control service: Restricts resource usage to authorized entities.
Security mechanisms are techniques used to implement these services:
- Encryption provides confidentiality.
- Hash functions and message authentication codes provide integrity.
- Digital signatures provide authentication and non-repudiation.
- Key exchange protocols establish shared secret keys.
- Certificates bind public keys to verified identities.
A single mechanism may support more than one service. For example, a digital signature can provide message integrity, source authentication, and non-repudiation.
Explain modular arithmetic and solve the congruence .
Modular arithmetic deals with remainders after integer division. The notation means that divides .
To solve:
First reduce modulo :
Therefore:
The multiplicative inverse of modulo is , because:
Multiplying both sides by gives:
Hence, the solution is:
All integer solutions are of the form , where is an integer.
State and explain the Extended Euclidean Algorithm. Use it to find the multiplicative inverse of modulo .
The Extended Euclidean Algorithm computes integers and such that:
For and :
Thus, , so the inverse exists. Back-substitute:
Therefore:
The inverse of modulo is .
Verification:
Hence, .
Derive the conditions under which a number has a multiplicative inverse modulo . Explain the role of the greatest common divisor.
An integer has a multiplicative inverse modulo if there exists an integer such that:
The necessary and sufficient condition is:
Reason: By Bezout's identity, if , there exist integers and such that:
Taking the equation modulo gives:
Thus, is the multiplicative inverse of modulo .
If , then every product has a common factor with and cannot be congruent to modulo . Therefore, no inverse exists.
For example, has an inverse modulo because . However, has no inverse modulo because .
Classify attacks in wireless ad hoc networks and explain why the absence of fixed infrastructure increases security challenges.
Attacks in wireless ad hoc networks can be classified according to their behavior and the layer they target:
- Passive attacks: The attacker listens to communication or analyzes traffic without changing packets.
- Active attacks: The attacker modifies, injects, drops, or reroutes packets.
- External attacks: The attacker is not a legitimate network participant.
- Internal attacks: A compromised legitimate node performs malicious actions.
- Layer-based attacks: Attacks may target the physical, MAC, network, transport, or application layer.
Wireless ad hoc networks face additional challenges because:
- Nodes communicate over an open broadcast medium.
- There is no central authority to authenticate every node.
- Nodes may move frequently and change network topology.
- Battery and bandwidth resources are limited.
- A malicious node can participate in routing and mislead other nodes.
- Multi-hop communication makes nodes dependent on one another.
These characteristics make key management, intrusion detection, trust establishment, and secure routing more difficult than in many fixed networks.
Describe attacks at the physical layer in wireless ad hoc networks. Explain jamming, eavesdropping, and tampering, along with suitable countermeasures.
Physical-layer attacks exploit the radio channel, hardware, or physical accessibility of network devices.
- Jamming: An attacker transmits interference to prevent legitimate nodes from communicating. It can cause packet loss, denial of service, and excessive energy consumption.
- Eavesdropping: An attacker listens to wireless transmissions to obtain sensitive information.
- Tampering: An attacker physically accesses a device and modifies its hardware, software, or stored keys.
- Signal interception and analysis: The attacker studies signal strength, timing, or frequency to infer information about network activity.
Countermeasures include:
- Spread-spectrum or frequency-hopping communication.
- Transmission power control and channel switching.
- Strong encryption to protect confidentiality against eavesdropping.
- Tamper-resistant hardware and secure key storage.
- Physical protection and secure deployment of nodes.
- Detection systems that identify unusual interference or signal behavior.
Physical-layer security is important because higher-layer protocols cannot fully protect a device that has been physically compromised.
Explain important attacks at the MAC layer of wireless ad hoc networks and discuss their effects on network performance.
The MAC layer controls access to the shared wireless medium. Common attacks include:
- Collision attack: A malicious node intentionally transmits during another node's transmission, causing frame corruption.
- Backoff manipulation: A node uses an unfairly small backoff interval to gain excessive access to the channel.
- MAC spoofing: An attacker changes its hardware address to impersonate another node.
- Selfish behavior: A node refuses to forward traffic or does not follow channel access rules.
- Denial-of-service attack: The attacker continuously occupies the channel or sends large numbers of control frames.
- Replay of control frames: Previously captured frames are retransmitted to confuse neighbors or disrupt communication.
These attacks can result in increased collisions, reduced throughput, packet loss, unfair bandwidth allocation, and higher energy consumption. Countermeasures include authenticated control frames, rate limitation, monitoring node behavior, anomaly detection, and secure address management.
Compare blackhole, grayhole, and wormhole attacks at the network layer in wireless ad hoc networks.
The three attacks manipulate network-layer routing behavior in different ways:
- Blackhole attack: A malicious node falsely claims to have the best route to a destination. After receiving packets, it drops all or most of them instead of forwarding them.
- Grayhole attack: A malicious node selectively drops packets. It may forward some packets and discard others, making detection more difficult.
- Wormhole attack: Two colluding malicious nodes create a private tunnel between distant locations. They capture packets at one point and replay them at another point, making the route appear shorter or more attractive.
Comparison:
- Blackhole attacks usually cause continuous packet dropping.
- Grayhole attacks cause selective and intermittent packet loss.
- Wormhole attacks mainly distort the perceived network topology and can affect routing decisions even when packets are not directly dropped.
Possible defenses include route confirmation, multipath routing, trust evaluation, packet-forwarding monitoring, geographic or temporal checks, and authenticated routing protocols.
Explain network-layer attacks such as rushing, sinkhole, Sybil, and routing-table poisoning attacks.
Network-layer attacks target routing discovery, route maintenance, or node identity.
- Rushing attack: The attacker forwards route-request packets unusually quickly so that legitimate duplicate requests are suppressed. This increases the chance that routes through the attacker will be selected.
- Sinkhole attack: A malicious node advertises an attractive route and draws a large amount of traffic through itself. It may then analyze, alter, or drop packets.
- Sybil attack: One physical node presents multiple false identities. This can disrupt routing, voting, trust systems, or location-based decisions.
- Routing-table poisoning: The attacker inserts false, outdated, or misleading routing information into network nodes.
These attacks can cause traffic diversion, packet loss, network partitioning, surveillance, and reduced availability. Defenses include authenticated route messages, identity certificates, route diversity, neighbor monitoring, consistency checking, and trust-based route selection.
Discuss attacks at the transport layer in wireless ad hoc networks and explain the effects of SYN flooding, session hijacking, and desynchronization.
Transport-layer attacks target connection establishment, session state, and end-to-end communication.
- SYN flooding: The attacker sends many connection requests but does not complete the handshakes. The victim maintains numerous half-open connections and may exhaust memory or connection resources.
- Session hijacking: The attacker takes control of an established session by stealing or predicting session identifiers, authentication tokens, or sequence information.
- Desynchronization attack: The attacker injects forged packets with incorrect sequence or acknowledgment values, causing the communicating endpoints to lose synchronization.
- Flooding attacks: Excessive transport packets consume bandwidth, energy, and processing capacity.
Countermeasures include stateless connection techniques, client puzzles, authentication of transport messages, encrypted sessions, secure random session identifiers, sequence-number validation, rate limiting, and timeout management.
Explain application-layer attacks relevant to wireless ad hoc networks and identify appropriate security measures.
Application-layer attacks exploit weaknesses in software, data processing, user input, or application protocols. Examples include:
- Malware and malicious code: Compromises nodes and uses them to attack other devices.
- Injection attacks: Untrusted input is interpreted as commands or queries.
- Message forgery: False application messages are generated to mislead users or control systems.
- Denial-of-service: An application is overloaded with requests or malformed data.
- Data modification: Application content is changed while passing through compromised nodes.
- Privacy attacks: Sensitive user, location, or behavioral information is collected.
Security measures include end-to-end encryption, digital signatures, input validation, secure coding, access control, application-level authentication, authorization, logging, patch management, and intrusion detection. Security must be implemented at the application layer because lower-layer encryption does not prevent malicious or vulnerable application behavior.
Describe common attacks on Vehicular Ad Hoc Networks (VANETs) and explain why VANETs require specialized security mechanisms.
Common VANET attacks include:
- False information attack: A vehicle broadcasts incorrect traffic, accident, or road-condition information.
- Sybil attack: One vehicle uses multiple identities to create a false impression of traffic congestion or multiple vehicles.
- Blackhole or grayhole attack: A vehicle attracts and drops all or selected messages.
- Wormhole attack: Colluding vehicles tunnel messages between distant locations.
- Denial-of-service attack: Communication channels or roadside services are overwhelmed.
- Location and privacy attacks: An adversary tracks vehicles or links messages to a driver.
- Message replay: Old safety messages are retransmitted to create a false current event.
VANETs require specialized mechanisms because vehicles move rapidly, connections are short-lived, decisions may be safety-critical, and messages often require location and time validation. Suitable measures include certificates, pseudonymous authentication, digital signatures, timestamping, revocation, misbehavior detection, and privacy-preserving identity management.
Explain the structure and operation of a traditional symmetric-key cipher. What are its main advantages and limitations?
A symmetric-key cipher uses the same secret key, or closely related shared secret keys, for encryption and decryption.
The basic process is:
where is plaintext, is the secret key, and is ciphertext. Decryption is performed as:
A secure cipher should make the ciphertext appear random to an attacker who does not know .
Advantages:
- Fast encryption and decryption.
- Efficient for large volumes of data.
- Relatively low computational and storage requirements.
- Suitable for real-time communication.
Limitations:
- Secret keys must be distributed securely.
- A separate key may be needed for each communicating pair.
- Large networks create key-management difficulties.
- It does not inherently provide non-repudiation because both parties possess the same key.
Examples include block ciphers and stream ciphers.
Compare substitution ciphers and transposition ciphers. Explain their principles, strengths, weaknesses, and examples.
Substitution cipher:
- Replaces each plaintext symbol with another symbol.
- The positions of symbols remain unchanged.
- Example: In a Caesar cipher, each letter is shifted by a fixed number of positions.
- It changes the symbol frequencies but may preserve statistical patterns.
- Weak substitution systems are vulnerable to frequency analysis.
Transposition cipher:
- Rearranges the positions of plaintext symbols according to a key or rule.
- The symbols themselves remain unchanged.
- Examples include rail-fence and columnar transposition ciphers.
- It preserves letter frequencies but changes their order.
- It may be attacked using anagramming and pattern analysis.
Comparison:
- Substitution changes what symbols are used.
- Transposition changes where symbols appear.
- Modern ciphers often combine both operations to achieve confusion and diffusion.
- Neither simple substitution nor simple transposition is secure by itself against modern cryptanalysis.
Explain cryptanalysis and distinguish between ciphertext-only, known-plaintext, chosen-plaintext, and chosen-ciphertext attacks.
Cryptanalysis is the study of methods used to recover plaintext, secret keys, or useful information from a cryptographic system without authorized access to the key.
- Ciphertext-only attack: The attacker has only one or more ciphertexts and attempts to infer plaintext or the key.
- Known-plaintext attack: The attacker knows one or more plaintext-ciphertext pairs and uses them to discover the key or exploit the algorithm.
- Chosen-plaintext attack: The attacker can select plaintexts and obtain their corresponding ciphertexts from an encryption device or service.
- Chosen-ciphertext attack: The attacker can select ciphertexts and obtain their decrypted plaintexts, often through a decryption oracle.
These attacks differ according to the information and capabilities available to the attacker. A modern cryptosystem should remain secure under realistic attack models, especially chosen-plaintext and chosen-ciphertext conditions where applicable.
Using a Caesar substitution cipher with key , encrypt the plaintext "NETWORK" and explain why the cipher is insecure.
In a Caesar cipher, each letter is shifted by positions. For :
Therefore:
The cipher is insecure because:
- It has only 26 possible keys, or 25 meaningful nonzero shifts.
- An attacker can try every possible shift through brute force.
- Letter-frequency patterns remain recognizable.
- Repeated plaintext letters produce repeated ciphertext letters.
Thus, the Caesar cipher is useful for demonstrating substitution but is unsuitable for protecting real confidential information.
Describe the security principles of confusion and diffusion. Explain how substitution and transposition contribute to these principles.
Confusion hides the relationship between the key and the ciphertext. It makes it difficult for an attacker to determine how changes in the key affect the ciphertext.
- Substitution contributes mainly to confusion by replacing plaintext symbols with complex transformations.
- A strong substitution operation makes the relationship between input, key, and output difficult to analyze.
Diffusion spreads the influence of each plaintext symbol over many ciphertext symbols. It reduces visible statistical patterns in the plaintext.
- Transposition contributes mainly to diffusion by rearranging symbols.
- Repeated rounds spread the effect of individual plaintext symbols throughout the ciphertext.
Modern symmetric ciphers combine substitution and transposition-like operations in several rounds. The goal is to produce the avalanche effect, in which changing one plaintext bit or key bit changes many ciphertext bits.
Derive the encryption and decryption equations for an affine substitution cipher and explain the conditions required for a valid key.
In an affine cipher, each letter is represented by a number in the range to . Encryption is defined as:
where is the plaintext value, is the ciphertext value, and and are key parameters.
To decrypt, subtract :
Then multiply by the modular inverse of :
Therefore, the decryption equation is:
The condition for a valid key is:
This ensures that exists modulo . For the English alphabet, , so must be relatively prime to . The parameter may be any value from to .
Explain the major security goals of cryptography and discuss how confidentiality, integrity, authentication, and non-repudiation protect information.
Cryptography provides several important security goals:
- Confidentiality: Ensures that only authorized users can access or read information. Encryption converts plaintext into unreadable ciphertext.
- Integrity: Ensures that data is not modified, deleted, or corrupted without detection. Hash functions and message authentication codes help provide integrity.
- Authentication: Verifies the identity of a communicating entity or confirms the origin of a message.
- Non-repudiation: Prevents a sender from denying that they sent a message or performed an action. Digital signatures are commonly used for this purpose.
- Availability: Ensures that authorized users can access systems and information when required. Although cryptography alone cannot guarantee availability, it supports secure access control and protection against certain attacks.
Together, these goals form the foundation of secure communication and information systems.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →