PrepAway - Latest Free Exam Questions & Answers

Which code segment should you execute before you remove…

DRAG DROP
You have a table named Table1 that contains 1 million rows. Table1 contains a column named Column1 thatstores sensitive information. Column1 uses the nvarchar(16) data type.
You have a certificate named Cert1.
You need to replace Column1 with a new encrypted column that uses two-way encryption.
Which code segment should you execute before you remove Column1?
To answer, move the appropriate code segments from the list of code segments to the answer area and
arrange them in the correct order.
Select and Place:

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:
Note:
* Use AES_256 for two-way encryption.
* Use varbinary to store key.
* CLOSE SYMMETRIC KEY (Transact-SQL)
Closes a symmetric key, or closes all symmetric keys open in the current session.
* Example:
CREATE SYMMETRIC KEY CreditCards_Key11
WITH ALGORITHM = AES_256
ENCRYPTION BY CERTIFICATE Sales09;
GO
— Create a column in which to store the encrypted data.ALTER TABLE Sales.CreditCard
ADD CardNumber_Encrypted varbinary(128);
GO
— Open the symmetric key with which to encrypt the data.
OPEN SYMMETRIC KEY CreditCards_Key11
DECRYPTION BY CERTIFICATE Sales09;
— Encrypt the value in column CardNumber using the
— symmetric key CreditCards_Key11.
— Save the result in column CardNumber_Encrypted.
UPDATE Sales.CreditCard
SET CardNumber_Encrypted = EncryptByKey(Key_GUID(‘CreditCards_Key11’) , CardNumber, 1, HashBytes
(‘SHA1’, CONVERT( varbinary
, CreditCardID)));
GO

3 Comments on “Which code segment should you execute before you remove…

  1. friendsccet says:

    Remember question comes either for 2 way encryption or Hashing
    For 2 way encryption
    1) Use AES_256
    2) alter varbinary
    3) open key
    4) update
    5) close (in closing Key you need to give Key name or close all which is not mention in option)

    For Hashing
    1) Use SHA
    2) alter varbinary
    3) open key
    4) update
    5) close




    3



    1

Leave a Reply