SQL Server Questions and Answers – Data Cryptography

This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Data Cryptography”.

1. Which of the field must be 1 using an authenticator in the following code?

EncryptByKey ( key_GUID , { 'cleartext' | @cleartext }
    [, { add_authenticator | @add_authenticator }
     , { authenticator | @authenticator } ] )

a) @add_authenticator
b) @cleartext
c) key_GUID
d) None of the mentioned
View Answer

Answer: a
Explanation: add_authenticator indicates whether an authenticator will be encrypted together with the cleartext.

2. Point out the wrong statement.
a) EncryptByKey uses a symmetric key
b) EncryptByKey returns NULL if the key is not open
c) You can use encryption in SQL Server for connections, data, and stored procedures
d) All of the mentioned
View Answer

Answer: a
Explanation: If the symmetric key is already open in the current session, you do not have to open it again in the context of the query.

advertisement
advertisement

3. Which of the following script creates master key?
a)

CREATE MASTER KEY
BY PASSWORD='MyStrongPassword';

b)

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!
CREATE MASTER KEY ENCRYPTION
BY PASSWORD='MyStrongPassword';

c)

advertisement
CREATE MASTER ENCRYPTION
BY PASSWORD='MyStrongPassword';

d) All of the mentioned
View Answer

Answer: b
Explanation: The master key must be in the master database.

advertisement

4. Which of the statement is used to create a new certificate with a valid subject in SQL Server?
a)

CREATE CERTI MySQLCert
WITH SUBJECT='MyDatabase DEK';

b)

CREATE CERTIFICATE MySQLCert
WITH SUBJECT='MyDatabase DEK';

c)

CREATE CERTIFICATE MySQLCert
WITH SUBJ='MyDatabase DEK';

d) None of the mentioned
View Answer

Answer: b
Explanation: The CREATE CERTIFICATE statement is used to create a new certificate named MySQLCert.

5. Point out the wrong statement.
a) Encryption should be considered for all data or connections
b) Any use of encryption should also include a maintenance strategy for passwords, keys, and certificates
c) TDE is essentially an enterprise-oriented feature and is available only in the following editions of SQL Server
d) None of the mentioned
View Answer

Answer: a
Explanation: encryption is a valuable tool to help ensure security, it should not be considered for all data or connections.

6. Like data compression, TDE database encryption is performed at the ______ level.
a) Page
b) Domain
c) Column
d) Row
View Answer

Answer: a
Explanation: Performing the encryption at the page level enables the encryption process to be completely transparent to the client applications.

7. Which of the following is valid code to backup a certificate?
a)

USE Master
GO
BACKUP CERTIFICATE MySQLCert
TO FILE = 'C:\temp\MySQLCert'
WITH PRIVATE KEY (file='C:\temp\MySQLCertKey',
ENCRYPTION BY PASSWORD='MyStrongPassword2')

b)

USE Master
GO
BACK CERTIFICATE MySQLCert
TO FILE = 'C:\temp\MySQLCert'
WITH PRIVATE KEY (file='C:\temp\MySQLCertKey',
ENCRYPTION BY PASSWORD='MyStrongPassword2')

c)

USE Master
GO
BACKUP CERTIFICATE MySQLCert
TO FILE = 'C:\temp\MySQLCert'
WITH PUBLIC KEY (file='C:\temp\MySQLCertKey',
ENCRYPTION BY PASSWORD='MyStrongPassword2')

d)

USE Master
GO
BACKUP CERTIFICATE MySQLCert
TO SUBJECT = 'C:\temp\MySQLCert'
WITH PRIVATE KEY (file='C:\temp\MySQLCertKey',
ENCRYPTION BY PASSWORD='MyStrongPassword2')
View Answer
Answer: a
Explanation: Backing up the certificate is extremely important because the encrypted data can’t be accessed or restored without the certificate.
 
 

8. Which of the following catalog view is used to monitor TDE?
a) sys.certificates
b) sys.certificate
c) DMVs
d) All of the mentioned
View Answer

Answer: a
Explanation: To find out what is signed by the certificate, you can use the sys.certificates.

9. ___________ encryption was introduced in SQL Server 2005 and is available in all editions of SQL Server.
a) Column-level Encryption
b) Transparent Data Encryption
c) BitLocker
d) None of the mentioned
View Answer

Answer: a
Explanation: To use cell-level encryption, the schema must be changed to varbinary, then reconverted to the desired data type.

10. Which of the following functions decrypts data by using a symmetric key?
a) DECRYPTBYSYMKEY
b) DECRYPTBYKEYAUTOASYMKEY
c) DECRYPTBYASYMKEY
d) DECRYPTBYKEYAUTOCERT
View Answer

Answer: b
Explanation: DECRYPTBYKEYAUTOASYMKEY, which decrypts data by using a symmetric key that’s automatically decrypted with an asymmetric key.

Sanfoundry Global Education & Learning Series – SQL Server.

To practice all areas of SQL Server, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.