Computer Knowledge ยท General Awareness

Information Security

4,634 Questions

Information security involves protecting computer systems and data from unauthorized access, cyber threats, and damage. It is a core part of the computer knowledge section in various banking and government exams. Practicing these concepts helps in understanding digital signatures, network security, and access control effectively.

Cybersecurity threatsAccess controlCryptography basicsSecurity risk managementDatabase protection

Information Security Questions

Multiple choice technology security
  1. isValidDirectory( java.lang.String context, java.lang.String input)

  2. isValidDirectory( java.lang.String context, java.lang.String input) and isValidFileName(java.lang.String context, java.lang.String input)

  3. isSafeDirectoryPath(java.lang.String context, java.lang.String input,boolean allowNull) and isSafeFileName(java.lang.String context, java.lang.String input,boolean allowNull)

  4. ValidateDirectoryPath(java.lang.String context, java.lang.String input,boolean allowNull)

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Path Traversal attacks attempt to access files outside the intended directory using sequences like '../'. isSafeDirectoryPath and isSafeFileName validate that paths don't escape allowed directories and filenames don't contain dangerous sequences, preventing unauthorized file system access.

Multiple choice technology security
  1. String hashPassword(String password)

  2. String hashPassword(String password, String accountName)

  3. String hashpassword(String password)

  4. None of the above

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Secure password hashing requires both the password and a unique salt per user. The hashPassword method takes both password and accountName parameters, where accountName serves as the salt, ensuring that even identical passwords produce different hashes for different accounts.

Multiple choice technology security
  1. Boolean

  2. String

  3. Integer

  4. void

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The verifyPasswordStrength() method performs validation checks on password strength requirements (length, complexity, etc.). Being a void method means it doesn't return a value - it either completes successfully if the password is strong enough, or throws an exception if it fails validation checks.

Multiple choice technology security
  1. String

  2. boolean

  3. Integer

  4. void

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Authorization checks determine whether a user has permission to access specific data. The isAuthorizedForData() method returns a boolean - true if the user has permission, false otherwise. This simple yes/no result is sufficient for authorization decisions in access control systems.

Multiple choice technology security
  1. Integer

  2. Byte

  3. String

  4. BigInteger

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

CSRF tokens are random, unique strings generated by the server and embedded in forms or AJAX requests. The getCSRFToken() method returns this token as a String, allowing it to be included in requests and validated server-side to ensure requests originate from the legitimate application, not a malicious site.

Multiple choice technology security
  1. Creates a seal that binds a set of data and includes an expiration timestamp

  2. Encodes the data

  3. Hashes the data

  4. Scrambles the data

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The seal() method in the security API encrypts a given data set and attaches an expiration timestamp, signing the package to verify integrity. This prevents unauthorized tampering or replay attacks. Simply encoding, hashing, or scrambling the data does not offer this timestamped, integrity-protected envelope functionality.

Multiple choice technology security
  1. Input Validation and OutPut Encoding

  2. Authentication and Authorization

  3. Data Protection and Cryptography

  4. HTTP and Communication Security

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Combining input validation and output encoding forms the best defense against Cross-Site Scripting (XSS). Input validation rejects malformed data, while context-aware output encoding ensures that any allowed user input is treated as text rather than executable script when rendered in the browser. Other options address authentication or cryptography.

Multiple choice technology security
  1. java.lang.String sign(java.lang.String data, java.lang.String key) throws EncryptionException

  2. java.lang.String sign(java.lang.String data, java.lang.String key)

  3. java.lang.String sign(java.lang.String data)

  4. java.lang.String sign(java.lang.String data) throws SecurityException

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The sign method in the security API throws SecurityException to handle cryptographic failures gracefully. Option B lacks exception handling, A throws the wrong exception type, and C is missing the key parameter. Security operations must declare appropriate exceptions for failure scenarios.

Multiple choice technology security
  1. java.lang.String seal(java.lang.String data,long timestamp) throws SecurityException

  2. java.lang.String seal(java.lang.String data,long timestamp) throws EncryptionException

  3. java.lang.String seal(java.lang.String data)

  4. java.lang.String seal(java.lang.String data) throws EncryptionException

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The seal method signature includes a timestamp parameter and throws SecurityException for error handling. Option B uses the wrong exception type (EncryptionException), while options C and D are missing the timestamp parameter which is typically required for temporal validation in sealing operations.

Multiple choice technology security
  1. String safeURIToDisplay= "/admin/findUser.do?name=" + TCSSAPI.encoder().encodeForJavaScript(request.getParameter( "dangerousInput"));

  2. String safeURIToDisplay = TCSSAPI.encoder().encodeForURL( "/admin/findUser.do?name=" + request.getParameter( "dangerousInput" ) );

  3. String safeURIToDisplay= "/admin/findUser.do?name=" + com.tcs.sapi.io.ValidationUtil.encodeForURL(request.getParameter( "dangerousInput"));

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The correct approach encodes only the dangerous user input parameter using encodeForURL, not the entire URL. Option A uses JavaScript encoding which is wrong for URL parameters. Option B encodes the entire URL which would break the URL structure. Only the user input needs encoding.

Multiple choice technology security
  1. SecurityException

  2. AccessException

  3. AuthenitcationException

  4. Exception

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

SecurityException is the standard exception thrown by security APIs when authorization fails. Unlike AccessException or generic Exception, SecurityException specifically indicates security-related authorization issues. AuthenticationException (misspelled in option C) would apply to authentication failures, not authorization.

Multiple choice technology security
  1. Validation Exception

  2. SecurityException

  3. Encoding Exception

  4. Encryption Exception

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

SecurityException is the common exception thrown by validation methods in security APIs. It serves as the base class for security-related failures, including validation errors. While the option lists specific validation exceptions, SecurityException is the standard runtime exception for such cases.

Multiple choice technology security
  1. SecurityException

  2. EnterpriseException

  3. EnterpriseSecurityException

  4. None of the above

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

EnterpriseSecurityException is the base class for all security-related exceptions in this API. While SecurityException might seem logical, this specific API hierarchy uses EnterpriseSecurityException as the root. EnterpriseException is likely a broader base for all enterprise exceptions.

Multiple choice technology security
  1. Its a form of encoding

  2. Its a form of encryption

  3. Its a form of decryption

  4. Its simply the operation of reducing a possibly encoded string down to its simplest form

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Canonicalization reduces an encoded string to its simplest, equivalent form. For example, %41 (URL encoding) canonicalizes to 'A'. This is crucial for security because attackers can use multiple encodings to bypass filters - canonicalization reveals the true input.

Multiple choice technology security
  1. Encrypts the input and returns the encrypted string

  2. Encodes the data

  3. Hashes the data

  4. Create a digital signature for the provided input data and return the signature in a string

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The sign() method creates a digital signature for the input data and returns it as a string. Digital signatures provide authentication and integrity verification - they prove the data originated from a specific source and wasn't tampered with. This is different from encryption (confidentiality) or hashing (one-way).