Authentication is the security process of verifying the identity of a user or system to ensure they have the authority to access specific resources.
Common methods include Knowledge-based factors (passwords/PINs), Possession-based factors (SMS codes/email links), and Inherence-based factors (biometrics).
CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) is used to prevent automated bots from submitting forms or brute-forcing logins.
Defensive security also involves Data Encryption, which transforms sensitive information into an unreadable format that can only be decrypted with the correct key.
Beyond user input, defensive design must account for hardware and environmental failures to prevent the software from crashing unexpectedly.
Peripheral Errors occur when external devices (like printers or scanners) fail; the software should provide clear feedback and options to retry or cancel the operation.
Disk Errors include scenarios where a drive is full, a file is corrupted, or a required directory is missing; the program should handle these by offering alternative save locations or recovery options.
Communication Errors involve lost network connections; robust software should implement automatic retries or allow the user to save progress locally until the connection is restored.
Maintainability ensures that code can be easily understood, debugged, and updated by other developers (or the original author) in the future.
Meaningful Variable Names (e.g., instead of ) provide immediate context for what the data represents within the program logic.
Indentation and White Space are used to visually group related blocks of code, making the logical flow and nesting levels (like loops and conditionals) clear.
Comments explain the 'why' behind complex logic, documenting the purpose of specific sections or the reasoning for certain algorithmic choices.
Sub-programs (functions and procedures) break large tasks into smaller, reusable modules, which reduces code duplication and simplifies the testing process.
| Feature | Input Validation | Authentication |
|---|---|---|
| Purpose | Checks if data is sensible/valid | Checks if the user is who they claim to be |
| Timing | Occurs during data entry | Occurs during system access/login |
| Example | Checking if an age is | Checking a password against a database |
Robustness vs. Reliability: Robustness is about handling the unexpected (bad input, crashes), while reliability is about consistent performance of expected functions over time.
Validation vs. Verification: Validation asks 'Are we entering the right type of data?', while verification (often in a broader context) asks 'Is this data correct/truthful?'.
When asked to identify a validation type, look for keywords: 'between' suggests a Range Check, 'must be filled' suggests a Presence Check, and '8 characters' suggests a Length Check.
For maintainability questions, always mention at least three distinct features: comments, indentation, and meaningful variable names to secure full marks.
Remember that validation cannot prove data is correct (e.g., a user can enter a wrong but validly formatted email); it only proves the data is allowable.
In scenario-based questions about system crashes, focus your answer on Error Handling (how the program reacts to the error) rather than just the error itself.