Description
Encrypting and Decrypting Data,based on p. 236 of the MCSA guide to Microsoft® SQL server 2012textbook.
For this hands-on project, you will use the SQL Server named instance SQLSERVERHOA, and the HandsOnOne database and tables you created in previous chapters. The objective of this activity is to practice generating keys and encrypting/decrypting data. Document each step by taking a screen shot of the Query Editor window after successfully executing each SQL query.
- In SQL Server Management Studio, open a new Query Editor window, which you will use for completing all steps in this activity.
- Create a SQL query to generate a new database master key and certificate for the HandsOnOne database. Take a screenshot of the Query Editor after you have executed this SQL command to show that it was completed successfully.
- Construct a SQL query to generate a new symmetric key for encrypting data. The symmetric key should use the AES algorithm with a 256-bit key size, and it should be protected by the certificate you created in Step 2. Take a screenshot of the Query Editor after you have executed this SQL command to show that it was completed successfully.
- Construct a SQL query to alter the Customer table and add a new column named CustomerNameEncrypted with data type varbinary(128). This column will be used to store the encrypted values of the CustomerName column. Take a screenshot of the Query Editor after you have executed this SQL command to show that it was completed successfully.
- Using the symmetric key you created in Step 2, write an SQL UPDATE query that encrypts the values in the CustomerName column and adds the encrypted values to the CustomerNameEncrypted column. Take a screenshot of the Query Editor after you have executed this SQL command to show that it was completed successfully.
- Construct a SQL SELECT query to view the encrypted values of the CustomerNameEncrypted column in the Customer table. Take a screenshot of the Query Editor after you have executed this SQL command to show that it was completed successfully.
- Construct a SELECT SQL query that uses the symmetric key to decrypt the values in the CustomerNameEncrypted column. Note that you will need to convert the hexidecimal values into a character string in order to read the decrypted values. Take a screenshot of the Query Editor after you have executed this SQL command to show that it was completed successfully.
Deliverable
After you have completed these steps, submit one MS Word document that contains the screenshots and include a report that summarizes the database security controls you implemented. Insert all of the screenshots into the document, label each of them clearly, and include the 1-page minimum report below the screenshots
Explanation & Answer
Attached.
Running Head: SQL QUERY AND SCREENSHOTS
SQL 2014 Query, Results and Screenshots with
Report
[YourName]
[YourInstitution]
[Date]
SQL Query and Screenshots
2
SQL Server Execution
Create a SQL query to generate a new database master key and certificate for the
HandsOnOne database.
Query:
USE [HandsOnOne]
GO
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '23987hxJ#KL95234nl0zBe';
GO
Screenshot:
SQL Query and Screenshots
Construct a SQL query to generate a new symmetric key for encrypting data. The
symmetric key should use the AES algorithm with a 256-bit key size, and it should be
protected by the certificate you created in Step 2.
Query:
USE HandsOnOne
GO
/* Create Encryption Certificate */
CREATE CERTIFICATE EncryptCert
WITH SUBJECT = '23987hxJ#KL95234nl0zBe'
GO
/* Create Symmetric Key */...
Review
Review
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Similar Content
Related Tags
You Are a Badass
by Jen Sincero
Milkweed
by Jerry Spinelli
No Exit
by Taylor Adams
Cry the Beloved Country
by Alan Paton
American Gods
by Neil Gaiman
The Secret Life of Bees
by Sue Monk Kidd
Cant Hurt Me - Master Your Mind and Defy the Odds
by David Goggins
The Book Thief
by Markus Zusak
A Portrait of the Artist as a Young Man
by James Joyce