Cyber Safety and Security: Information Security and Cyber Law with Worked Examples
Learn information security as an applied subject. Classify security failures, work Caesar and RSA examples, separate common attacks, and revise India's cyber-law framework.
KnowledgeGate Team
Exam prep & CS education

Students often treat cyber safety and security as a theory chapter, memorising the CIA triad and a list of attacks. They lose marks when a question asks them to apply those ideas, decrypt a value, or classify an attack. A security objective becomes useful only when you can map an incident to it and trace the relevant control or calculation.
The CIA triad and security services
The three core goals are:
Confidentiality means only authorised parties can read the data.
Integrity means data cannot be changed undetectably in transit or storage.
Availability means the system and its data remain usable when needed.
The supporting services are Authentication, proving an identity, and Non-repudiation, evidence that prevents a sender from later denying a message or transaction.
Classify each incident by its primary failure:
Incident | Violated service |
|---|---|
An attacker reads credit-card numbers from unencrypted Wi-Fi traffic | Confidentiality |
A man-in-the-middle changes a transfer amount from 500 to 5000 | Integrity |
A botnet floods a bank site until it stops responding | Availability |
Someone uses a stolen password to impersonate an account owner | Authentication |
A user denies placing an order, and no signed proof exists | Non-repudiation |
Encryption protects confidentiality, not integrity by itself. An attacker can alter ciphertext without reading it. Use a hash or message authentication code (MAC) to detect modification.
Symmetric and asymmetric cryptography with a Caesar cipher
Feature | Symmetric cryptography | Asymmetric cryptography |
|---|---|---|
Keys | One shared secret key | Public and private key pair |
Speed | Faster | Slower |
Main challenge | Sharing the secret key safely | More computation |
Examples | AES, DES | RSA |
Symmetric encryption is fast but needs safe secret sharing. Asymmetric cryptography pairs a shareable public key with a private key. Diffie-Hellman is a key-agreement method: it establishes a shared secret but does not itself encrypt the message.
Now encrypt HELLO with a Caesar key of 3. Use A=0 through Z=25 and the formula C = (P + 3) mod 26:
H(7) becomes K(10), because
(7 + 3) mod 26 = 10.E(4) becomes H(7), because
(4 + 3) mod 26 = 7.L(11) becomes O(14). The second L follows the same step.
O(14) becomes R(17).
The ciphertext is KHOOR. To decrypt, use P = (C - 3) mod 26, which maps K, H, O, O, R back to H, E, L, L, O. Wrap-around also matters: Z is 25, so (25 + 3) mod 26 = 2, which is C.
Caesar has only 25 usable shifts, so brute force breaks it immediately. It is a teaching cipher, not a secure design.

RSA public-key cryptography worked end to end
Use tiny primes so every RSA step can be checked by hand:
Choose
p = 3andq = 11. Thenn = p x q = 3 x 11 = 33.Compute
phi(n) = (p - 1)(q - 1) = 2 x 10 = 20.Choose
e = 7. It is valid becausegcd(7, 20) = 1.Find
dsuch that(d x e) mod 20 = 1. Withd = 3,3 x 7 = 21, and21 mod 20 = 1.The public key is
(7, 33). The private key is(3, 33).
Encrypt message M = 2 with the public key:
C = M^e mod n = 2^7 mod 33 = 128 mod 33 = 128 - 99 = 29.
Now decrypt C = 29 with the private key. First, 29^2 = 841, and 841 mod 33 = 841 - 825 = 16. Then multiply once more: 16 x 29 = 464, and 464 mod 33 = 464 - 462 = 2. The recovered message is 2, so the round trip is correct.
For confidentiality, senders use the receiver's public key, and only the private key decrypts. For digital signatures, the signer uses a private key and others verify with the public key.

Attacks, malware, and classification
A passive attack observes without changing the system, as in eavesdropping or traffic analysis. Prevention matters because detection is difficult. An active attack changes data or operation, as in replay, masquerade, and denial-of-service, so detection and recovery matter.
Keep the malware terms separate:
A virus attaches to a host file and normally needs a user to run it.
A worm self-replicates and spreads across networks without that action.
A Trojan is disguised as a legitimate program.
Ransomware encrypts files and demands payment.
Spyware secretly collects data.
Virus versus worm is the classic distractor: a worm spreads on its own. Phishing targets credentials, threatening authentication or confidentiality. DoS and DDoS target availability. SQL injection can expose or alter data, affecting confidentiality and integrity. A man-in-the-middle can read traffic, alter it, or both. Practical cyber safety is layered: use unique passphrases and multi-factor authentication, install updates, verify links, limit privileges, and keep tested backups.
Firewalls, IDS, and secure protocols
Suppose a firewall evaluates rules from top to bottom and stops at the first match:
ALLOW TCP traffic to port 443.
ALLOW TCP traffic to port 22 from the internal subnet only.
DENY ALL.
An inbound packet for port 80 matches no allow rule, reaches DENY ALL, and is dropped. A packet for port 443 matches Rule 1. This default-deny policy blocks traffic unless a rule permits it, making it safer than default-allow.
An IDS detects and alerts. An IPS sits inline, detects, and can block. HTTPS uses TLS to secure web traffic, commonly on port 443. TLS replaced SSL for modern secure web traffic. IPSec protects the network layer and is used for VPNs. Use Computer Networks MCQs for broader protocol and packet-flow practice.
Cyber law in India and the IT Act frame
Cyber law gives legal recognition to electronic records and digital signatures, and defines cyber offences and penalties. India's anchor statute is the Information Technology Act, 2000, with later amendments.
Its framework covers unauthorised access, data theft, identity theft, electronic publication of obscene material, and tampering with computer source documents. It gives digital signatures legal validity and sets procedures for adjudication and appeal.
Do not trust viral section-to-penalty tables because amendments can make them outdated. The official MeitY website provides the IT Act text that specifies each section, definition, and penalty. Check the amended text whenever a question depends on such details.
How exams test cyber security
GATE CS usually uses short applied questions connected to computer networks: classify a failure, trace a simple cipher, or identify a defence. UGC-NET Paper 2 Computer Science treats security and cyber law as a named area, with direct MCQs on cryptography, services, attacks, and legal concepts.
Watch these recurring traps:
Encryption alone does not provide integrity. Use a hash or MAC.
The receiver's public key encrypts for confidentiality. A private key signs.
A worm spreads without the user action normally associated with a virus.
An IDS alerts, while an IPS can block inline.
Cyber-law details must come from the current official statute, not an old chart.
Practise both numeric cryptography and one-line classification questions. KnowledgeGate currently has over 40 questions under Cyber Safety and Security, and the Information Security and Cyber Laws learning path organises the wider unit.
The short version and your next step
The CIA triad, authentication, and non-repudiation form the classification frame. Symmetric cryptography is fast but requires a shared secret; asymmetric cryptography uses a public and private key pair. In RSA, M^e mod n encrypts and C^d mod n recovers the message. Default-deny firewalls, TLS, and IPSec are standard defences. Verify specific cyber-law provisions in the amended IT Act text.
For the full GATE CS build-up, use GATE Guidance by Sanchit Sir. For the UGC-NET unit where security and cyber law are named syllabus areas, continue with NTA-UGC-NET Paper 2. For an additional address-calculation drill, use the subnetting and IP addressing practice set.
Keep learning

Internet & Web Technology for GATE: Syllabus Boundary, Weightage Method and Prep Order
Treat Internet and Web Technology as an overlap area, not a promised standalone subject. Build scope, paper-audit, URL-tracing and subnetting skills in a 12-session plan.
How to Use Practice Exams and Past Papers with Spaced Repetition
Turn practice exams and past papers into a spaced revision system. Learn how to analyse mistakes, schedule reattempts, and fit mocks into a weekly study plan.

Information Security & Cyber Laws for GATE: Syllabus Scope, Weightage Reality and Prep Order
Check where security concepts overlap with GATE CS, where Cyber Laws sits outside the cited syllabus, and how to protect core preparation while serving a second target.

Security in Mobile and Wireless Computing: Threats, Controls and a Worked Replay-Attack Example
Learn where wireless, device, application and identity controls apply, then trace exactly how a server detects message tampering and rejects a replay.