<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>AES &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/aes/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Sun, 09 Apr 2017 20:41:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>SQL Server: Encrypt Column data using Symmetric Key Encryption</title>
		<link>https://www.dbrnd.com/2017/04/sql-server-encrypt-column-data-using-symmetric-key-encryption-data-security-aes/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 18 Apr 2017 16:16:55 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[AES]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[Column encryption]]></category>
		<category><![CDATA[Data Security]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Decryption]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Error]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tuning]]></category>
		<category><![CDATA[SQL Server Programming]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[SYMMETRIC KEY]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5041</guid>

					<description><![CDATA[The Database Security is a very common and one of the major aspects for DBA to keep data secure. If you don&#8217;t know about SQL Server TDE, please read below article which uses for data encryption in SQL Server. SQL Server: Transparent Data Encryption (TDE) to Encrypt a Database There are different ways to encrypt [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F04%2Fsql-server-encrypt-column-data-using-symmetric-key-encryption-data-security-aes%2F&amp;linkname=SQL%20Server%3A%20Encrypt%20Column%20data%20using%20Symmetric%20Key%20Encryption" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F04%2Fsql-server-encrypt-column-data-using-symmetric-key-encryption-data-security-aes%2F&amp;linkname=SQL%20Server%3A%20Encrypt%20Column%20data%20using%20Symmetric%20Key%20Encryption" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F04%2Fsql-server-encrypt-column-data-using-symmetric-key-encryption-data-security-aes%2F&amp;linkname=SQL%20Server%3A%20Encrypt%20Column%20data%20using%20Symmetric%20Key%20Encryption" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F04%2Fsql-server-encrypt-column-data-using-symmetric-key-encryption-data-security-aes%2F&amp;linkname=SQL%20Server%3A%20Encrypt%20Column%20data%20using%20Symmetric%20Key%20Encryption" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F04%2Fsql-server-encrypt-column-data-using-symmetric-key-encryption-data-security-aes%2F&amp;linkname=SQL%20Server%3A%20Encrypt%20Column%20data%20using%20Symmetric%20Key%20Encryption" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F04%2Fsql-server-encrypt-column-data-using-symmetric-key-encryption-data-security-aes%2F&amp;linkname=SQL%20Server%3A%20Encrypt%20Column%20data%20using%20Symmetric%20Key%20Encryption" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F04%2Fsql-server-encrypt-column-data-using-symmetric-key-encryption-data-security-aes%2F&#038;title=SQL%20Server%3A%20Encrypt%20Column%20data%20using%20Symmetric%20Key%20Encryption" data-a2a-url="https://www.dbrnd.com/2017/04/sql-server-encrypt-column-data-using-symmetric-key-encryption-data-security-aes/" data-a2a-title="SQL Server: Encrypt Column data using Symmetric Key Encryption"></a></p><p>The Database Security is a very common and one of the major aspects for DBA to keep data secure.<br />
If you don&#8217;t know about SQL Server TDE, please read below article which uses for data encryption in SQL Server.</p>
<blockquote class="wp-embedded-content" data-secret="qNqZwgAndj"><p><a href="https://www.dbrnd.com/2016/05/sql-server-transparent-data-encryption-tde-to-encrypt-a-database-data-log-backup-file/">SQL Server: Transparent Data Encryption (TDE) to Encrypt a Database</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/05/sql-server-transparent-data-encryption-tde-to-encrypt-a-database-data-log-backup-file/embed/#?secret=qNqZwgAndj" data-secret="qNqZwgAndj" width="600" height="338" title="&#8220;SQL Server: Transparent Data Encryption (TDE) to Encrypt a Database&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>There are different ways to encrypt your data like TDE, data masking, symmetric key.</p>
<p>In this post, I am sharing a demonstration on how to encrypt your table column using Symmetric key encryption.<br />
For example, When you are storing customer&#8217;s credit card information, you must encrypt all cards related columns.</p>
<p><strong>Below is a full demonstration of this:</strong></p>
<p><strong>Create a table with sample data:</strong></p><pre class="crayon-plain-tag">CREATE TABLE dbo.tbl_CustomerCards
(
	CustID INT PRIMARY KEY
	,CustName VARCHAR(10)
	,CustCardNo CHAR(8)
)
GO
INSERT INTO dbo.tbl_CustomerCards VALUES
(1,'Anvesh','25-85-96'),(2,'Neevan','88-26-19')
,(3,'Roy','29-30-32'),(4,'Muskan','36-22-69')
,(5,'Martin','26-88-66'),(6,'Jenny','74-21-31')
GO</pre><p>
<strong>Create your master key and give password base on windows policy:</strong></p><pre class="crayon-plain-tag">CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'Dbrnd888';
GO


--If your password does not match windows policy, you will get a below error.
Msg 15118, Level 16, State 1, Line 1
Password validation failed. The password does not meet Windows policy requirements because it is not complex enough.</pre><p>
<strong>Create a database certificate which is protected by database master key:</strong></p><pre class="crayon-plain-tag">CREATE CERTIFICATE dbrnd_certificate
WITH SUBJECT = 'dbrnd Data';
GO</pre><p>
<strong>Create a symmetric key which uses for encryption/decryption:</strong><br />
I used AES_256 algorithm.</p><pre class="crayon-plain-tag">CREATE SYMMETRIC KEY dbrnd_Symmetric_key
WITH ALGORITHM = AES_256 
ENCRYPTION BY CERTIFICATE dbrnd_certificate;
GO</pre><p>
<strong>Add one more column in a table:</strong></p><pre class="crayon-plain-tag">ALTER TABLE tbl_CustomerCards 
ADD CustCardNo_encrypt VARBINARY(MAX) 
GO</pre><p>
<strong>Open a symmetric key for further use:</strong></p><pre class="crayon-plain-tag">OPEN SYMMETRIC KEY dbrnd_Symmetric_key
DECRYPTION BY CERTIFICATE dbrnd_certificate;
GO</pre><p>
<strong>Update newly created column by generating encrypted data with use of old column:</strong></p><pre class="crayon-plain-tag">UPDATE tbl_CustomerCards
SET CustCardNo_encrypt = EncryptByKey (Key_GUID('dbrnd_Symmetric_key'),CustCardNo)
FROM tbl_CustomerCards
GO</pre><p>
<strong>Now, You can remove your old column:</strong></p><pre class="crayon-plain-tag">ALTER TABLE tbl_CustomerCards
DROP COLUMN CustCardNo;
GO</pre><p>
<strong>SELECT encrypted/decrypted card numbers:</strong></p><pre class="crayon-plain-tag">SELECT CustID, CustCardNo_encrypt AS 'Encrypted_CardNumber',
CONVERT(varchar, DecryptByKey(CustCardNo_encrypt)) AS 'Decrypted_CardNumber'
FROM dbo.tbl_CustomerCards;</pre><p>
<strong>Try to Insert few records with encrypted card number values:</strong></p><pre class="crayon-plain-tag">INSERT INTO dbo.tbl_CustomerCards VALUES
(7,'Meera',EncryptByKey( Key_GUID('dbrnd_Symmetric_key'), CONVERT(varchar,'66-52-36')))
,(8,'Laria',EncryptByKey( Key_GUID('dbrnd_Symmetric_key'), CONVERT(varchar,'99-36-23')))
GO</pre><p>
<strong>Once you complete with the use symmetric key, CLOSE it:</strong></p><pre class="crayon-plain-tag">CLOSE SYMMETRIC KEY dbrnd_Symmetric_key;
GO</pre><p>
<strong>The result:</strong></p>
<p><img fetchpriority="high" decoding="async" class="alignnone wp-image-5044 size-full" title="SQL Server Column Encrypted Result" src="https://www.dbrnd.com/wp-content/uploads/2017/04/SQLServerColumnEncryptedResult.png" alt="SQL Server Column Encrypted Result" width="554" height="179" srcset="https://www.dbrnd.com/wp-content/uploads/2017/04/SQLServerColumnEncryptedResult.png 554w, https://www.dbrnd.com/wp-content/uploads/2017/04/SQLServerColumnEncryptedResult-300x97.png 300w, https://www.dbrnd.com/wp-content/uploads/2017/04/SQLServerColumnEncryptedResult-150x48.png 150w" sizes="(max-width: 554px) 100vw, 554px" /></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>MySQL: Password Encryption using the Advanced Encryption Standard Algorithm (AES_ENCRYPT())</title>
		<link>https://www.dbrnd.com/2016/07/mysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 26 Jul 2016 19:51:25 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[AES]]></category>
		<category><![CDATA[AES_DECRYPT]]></category>
		<category><![CDATA[AES_ENCRYPT]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[password encryption]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1774</guid>

					<description><![CDATA[This is going to be one of most important article for the MySQL community because I am going to share, what should be our best practice to store encrypted passwords into MySQL Database Server. The MySQL provides different algorithm and function to encrypt and decrypt password data or any other sensitive information so that no [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt%2F&amp;linkname=MySQL%3A%20Password%20Encryption%20using%20the%20Advanced%20Encryption%20Standard%20Algorithm%20%28AES_ENCRYPT%28%29%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt%2F&amp;linkname=MySQL%3A%20Password%20Encryption%20using%20the%20Advanced%20Encryption%20Standard%20Algorithm%20%28AES_ENCRYPT%28%29%29" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt%2F&amp;linkname=MySQL%3A%20Password%20Encryption%20using%20the%20Advanced%20Encryption%20Standard%20Algorithm%20%28AES_ENCRYPT%28%29%29" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt%2F&amp;linkname=MySQL%3A%20Password%20Encryption%20using%20the%20Advanced%20Encryption%20Standard%20Algorithm%20%28AES_ENCRYPT%28%29%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt%2F&amp;linkname=MySQL%3A%20Password%20Encryption%20using%20the%20Advanced%20Encryption%20Standard%20Algorithm%20%28AES_ENCRYPT%28%29%29" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt%2F&amp;linkname=MySQL%3A%20Password%20Encryption%20using%20the%20Advanced%20Encryption%20Standard%20Algorithm%20%28AES_ENCRYPT%28%29%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt%2F&#038;title=MySQL%3A%20Password%20Encryption%20using%20the%20Advanced%20Encryption%20Standard%20Algorithm%20%28AES_ENCRYPT%28%29%29" data-a2a-url="https://www.dbrnd.com/2016/07/mysql-password-encryption-using-the-advanced-encryption-standard-algorithm-aes_encrypt/" data-a2a-title="MySQL: Password Encryption using the Advanced Encryption Standard Algorithm (AES_ENCRYPT())"></a></p><p>This is going to be one of most important article for the MySQL community because I am going to share, what should be our best practice to store encrypted passwords into MySQL Database Server.</p>
<p>The MySQL provides different algorithm and function to encrypt and decrypt password data or any other sensitive information so that no one can access it in plain text format. </p>
<p><a href="https://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html#function_aes-decrypt" target="_blank"><strong>For different Encryption and Compression functions you can visit this MySQL Developer official site. </strong></a></p>
<blockquote><p><strong>Generally, people are using MD5 and SHA algorithm  for password encryption, but both are easy to break and vulnerable, so we should not use this in our general practice. </strong></p></blockquote>
<blockquote><p>
<strong>We should also not use PASSWORD() function because it is used by the authentication system in MySQL Server. </strong></p></blockquote>
<p><code><strong>Advanced Encryption Standard Algorithm (AES): </strong></code></p>
<p>This is one of the important encryption algorithm and it is highly secure because it encrypts the string using the encryption key string and returns an encrypted binary string output. </p>
<p>MySQL provides AES_ENCRYPT() to encrypt the string in binary format and AES_DECRYPT() to decrypt the string in plain text. </p>
<blockquote><p>The only one problem is, we should hide the key value for security purpose by setting object level permission or we can create a view to hide the encryption key value. </p></blockquote>
<p>You can create BINARY or BLOB data type to store AES encrypted password. </p>
<p><strong>Below is a small demonstration on this:</strong></p>
<p><strong>The syntax:</strong></p>
<pre class="crayon-plain-tag">AES_ENCRYPT(str,key_str)
AES_DECRYPT(crypt_str,key_str)</pre> </p>
<p><strong>First, create a table with sample data:</strong></p>
<p> </p><pre class="crayon-plain-tag">CREATE TABLE tbl_AESPassword
(
    ID INTEGER
    ,UserPassword BLOB
);

INSERT INTO tbl_AESPassword 
VALUES 
(1,AES_ENCRYPT('Anvesh','8'))
,(2,AES_ENCRYPT('Patel','88'));</pre><p> </p>
<p><strong>SELECT first row by comparing password using defined encryption key:</strong></p>
<pre class="crayon-plain-tag">SELECT *	
FROM tbl_AESPassword
WHERE UserPassword = AES_ENCRYPT('Anvesh','8')

-- Result: Returned only first record. 
ID      |  UserPassword
---------------------------
1       | BLOB</pre> </p>
<p><strong>To DECRYPT the password into plain text:</strong></p>
<pre class="crayon-plain-tag">mysql&gt; SELECT AES_DECRYPT(AES_ENCRYPT('Anvesh','8'),'8');

+--------------------------------------------+
| AES_DECRYPT(AES_ENCRYPT('Anvesh','8'),'8') |
+--------------------------------------------+
| Anvesh                                     |
+--------------------------------------------+
1 row in set (0.00 sec)</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SQL Server: Database Security Interview Questions and Answers  (Day-2)</title>
		<link>https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-transparent-data-encryption-aes-des-db_owner-db_datareader-db_ddladmin-day-2/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 19 Jul 2016 20:05:59 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[AES]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[db_datareader]]></category>
		<category><![CDATA[db_ddladmin]]></category>
		<category><![CDATA[db_owner]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[DES]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TDE]]></category>
		<category><![CDATA[Transparent Data Encryption]]></category>
		<category><![CDATA[TSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3367</guid>

					<description><![CDATA[What is TDE (Transparent Data Encryption) method in SQL Server? SQL Server: Transparent Data Encryption (TDE) to Encrypt a Database TDE provides the ability to encrypt an entire database and to have the encryption be completely transparent to the applications that access the database. TDE encrypts the data stored in both the database’s data file [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-security-interview-questions-and-answers-transparent-data-encryption-aes-des-db_owner-db_datareader-db_ddladmin-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-2%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-security-interview-questions-and-answers-transparent-data-encryption-aes-des-db_owner-db_datareader-db_ddladmin-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-2%29" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-security-interview-questions-and-answers-transparent-data-encryption-aes-des-db_owner-db_datareader-db_ddladmin-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-2%29" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-security-interview-questions-and-answers-transparent-data-encryption-aes-des-db_owner-db_datareader-db_ddladmin-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-2%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-security-interview-questions-and-answers-transparent-data-encryption-aes-des-db_owner-db_datareader-db_ddladmin-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-2%29" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-security-interview-questions-and-answers-transparent-data-encryption-aes-des-db_owner-db_datareader-db_ddladmin-day-2%2F&amp;linkname=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-2%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fsql-server-database-security-interview-questions-and-answers-transparent-data-encryption-aes-des-db_owner-db_datareader-db_ddladmin-day-2%2F&#038;title=SQL%20Server%3A%20Database%20Security%20Interview%20Questions%20and%20Answers%20%20%28Day-2%29" data-a2a-url="https://www.dbrnd.com/2016/07/sql-server-database-security-interview-questions-and-answers-transparent-data-encryption-aes-des-db_owner-db_datareader-db_ddladmin-day-2/" data-a2a-title="SQL Server: Database Security Interview Questions and Answers  (Day-2)"></a></p><p><strong>What is TDE (Transparent Data Encryption) method in SQL Server?</strong></p>
<blockquote class="wp-embedded-content" data-secret="coShtkbHrc"><p><a href="https://www.dbrnd.com/2016/05/sql-server-transparent-data-encryption-tde-to-encrypt-a-database-data-log-backup-file/">SQL Server: Transparent Data Encryption (TDE) to Encrypt a Database</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/05/sql-server-transparent-data-encryption-tde-to-encrypt-a-database-data-log-backup-file/embed/#?secret=coShtkbHrc" data-secret="coShtkbHrc" width="600" height="338" title="&#8220;SQL Server: Transparent Data Encryption (TDE) to Encrypt a Database&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote><p>TDE provides the ability to encrypt an entire database and to have the encryption be completely transparent to the applications that access the database. TDE encrypts the data stored in both the database’s data file (.mdf) and log file (.ldf) using either Advanced Encryption Standard (AES) or Triple DES (3DES) encryption.</p>
<p>In addition, any backups of the database are encrypted. This protects the data while it’s at rest as well as provides protection against losing sensitive information if the backup media were lost or stolen.</p></blockquote>
<p><strong>Which versions of SQL Server support TDE?</strong></p>
<blockquote><p>TDE requires SQL Server 2012 Enterprise edition.</p>
<p>TDE is also available in SQL Server 2008 and SQL Server 2008 R2 Datacenter and Enterprise editions.</p></blockquote>
<p><strong>Is there a performance impact for using TDE?</strong></p>
<blockquote><p>Yes, some performance overhead is involved in using TDE. The encryption and decryption process do require additional CPU cycles. The overhead for using TDE ranges from about 3 percent to 30 percent, depending on the type of workload.</p></blockquote>
<p><strong>How can you enable TDE in SQL server?</strong></p>
<ul>
<li>Create a master key for the database.</li>
<li>Create a certificate that’s protected by the master key.</li>
<li>Create a special key that’s used to protect the database. This key is called the database encryption key (DEK) and you secure it using the certificate.</li>
<li>Enable encryption.</li>
</ul>
<blockquote class="wp-embedded-content" data-secret="HrA32tkw9f"><p><a href="https://www.dbrnd.com/2016/05/sql-server-how-to-enable-transparent-data-encryption-tde-create-master-key-certificate-on-a-database/">SQL Server: How to enable Transparent Data Encryption (TDE) on a Database?</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/05/sql-server-how-to-enable-transparent-data-encryption-tde-create-master-key-certificate-on-a-database/embed/#?secret=HrA32tkw9f" data-secret="HrA32tkw9f" width="600" height="338" title="&#8220;SQL Server: How to enable Transparent Data Encryption (TDE) on a Database?&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>What is a MASTER KEY?</strong></p>
<blockquote><p>A master key is a symmetric key that is used to create certificates and asymmetric keys.</p></blockquote>
<p><strong>What are the Advantages of using TDE?</strong></p>
<ul>
<li>Performs real-time I/O encryption and decryption of the data and log files</li>
<li>Encrypts the Entire Database in rest</li>
<li>No architectural changes needed</li>
<li>No application code changes are required and the user experience is the same</li>
<li>Easy to implement</li>
<li>DBAs can still see the data</li>
</ul>
<p><strong>What are the Disadvantages of using TDE?</strong></p>
<ul>
<li>Not granular – Cannot just encrypt specific tables/columns</li>
<li>Not good for high CPU bottleneck servers</li>
<li>Not protected through communication/networks</li>
</ul>
<p><strong>Which key provides the strongest encryption?</strong></p>
<blockquote><p>AES (256 bit)</p>
<p>The longer the key, the better the encryption, so choose longer keys for more encryption. However there is a larger performance penalty for longer keys. DES is a relatively old and weaker algorithm than AES.</p>
<p>AES: Advanced Encryption Standard</p>
<p>DES: Data Encryption Standard</p></blockquote>
<p><strong>Does TDE prevent the security administrator or database administrator from seeing the data in the database?</strong></p>
<blockquote><p>No. TDE protects the data at rest, but an authorized user such as a security administrator or a database administrator can access the data in a TDE-encrypted database. To prevent an SA or DBA from accessing selected parts of the data, you need to use application-level encryption.</p></blockquote>
<p><strong>How do you enable TDE?</strong></p>
<blockquote><p>To use TDE, first you need to create a master key using the CREATE MASTER KEY T-SQL statement. Next, you need to create a certificate using the CREATE CERTIFICATE command.</p>
<p>Then you need to use the CREATE DATABASE ENCRYPTION KEY statement to encrypt the Database Encryption Key (DEK).  Finally, you need to use the ALTERDATABASE SET ENCRYPTION ON statement to actually encrypt the user database with the DEK. As soon as you use TDE for a user database, TempDB is automatically encrypted as well.</p></blockquote>
<p><strong>Is there a performance impact for using TDE?</strong></p>
<blockquote><p>Yes, some performance overhead is involved in using TDE. The encryption and decryption process do require additional CPU cycles. The overhead for using TDE ranges from about 3 percent to 30 percent, depending on the type of workload.</p>
<p>SQL Server instances with low I/O and low CPU usage will have the least performance impact. Servers with high CPU usage will have the most performance impact.</p></blockquote>
<p><strong>Does TDE encrypt the data stream sent to the client?</strong></p>
<blockquote><p>No. TDE encrypts the data stored on disk at the page and log level. The data that’s sent across the wire to the client connections isn’t encrypted.</p></blockquote>
<p><strong>What is the use of db_owner role?</strong></p>
<blockquote><p>Users in the db_owner role have it all, within a single database. They can grant and revoke access, create tables, stored procedures, views, run backups and schedule jobs. A user who is db_owner can even drop the database.</p></blockquote>
<p><strong>Why Use db_datareader role?</strong></p>
<blockquote><p>Let’s say the Accounting department has a separate database. Everyone in Accounting is able to create and run ad hoc reports directly against this database, but they shouldn’t be able to do anything else apart from seeing the contents of the database. Clearly granting db_owner access is out of the question.</p>
<p>Your junior DBA is out sick today, so you can’t make him grant SELECT permissions to every table in the database while you go out for lunch. Instead, you can simply grant db_datareader access to the Accounting department’s Windows group.</p></blockquote>
<p><strong>What is the use of db_ddladmin role?</strong></p>
<blockquote><p>Members of the db_ddladmin role are able to execute DDL commands (CREATE, ALTER, DROP) within the current database. It’s pretty self-explanatory &#8211; a member of db_ddladmin can run any CREATE, ALTER or DROP command within the current database. They cannot create new databases, nor can they alter or drop the current database.</p></blockquote>
<p><strong>Creating custom database application role, is bad practice or good practice?</strong></p>
<blockquote><p>It is good practice.</p>
<p>Granting permissions to roles rather than to users simplifies security administration. Permission sets that are assigned to roles are inherited by all members of the role. It is easier to add or remove users from a role than it is to recreate separate permission sets for individual users.</p></blockquote>
<p><strong>What kind of different encryption algorithms supported by SQL Server?</strong></p>
<blockquote><p>SQL Server supports several symmetric key encryption algorithms, including DES, Triple DES, RC2, RC4, 128-bit RC4, DESX, 128-bit AES, 192-bit AES, and 256-bit AES. The algorithms are implemented using the Windows Crypto API.</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
