Category: Blog

  • Daily Coping 3 Jun 2021

    I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag. 

    Today’s tip is to exercise outside today in some way.

    I wrote this a few days ago because exercise today may be tough. I’m flying to Ft Lauderdale this morning and driving to Key West, so hopefully things will go smooth and I’ll have time to go for a walk by the ocean tonight.

    However, when I saw this tip, I decided to go back to one of my routines from lockdown last year. I did yoga outside, taking a break from work and setting up in the sunshine. A little hot, but being out in nature is very refreshing.

  • More Remote Work

    I’m taking a vacation. A real, honest, get away from home without commitments vacation.

    And to a new place!

    I’m heading to Key West today, a place I’ve never been. I wanted to go earlier this year, but other things got in the way. However, a friend in FL was heading down for a break and we decided to join them. My sister-in-law heard, and she’s meeting us as well.

    It’s almost a week in the sun, though I will need to work a couple days. I’ll take today off to travel and tomorrow to lay in the sun, but for a few days next week I’ll still be in FL and working.

    Looking forward to a little writing while I’m staring out at the ocean.

  • Creating a Symmetric Key–#SQLNewBlogger

    Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

    This is a series on working with the various encryption technologies in SQL Server.

    One of the encryption technologies in SQL Server is using keys to encrypt or decrypt data. This post looks at the symmetric key, which is part of the way that you can do the actual encryption of your data in SQL Server. I have a post the discusses how this works, but this post just looks at the use of creating the key.

    Note: You may need to create a database master key first, and you can follow the link to do that. If you need an overview of encryption, read A Basic Encryption Primer for SQL Server.

    The CREATE Statement

    There is DDL For symmetric keys in the form of:

    There are also the OPEN and CLOSE commands. For this post, we will look only at the CREATE statement.

    The basic statement requires a name, an algorithm, and an encryption mechanism. You cannot create a key that is unprotected in some way. Each of these has different possible values.

    You also can optionally add a KEY_SOURCE and an IDENITY_VALUE, which are used to recreate this key if it is removed (or in another database). You can also use a provider, if you have an EKM provider configured. Your CREATE would use the EKM provider and the name of the key from the provider to use in operations. If I want someone else to own this key, I can provide a user name or an application role.

    Here is the minimum key create (and the select and drop to check it).

    CREATE SYMMETRIC KEY SteveKey
      WITH ALGORITHM = AES_128
      ENCRYPTION BY PASSWORD = 'sdfs'
    GO  
    SELECT * FROM sys.symmetric_keys AS sk
    GO
    DROP SYMMETRIC KEY SteveKey
    GO

    This uses a specific algorithm, which I must provide. There are a number of choices, but in terms of practical choices in 2021, likely really only the AES ones make sense. For the encryption scheme, that depends on what you’ve set up in your system, but you can choose from

    • password
    • symmetric key
    • asymmetric key
    • certificate

    You choose the type and enter it, with the name of the object or the = with a password.

    That’s really the extent of creating a symmetric key. Any details with an EKM provider really come from the name used in the CREATE PROVIDER command.

    SQLNewBlogger

    This is something I’ve done a few times to learn how it works and practice implementing encryption. Ultimately, the key management makes most of the column level encryption seem silly, and really I’d do this in the application layer to ensure communications are protected.

    I took 20 minutes to write this up, copy some links, and showcase this. If you want to work in this area, do this as well. Practice this and write about what you’ve learned, the good, the bad, and the problems.

  • Daily Coping 2 Jun 2021

    I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here. All my coping tips are under this tag. 

    Today’s tip is to meet a friend outside today for a meal, a walk, or a chat.

    I called up a friend recently that I hadn’t seen in months. I’ve neglected getting together with people, and I wanted to do better. We had the chance to talk and chat and sit down for a meal, which was a great break from the normal routine of eating at my desk while working.

    I really miss contact with others, and I’m trying to get better at this, as we come out of the pandemic world.