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
-
Method of validating a credential set
-
Method of ensuring that a subject is the entity it claims to be
-
Method of validating the entitlements for an authenticated subject
-
Another term for identification
C
Correct answer
Explanation
Authorization is the process of determining what permissions and access rights an authenticated subject has. It comes AFTER authentication (proving identity) and answers the question 'what is this user allowed to do?' Option B describes authentication, not authorization. Option A describes credential validation, which is part of authentication.
-
String hashPassword(String password)
-
String hashPassword(String password, String accountName)
-
String hashpassword(String password)
-
None of the above
B
Correct answer
Explanation
The hashPassword method requires both the password and accountName parameters. The accountName is typically used as a salt or to ensure uniqueness of hashes across accounts. Option A only takes the password, which would result in identical passwords producing identical hashes - a security vulnerability. Option C has incorrect capitalization.
-
Boolean
-
String
-
Integer
-
void
D
Correct answer
Explanation
The verifyPasswordStrength() method returns void because it likely throws an exception if the password doesn't meet strength requirements rather than returning a boolean. This pattern is common in security APIs where failure should halt execution. However, this is a specific API design choice that depends on the actual framework being referenced.
-
String
-
boolean
-
Integer
-
void
B
Correct answer
Explanation
The isAuthorizedForData() method returns a boolean because authorization checks result in a yes/no decision - either the subject has permission to access the data or they don't. This is the standard return type for authorization methods across security frameworks.
-
Integer
-
Byte
-
String
-
BigInteger
C
Correct answer
Explanation
CSRF tokens are typically generated as random strings that are included in forms or requests and validated on the server. String is the standard return type for token generation methods because tokens need to be transportable in HTTP headers, form fields, or URLs. Numeric types would not serve this purpose.
-
Input Validation and OutPut Encoding
-
Authentication and Authorization
-
Data Protection and Cryptography
-
HTTP and Communication Security
A
Correct answer
Explanation
Input Validation ensures data meets expected criteria before processing, while Output Encoding converts special characters to safe representations, preventing malicious scripts from executing. These two practices directly combat XSS by controlling what enters the system and how it's rendered. Authentication/Authorization and Cryptography address access control and data protection, not script injection prevention.
-
java.lang.String sign(java.lang.String data, java.lang.String key) throws EncryptionException
-
java.lang.String sign(java.lang.String data, java.lang.String key)
-
java.lang.String sign(java.lang.String data)
-
java.lang.String sign(java.lang.String data) throws SecurityException
D
Correct answer
Explanation
The sign() method takes only the data parameter and throws SecurityException because signing operations are critical security operations that can fail for various reasons (invalid key format, cryptographic errors, etc.). Unlike method A which incorrectly requires a key parameter, the signature method implies the key is managed internally. Option C is incorrect because signing can fail and should signal errors.
-
java.lang.String seal(java.lang.String data,long timestamp) throws SecurityException
-
java.lang.String seal(java.lang.String data,long timestamp) throws EncryptionException
-
java.lang.String seal(java.lang.String data)
-
java.lang.String seal(java.lang.String data) throws EncryptionException
A
Correct answer
Explanation
The seal() method signature includes both the data and timestamp parameters, throwing SecurityException because cryptographic sealing operations can fail. The timestamp is essential for implementing expiration, as described in the seal() functionality. Option B incorrectly specifies EncryptionException - security API methods throw SecurityException to signal security-related failures.
-
String safeURIToDisplay= "/admin/findUser.do?name=" + TCSSAPI.encoder().encodeForJavaScript(request.getParameter( "dangerousInput"));
-
String safeURIToDisplay = TCSSAPI.encoder().encodeForURL( "/admin/findUser.do?name=" + request.getParameter( "dangerousInput" ) );
-
String safeURIToDisplay= "/admin/findUser.do?name=" + com.tcs.sapi.io.ValidationUtil.encodeForURL(request.getParameter( "dangerousInput"));
-
None of the above
C
Correct answer
Explanation
When encoding user input for URLs, you must encode only the parameter value, not the entire URL string. encodeForURL applied to the whole URL (option B) would break the URL structure. encodeForJavaScript (option A) is for JavaScript context, not URLs. Option C correctly encodes only the dangerous user input portion before concatenating it with the safe URL structure.
-
Validation Exception
-
SecurityException
-
Encoding Exception
-
Encryption Exception
B
Correct answer
Explanation
SecurityException is the most common exception thrown by validation methods in the security API because it serves as the base class for security-related failures. When validation fails due to security violations (invalid input, malicious patterns, policy violations), the API throws SecurityException or its subclasses. Validation, Encoding, and Encryption exceptions are not standard exception types in this API.
-
SecurityException
-
EnterpriseException
-
EnterpriseSecurityException
-
None of the above
C
Correct answer
Explanation
EnterpriseSecurityException is the base class for all security-related exceptions in the TCS security API. It provides a common ancestor for specific security exceptions like authorization failures, validation errors, and authentication issues. SecurityException alone might not capture the enterprise context, and EnterpriseException is too broad for security-specific failures.
-
Its a form of encoding
-
Its a form of encryption
-
Its a form of decryption
-
Its simply the operation of reducing a possibly encoded string down to its simplest form
D
Correct answer
Explanation
Canonicalization is the process of reducing an encoded string to its simplest, unambiguous form by decoding all encoding layers. For security, this is crucial because attackers can use multiple encoding schemes (URL encoding, double encoding, mixed encoding) to hide malicious input. By canonicalizing input first, security checks can detect attacks regardless of the encoding used.
-
isValidDirectory( java.lang.String context, java.lang.String input)
-
isValidDirectory( java.lang.String context, java.lang.String input) and isValidFileName(java.lang.String context, java.lang.String input)
-
isSafeDirectoryPath(java.lang.String context, java.lang.String input,boolean allowNull) and isSafeFileName(java.lang.String context, java.lang.String input,boolean allowNull)
-
ValidateDirectoryPath(java.lang.String context, java.lang.String input,boolean allowNull)
C
Correct answer
Explanation
To prevent Path Traversal attacks, TCS SAPI provides isSafeDirectoryPath() and isSafeFileName() which validate that paths don't contain dangerous patterns like '../' or absolute paths. These methods check if the input is safe for the given context before allowing file system access. Path traversal attacks attempt to access files outside the intended directory, so validating both directory paths and filenames is essential defense.
-
Ounce
-
WebInspect
-
IBM RAD
-
None of the above
A
Correct answer
Explanation
Ounce (Ounce Labs) is a commercial static code analyzer that identifies security vulnerabilities in source code before deployment. It analyzes code paths to find potential security issues. WebInspect is a dynamic analysis tool, IBM RAD is an IDE, making Ounce the correct static analyzer choice.
-
Group based access control should be implemented to assign permissions to application users
-
Consistent authorization checking should be performed on all application pages
-
A set of all allowable actions should be defined for each user role and all other's denied
-
All failed access authorization requests should be logged to a secure location for review by administrators
C
Correct answer
Explanation
The principle of least privilege means users should have only the minimum permissions necessary to perform their job functions. Option C correctly implements this by defining allowable actions for each role and denying everything else. Group-based access (A) is a method but doesn't define the principle, consistent checking (B) is about authorization implementation, and logging (D) is about audit trails.