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
-
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 requiring both password and accountName parameters allows for account-specific salting, which improves security by preventing the same password from hashing identically across different accounts. The single-parameter versions would be less secure. Option C is incorrect due to incorrect method naming convention (lowercase 'p').
-
Boolean
-
String
-
Integer
-
void
D
Correct answer
Explanation
The verifyPasswordStrength() method is a void method, meaning it performs validation and likely throws an exception or sets internal state rather than returning a value. This is common for validation methods that enforce security policies by throwing exceptions when requirements aren't met.
-
String
-
boolean
-
Integer
-
void
B
Correct answer
Explanation
The isAuthorizedForData() method checks whether the current user is authorized to access or modify a specific data object. It returns a boolean value (true if authorized, false otherwise). It does not return text, numeric identifiers, or a void type, as authorization is a binary status check.
-
Integer
-
Byte
-
String
-
BigInteger
C
Correct answer
Explanation
CSRF tokens are typically generated as random strings that can be embedded in forms or HTTP headers. The getCSRFToken() method returns a String token value, not numeric types like Integer or BigInteger, which would be unsuitable for token representation.
-
Oracle
-
MySQL
-
Both of the above
-
Oracle, MySQL, Sybase, DB2
C
Correct answer
Explanation
The security API supports Oracle and MySQL database codecs for SQL injection protection. Option D incorrectly includes Sybase and DB2, which are not among the default supported databases in this particular API.
-
Creates a seal that binds a set of data and includes an expiration timestamp
-
Encodes the data
-
Hashes the data
-
Scrambles the data
A
Correct answer
Explanation
The seal() method creates a cryptographic seal that binds data together with an expiration timestamp, providing tamper evidence and time-based validity. Unlike simple encoding, hashing, or scrambling, sealing provides integrity protection with temporal constraints.
-
Input Validation and OutPut Encoding
-
Authentication and Authorization
-
Data Protection and Cryptography
-
HTTP and Communication Security
A
Correct answer
Explanation
Cross Site Scripting (XSS) attacks inject malicious scripts into web pages viewed by other users. The most effective defense combines input validation (rejecting malicious input) and output encoding (converting special characters to HTML entities). Authentication and cryptography protect against different threats, not XSS.
-
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 in the security API accepts a single String parameter (data) and throws SecurityException. Options A and B incorrectly include a key parameter, while option C is missing the required exception declaration that security operations typically need.
-
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 requires both data and timestamp parameters and throws SecurityException. Options C and D are missing the required timestamp parameter that seal operations need, while option B throws the wrong exception type.
-
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
Encode only the user input parameter, not the entire URL. Option C correctly encodes just the dangerous input. Option A uses JavaScript encoding (wrong context). Option B encodes the entire URL including the path, which breaks it.
-
SecurityException
-
AccessException
-
AuthenitcationException
-
Exception
A
Correct answer
Explanation
When users attempt unauthorized access, the security API throws SecurityException. AccessException (B) is not the standard exception here. AuthenticationException (C) would be for identity verification failures, not authorization.
-
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 when validation fails. ValidationException (A) is not the standard exception name, and Encoding/Encryption exceptions (C, D) are for different operations.
-
SecurityException
-
EnterpriseException
-
EnterpriseSecurityException
-
None of the above
C
Correct answer
Explanation
In exception hierarchies, a base exception class provides common properties and methods for all related exceptions. EnterpriseSecurityException serves as the parent class for specific security exceptions, allowing consistent error handling across different security failure scenarios.
-
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 converting data to a standard or canonical form. For security, it means reducing encoded strings (like %3C for <) to their simplest representation before validation. This prevents attackers from bypassing validation using double-encoding or alternate encoding schemes.
-
Encrypts the input and returns the encrypted string
-
Encodes the data
-
Hashes the data
-
Create a digital signature for the provided input data and return the signature in a string
D
Correct answer
Explanation
Digital signatures provide authentication, integrity, and non-reputation for digital data. The sign() method creates a cryptographic signature using a private key, allowing recipients to verify the data originated from the claimed source and hasn't been tampered with using the corresponding public key.