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

To prevent path traversal attacks, TCS SAPI provides isSafeDirectoryPath() and isSafeFileName(). Both methods take a context, input string, and allowNull flag. The 'isSafe' prefix methods (option C) are the correct API methods for validating path safety.

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

The correct signature is String hashPassword(String password, String accountName). The accountName is used as the salt, so it's required. Option A is missing the salt parameter, and option C has incorrect case (hashpassword instead of hashPassword).

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 ESAPI encrypts data and embeds an expiration timestamp. This creates a secure token ensuring that the package cannot be tampered with or read, and will be rejected as invalid once the expiration timestamp has passed.

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

Cross-Site Scripting (XSS) occurs when untrusted input is executed in the browser. Input validation restricts malicious data from entering the application, and output encoding prevents the browser from interpreting user input as executable code, forming the best defense.

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 takes a single String parameter (the data to be signed) and throws SecurityException if signing fails or security constraints are violated. The method does not require an explicit key parameter as the key is managed internally by the security API.

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 accepts the data to be sealed and a timestamp parameter for time-based validation, returning a sealed String representation. It throws SecurityException when sealing operations fail due to security violations or invalid parameters.

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

Only the user-supplied parameter needs encoding, not the entire URL structure. Option C correctly encodes just the dangerous input while preserving the URL's query parameter syntax. Option A uses JavaScript encoding which is inappropriate for URL contexts, and Option B incorrectly encodes the entire URL string including the '=' delimiter.

Multiple choice technology security
  1. SecurityException

  2. AccessException

  3. AuthenitcationException

  4. Exception

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

When a user attempts to access a resource without proper authorization, the security API throws a SecurityException. This exception is specifically designed to indicate that the caller lacks the required permissions or rights to perform the requested operation. Generic exceptions like Exception are too broad, and AccessException is not a standard exception type in most security frameworks.

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 most common exception thrown by validation methods in the security API. This exception occurs when validation checks fail, such as when input data doesn't meet security requirements or when access permissions are insufficient. Other exceptions like Encoding Exception or Encryption Exception are specific to different operations and not typically thrown during general validation.

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 the security API. This class hierarchy allows for structured exception handling, where specific security exceptions can inherit from a common base. It provides a consistent way to catch and handle security-related errors throughout the application.

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 is the operation of reducing a possibly encoded string down to its simplest form. It's used in security to normalize input data by decoding all encoding layers, allowing for consistent validation. This helps prevent attacks that use multiple encoding layers to bypass security checks, such as double encoding or mixed encoding schemes.

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 provided input data and returns the signature in a string. Digital signatures provide authentication, integrity, and non-repudiation by using cryptographic algorithms to sign data. Unlike encryption (which hides data) or encoding (which transforms representation), signing provides a verifiable signature that proves the data originated from a specific source.