Tag: syndicated

  • Goal Progress for May 2021

    I set goals at the beginning of the year, and I’m tracking my progress in these updates during 2021.

    As I look at goal progress for 2021, I’m going to follow a similar pattern as last year. I’ll give myself a current grade and report on overall progress in of the areas where I set goals.

    Current Grade: C+

    Again, I’m falling behind and I’ve been a little busy in life, so not doing much outside of work. I read a little, and some SQL Saturday things, but not much coding. I did get some project work done, so it wasn’t horrible, but as I’m winding down volleyball season, that’s eaten up time.

    Reading

    The goal was 4 books (3 non-fiction, 1 tech). Here’s the current progress:

    • Non fiction – Project to Product – 47%
    • Career – TBD
    • Career – TBD
    • Technical – TBD

    Technical Skills

    I’m solving the Advent of Code three times.  I’m also studying for certification. In terms of work here, I did do some coding, but not enough. I’m behind here and #7 is daunting, which slowed me a bit. Same as last month, I tried #7, but got stuck and gave up.

    • Certification –  AZ-900 – 5%
    • Certification – DP-200 – 0%
    • Skills – T-SQL – 2020 Advent of Code – 5/25
    • Skills – Python – 2020 Advent of Code – 6/25
    • Skills – PowerShell – 2020 Advent of Code – 5/25
    • Skills – TBD

    Projects

    I had a few projects for myself. Most of May was SQL Saturday stuff. So far things appear to be working fine. I did work on my PowerBI report a bit and it looks good so far.

    • SQL Saturday Inc – 90%
    • Support events: I spoke at another event and a user group
    • Speak at the 3 local user groups, at least one live presentation – 0%
    • Help organize a Denver/Colorado event, live or virtual – 20% (more conversations)
    • Complete my Power BI Volleyball report – I know lots of kids will use this, so I need to get it done – 60%
    • SQL Memorial – 90% – I updated this, sadly, as someone passed. I need to move this to straight GitHub Pages and get the custom domain set.

    Overall, SQL Saturday is really set. Incorporated and starting to contact people. Updates here: blog.sqlsaturday.com

  • Daily Coping 28 May 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 write down a place or event that you want to attend in the future.

    I am looking forward to live events, like SQL Saturdays, again. I really, really want to see some professional people and talk tech.

    However, for me, to try and start coping with a changed world, I have a simple thing. Actually two things. I want to go to a movie in a theater, and I want to go to a comedy club. I haven’t done either of those things in 15 months, and they are things I’ve enjoyed with my wife.

    My last comedy show was in Las Vegas, early last February. The last movie I think we saw was earlier, January or December 2019. I miss those breaks from life where my wife and I get out of the house and do something that’s fun.

    We’re vaccinated and things are changing, so I’m hoping we can do one of these things in the next few weeks.

  • Daily Coping 27 May 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 contact someone that you want to spend time with during the next year and start to make plans.

    I’m hoping to get some time with my extended family last year, and I’m looking forward to trying to rectify that this year. However, I have missed a few people locally in the last year that I’d like to get together with.

    For me, this is a few people I’ve known in the local area that remained quite locked down during this past year. I have a friend that moved to remote work, and I did see a couple times, but not enough. We’ve lost some touch, and need to make more time to get together.

    I reached out and set up some time to get together and reconnect. While the pandemic had me contacting a wider group of people, I lost some deeper touch with some others. I’m looking to try and fix that a bit in 2021.

  • A Basic Encryption Primer for SQL Server

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

    Encryption is a function call in SQL Server, where we pass in the text to encrypt and a key. That’s really what we are doing with encryption. I pass a key and data into a function and get either encrypted or decrypted data. Here’s a short example:

    Basic Encryption Demo

    Let’s say I have a simple message, like “Let’s meet at Kunjani Coffee at 8am.”. I want to protect this message.

    DECLARE
         @data VARCHAR(500) = 'Let''s meet at Kunjani Coffee at 8am.'
       , @encrypteddata VARBINARY(500);
    SELECT 'Plain Data', @data
    SELECT
         'Encrypted Data'
       , ENCRYPTBYPASSPHRASE ('mysecretk#y', @data) AS EncryptedData
    SELECT
         'Decrypted Data'
       , CAST(DECRYPTBYPASSPHRASE ('mysecretk#y', ENCRYPTBYPASSPHRASE ('mysecretk#y', @data)) AS VARCHAR(100)) AS DecryptedData
    SELECT
         'Almost Decrypted Data'
       , DECRYPTBYPASSPHRASE ('mysecretk#y', ENCRYPTBYPASSPHRASE ('mysecretk#y', @data)) AS AlmostDecryptedData;

    In this code, I’m using EncryptByPassPhrase and DecryptByPassPhrase to encrypt data. I pass in a key, which is my passphrase. That is “mysecretk#y” i this case. I then pass in the data and get the result returned. You can see the four results below:

    2021-05-17 12_31_35-SQLQuery1.sql - ARISTOTLE.sandbox (ARISTOTLE_Steve (59))_ - Microsoft SQL Server

    This is a quick example of the functions working together. I use one to hide the data, and another to reveal it.

    The Encryption Hierarchy

    Encryption is expensive in terms of resources (time, CPU, etc.), which means we want to minimize it. Part of what we do is try to minimize the work done while maximizing protection.

    We can double encrypt things, meaning I could take the result of the second query, and use that “encrypted data” string and use that in another encryption function and provide even more protection. The encryption of each string, however, is time and CPU intensive.

    Rather than encrypt the data again, we often just encrypt the keys. One key encrypts another and then the resource cost of decrypting a key is much lower than decrypting the data over and over. If you look at the encryption hierarchy on MS Docs, you’ll see that keys are stacked on each other, each one protecting the layer below. Typically we are only encrypting the actual data with a password or a symmetric key, which are essentially the same thing and the quickest way to perform the encryption and decryption.

    Let’s lightly look at the parts of this hierarchy.

    Asymmetric Keys

    The stronger keys are the asymmetric ones. They are called this because the key used for encryption is different than the key used for decryption. Typically these are paired together, and you can give someone 1 key, so they can only perform one operation.

    Certificates are asymmetric keys, with other metadata, and have the two keys as the public and private keys. This is how we do a lot of encryption across distances where we need to exchange data on insecure channels, like the Internet.

    These are computationally intensive, meaning lots of CPU and time, so we don’t usually want to use these to encrypt lots of data. Instead, we use these to encrypt or symmetric keys.

    Note: The strangeness in the SQL hierarchy is that the SMK and DMK are symmetric keys.

    Symmetric Keys

    The Symmetric keys are used for both encryption and decryption of the data. This doesn’t mean any key works, but the key used to specifically encrypt a set of data is the key used to decrypt it. This means we need to send the key to all parties that do encryption and decryption.

    These do require lots of CPU, but much less than asymmetric keys. Typically we use these to actually encrypt the data.

    Hash Functions

    This isn’t really encryption, but some hash functions are used for things like passwords, where we can have one-way encryption. These are often used to transform the data into a hash, or representation, and then we can compare the hash together.

    Using Encryption in Practice

    Each of these ideas is just a function call, and that is how we’ve implemented encryption in SQL Server. Whether you use TDE, Always Encrypted (AE), column level encryption, or anything else, you are making function calls in some way.

    For TDE and AE, SQL Server handles much of this work for you. It gets keys, does the function call. For the code above, or any of the ENCRYPT/DECRYPT functions, you are writing code and using those in your work.

    However, keep in mind that key management is the key to protecting things. This means how you protect them, where they are, how you copy them to other places, and change them over time.

    Summary

    Encryption is just a series of function calls. We have different types of functions and different parameters, but that’s really the core of what is happening.

    We can use these functions with the outputs of one as the inputs of another, or more often, the keys used as inputs instead of text, allowing us to encrypt and protect the keys themselves.

    There is a lot more to learn, but this gives a basic look at encryption in SQL Server.