How encryption in SQL login authentication worksDatabase encryption and key management with pg_cryptoSQL server windows authentication through networkHow does one query a SQL Server Linked Server when SQL Server Authentication is specified?Restore Database w Master Key and storing password in plain textRestore db with encrypted column in SQL Server, without overwriting existing Service Master KeySQL Server, connecting without windows authentication?Create a User and Password for ADO.net and SQL SERVER AuthenticationSSMS Permission Denied, Login with Windows AuthenticationHow to stop decrypting data after opening master key in SQL Server?How to grant or allow a particular SQL Server Login/User to always view a Column Level Encrypted data?

How are Core iX names like Core i5, i7 related to Haswell, Ivy Bridge?

International Code of Ethics for order of co-authors in research papers

Was the Highlands Ranch shooting the 115th mass shooting in the US in 2019

What did Rocket give Hawkeye in "Avengers: Endgame"?

Early arrival in Australia, early hotel check in not available

Adding slope values to attribute table (QGIS 3)

How can I answer high-school writing prompts without sounding weird and fake?

Remove everything except csv file Bash Script

Does Lawful Interception of 4G / the proposed 5G provide a back door for hackers as well?

Exception propagation: When to catch exceptions?

Is a diamond sword feasible?

Is it a bad idea to replace pull-up resistors with hard pull-ups?

Will change of address affect direct deposit?

Was this a power play by Daenerys?

Why does a C.D.F need to be right-continuous?

On studying Computer Science vs. Software Engineering to become a proficient coder

Cropping a message using array splits

How are one-time password generators like Google Authenticator different from having two passwords?

How to slow yourself down (for playing nice with others)

As programers say: Strive to be lazy

How old is Captain America at the end of "Avengers: Endgame"?

Was there ever any real use for a 6800-based Apple I?

We are two immediate neighbors who forged our own powers to form concatenated relationship. Who are we?

How can this pool heater gas line be disconnected?



How encryption in SQL login authentication works


Database encryption and key management with pg_cryptoSQL server windows authentication through networkHow does one query a SQL Server Linked Server when SQL Server Authentication is specified?Restore Database w Master Key and storing password in plain textRestore db with encrypted column in SQL Server, without overwriting existing Service Master KeySQL Server, connecting without windows authentication?Create a User and Password for ADO.net and SQL SERVER AuthenticationSSMS Permission Denied, Login with Windows AuthenticationHow to stop decrypting data after opening master key in SQL Server?How to grant or allow a particular SQL Server Login/User to always view a Column Level Encrypted data?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








5















I am going through the below link



https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/authentication-in-sql-server



and in that it says




When SQL Server logins are used, SQL Server login names and encrypted
passwords are passed across the network, which makes them less secure.




how are the password encrypted and how does sql server decrypt it? What kind of encryption is involved in it?










share|improve this question




























    5















    I am going through the below link



    https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/authentication-in-sql-server



    and in that it says




    When SQL Server logins are used, SQL Server login names and encrypted
    passwords are passed across the network, which makes them less secure.




    how are the password encrypted and how does sql server decrypt it? What kind of encryption is involved in it?










    share|improve this question
























      5












      5








      5


      1






      I am going through the below link



      https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/authentication-in-sql-server



      and in that it says




      When SQL Server logins are used, SQL Server login names and encrypted
      passwords are passed across the network, which makes them less secure.




      how are the password encrypted and how does sql server decrypt it? What kind of encryption is involved in it?










      share|improve this question














      I am going through the below link



      https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/authentication-in-sql-server



      and in that it says




      When SQL Server logins are used, SQL Server login names and encrypted
      passwords are passed across the network, which makes them less secure.




      how are the password encrypted and how does sql server decrypt it? What kind of encryption is involved in it?







      sql-server sql-server-2014 encryption






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 1 at 8:11









      ioquestionioquestion

      362




      362




















          2 Answers
          2






          active

          oldest

          votes


















          7















          how are the password encrypted and how does sql server decrypt it? What kind of encryption is involved in it?




          Super high level, if you have encryption setup for the instance then the certificate that is configured can be used. If you don't have it enabled, the self-signed certificate created on SQL Server startup will be used.



          Regardless of which is used, the SSL/TLS setup for this is done during the pre-login negotation phase. If, however, encryption is either not set or enforced, the TLS/SSL portion will only be active for the length of the credential transfer and will immediately go back to plain text (no SSL/TLS) once this is completed for the life of the connection.



          SQL Server itself doesn't encrypt or decrypt the data, it's encrypted and decrypted in transit only. Depending on your client driver and application, this may or may not exist in plain text in your process memory space. Additionally, SQL Server uses hashes to check the passwords and doesn't store the original plain text password for SQL logins (unless you want to be pedantic about proxy accounts and linked servers).






          share|improve this answer

























          • Actually that depends on the driver, by default jTDS for example does not use partial TLS for the handshake. So there is only a Minor Obfuscation or NTLM (and unfortunately LM Hashes) which gets send (in clear) for that driver. (And short than turning Force encryption on it seems not posssible to reject this)

            – eckes
            May 1 at 16:21






          • 1





            1) Hence why I said it depends on your driver. 2) The official TDS specification calls out what has to happen, at a minimum. Violation of that could cause other issues. For example, there is also FreeTDS and I have no idea if it follows spec. Pass the hash is a different issue, and we could do down a long dark road about owning the server and decrypting all of the SSL/TLS traffic. This is why I kept it "HighLevel" :) @eckes

            – Sean Gallardy
            May 1 at 16:39


















          3














          I agree with all the points Sean made in his answer.



          However, I think the point the Docs page is trying to make is that Kerberos authentication via Windows never1 passes the password across the network. SQL authentication does, which means there is a chance that someone capturing packets might be able to decrypt that password and login to the SQL Server.



          Windows Authentication is based on tokens. When you login, your account is given a token by the login authority that can be passed around across the network and confirmed by the login authority without the possibility of compromising the account password.



          As a result, SQL Server authentication is less secure than Windows Authentication.






          share|improve this answer




















          • 1





            Yes, this is a great point and I believe that's the basis for the text in the Docs page. If you and the OP believe this, let me know and I'll edit the Docs page to be less ambiguous.

            – Sean Gallardy
            May 1 at 14:50











          • Actually NTLM might pass a hash which can be brute forced (or stolen for v1). It only uses tokens when Kerberos (or the newer Azure AD Token stuff) is used.

            – eckes
            May 1 at 16:23







          • 1





            True, @eckes - I should have noted the gotchas with NTLM

            – Max Vernon
            May 1 at 16:51











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "182"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f237106%2fhow-encryption-in-sql-login-authentication-works%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          7















          how are the password encrypted and how does sql server decrypt it? What kind of encryption is involved in it?




          Super high level, if you have encryption setup for the instance then the certificate that is configured can be used. If you don't have it enabled, the self-signed certificate created on SQL Server startup will be used.



          Regardless of which is used, the SSL/TLS setup for this is done during the pre-login negotation phase. If, however, encryption is either not set or enforced, the TLS/SSL portion will only be active for the length of the credential transfer and will immediately go back to plain text (no SSL/TLS) once this is completed for the life of the connection.



          SQL Server itself doesn't encrypt or decrypt the data, it's encrypted and decrypted in transit only. Depending on your client driver and application, this may or may not exist in plain text in your process memory space. Additionally, SQL Server uses hashes to check the passwords and doesn't store the original plain text password for SQL logins (unless you want to be pedantic about proxy accounts and linked servers).






          share|improve this answer

























          • Actually that depends on the driver, by default jTDS for example does not use partial TLS for the handshake. So there is only a Minor Obfuscation or NTLM (and unfortunately LM Hashes) which gets send (in clear) for that driver. (And short than turning Force encryption on it seems not posssible to reject this)

            – eckes
            May 1 at 16:21






          • 1





            1) Hence why I said it depends on your driver. 2) The official TDS specification calls out what has to happen, at a minimum. Violation of that could cause other issues. For example, there is also FreeTDS and I have no idea if it follows spec. Pass the hash is a different issue, and we could do down a long dark road about owning the server and decrypting all of the SSL/TLS traffic. This is why I kept it "HighLevel" :) @eckes

            – Sean Gallardy
            May 1 at 16:39















          7















          how are the password encrypted and how does sql server decrypt it? What kind of encryption is involved in it?




          Super high level, if you have encryption setup for the instance then the certificate that is configured can be used. If you don't have it enabled, the self-signed certificate created on SQL Server startup will be used.



          Regardless of which is used, the SSL/TLS setup for this is done during the pre-login negotation phase. If, however, encryption is either not set or enforced, the TLS/SSL portion will only be active for the length of the credential transfer and will immediately go back to plain text (no SSL/TLS) once this is completed for the life of the connection.



          SQL Server itself doesn't encrypt or decrypt the data, it's encrypted and decrypted in transit only. Depending on your client driver and application, this may or may not exist in plain text in your process memory space. Additionally, SQL Server uses hashes to check the passwords and doesn't store the original plain text password for SQL logins (unless you want to be pedantic about proxy accounts and linked servers).






          share|improve this answer

























          • Actually that depends on the driver, by default jTDS for example does not use partial TLS for the handshake. So there is only a Minor Obfuscation or NTLM (and unfortunately LM Hashes) which gets send (in clear) for that driver. (And short than turning Force encryption on it seems not posssible to reject this)

            – eckes
            May 1 at 16:21






          • 1





            1) Hence why I said it depends on your driver. 2) The official TDS specification calls out what has to happen, at a minimum. Violation of that could cause other issues. For example, there is also FreeTDS and I have no idea if it follows spec. Pass the hash is a different issue, and we could do down a long dark road about owning the server and decrypting all of the SSL/TLS traffic. This is why I kept it "HighLevel" :) @eckes

            – Sean Gallardy
            May 1 at 16:39













          7












          7








          7








          how are the password encrypted and how does sql server decrypt it? What kind of encryption is involved in it?




          Super high level, if you have encryption setup for the instance then the certificate that is configured can be used. If you don't have it enabled, the self-signed certificate created on SQL Server startup will be used.



          Regardless of which is used, the SSL/TLS setup for this is done during the pre-login negotation phase. If, however, encryption is either not set or enforced, the TLS/SSL portion will only be active for the length of the credential transfer and will immediately go back to plain text (no SSL/TLS) once this is completed for the life of the connection.



          SQL Server itself doesn't encrypt or decrypt the data, it's encrypted and decrypted in transit only. Depending on your client driver and application, this may or may not exist in plain text in your process memory space. Additionally, SQL Server uses hashes to check the passwords and doesn't store the original plain text password for SQL logins (unless you want to be pedantic about proxy accounts and linked servers).






          share|improve this answer
















          how are the password encrypted and how does sql server decrypt it? What kind of encryption is involved in it?




          Super high level, if you have encryption setup for the instance then the certificate that is configured can be used. If you don't have it enabled, the self-signed certificate created on SQL Server startup will be used.



          Regardless of which is used, the SSL/TLS setup for this is done during the pre-login negotation phase. If, however, encryption is either not set or enforced, the TLS/SSL portion will only be active for the length of the credential transfer and will immediately go back to plain text (no SSL/TLS) once this is completed for the life of the connection.



          SQL Server itself doesn't encrypt or decrypt the data, it's encrypted and decrypted in transit only. Depending on your client driver and application, this may or may not exist in plain text in your process memory space. Additionally, SQL Server uses hashes to check the passwords and doesn't store the original plain text password for SQL logins (unless you want to be pedantic about proxy accounts and linked servers).







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 1 at 12:43

























          answered May 1 at 11:21









          Sean GallardySean Gallardy

          17.7k22756




          17.7k22756












          • Actually that depends on the driver, by default jTDS for example does not use partial TLS for the handshake. So there is only a Minor Obfuscation or NTLM (and unfortunately LM Hashes) which gets send (in clear) for that driver. (And short than turning Force encryption on it seems not posssible to reject this)

            – eckes
            May 1 at 16:21






          • 1





            1) Hence why I said it depends on your driver. 2) The official TDS specification calls out what has to happen, at a minimum. Violation of that could cause other issues. For example, there is also FreeTDS and I have no idea if it follows spec. Pass the hash is a different issue, and we could do down a long dark road about owning the server and decrypting all of the SSL/TLS traffic. This is why I kept it "HighLevel" :) @eckes

            – Sean Gallardy
            May 1 at 16:39

















          • Actually that depends on the driver, by default jTDS for example does not use partial TLS for the handshake. So there is only a Minor Obfuscation or NTLM (and unfortunately LM Hashes) which gets send (in clear) for that driver. (And short than turning Force encryption on it seems not posssible to reject this)

            – eckes
            May 1 at 16:21






          • 1





            1) Hence why I said it depends on your driver. 2) The official TDS specification calls out what has to happen, at a minimum. Violation of that could cause other issues. For example, there is also FreeTDS and I have no idea if it follows spec. Pass the hash is a different issue, and we could do down a long dark road about owning the server and decrypting all of the SSL/TLS traffic. This is why I kept it "HighLevel" :) @eckes

            – Sean Gallardy
            May 1 at 16:39
















          Actually that depends on the driver, by default jTDS for example does not use partial TLS for the handshake. So there is only a Minor Obfuscation or NTLM (and unfortunately LM Hashes) which gets send (in clear) for that driver. (And short than turning Force encryption on it seems not posssible to reject this)

          – eckes
          May 1 at 16:21





          Actually that depends on the driver, by default jTDS for example does not use partial TLS for the handshake. So there is only a Minor Obfuscation or NTLM (and unfortunately LM Hashes) which gets send (in clear) for that driver. (And short than turning Force encryption on it seems not posssible to reject this)

          – eckes
          May 1 at 16:21




          1




          1





          1) Hence why I said it depends on your driver. 2) The official TDS specification calls out what has to happen, at a minimum. Violation of that could cause other issues. For example, there is also FreeTDS and I have no idea if it follows spec. Pass the hash is a different issue, and we could do down a long dark road about owning the server and decrypting all of the SSL/TLS traffic. This is why I kept it "HighLevel" :) @eckes

          – Sean Gallardy
          May 1 at 16:39





          1) Hence why I said it depends on your driver. 2) The official TDS specification calls out what has to happen, at a minimum. Violation of that could cause other issues. For example, there is also FreeTDS and I have no idea if it follows spec. Pass the hash is a different issue, and we could do down a long dark road about owning the server and decrypting all of the SSL/TLS traffic. This is why I kept it "HighLevel" :) @eckes

          – Sean Gallardy
          May 1 at 16:39













          3














          I agree with all the points Sean made in his answer.



          However, I think the point the Docs page is trying to make is that Kerberos authentication via Windows never1 passes the password across the network. SQL authentication does, which means there is a chance that someone capturing packets might be able to decrypt that password and login to the SQL Server.



          Windows Authentication is based on tokens. When you login, your account is given a token by the login authority that can be passed around across the network and confirmed by the login authority without the possibility of compromising the account password.



          As a result, SQL Server authentication is less secure than Windows Authentication.






          share|improve this answer




















          • 1





            Yes, this is a great point and I believe that's the basis for the text in the Docs page. If you and the OP believe this, let me know and I'll edit the Docs page to be less ambiguous.

            – Sean Gallardy
            May 1 at 14:50











          • Actually NTLM might pass a hash which can be brute forced (or stolen for v1). It only uses tokens when Kerberos (or the newer Azure AD Token stuff) is used.

            – eckes
            May 1 at 16:23







          • 1





            True, @eckes - I should have noted the gotchas with NTLM

            – Max Vernon
            May 1 at 16:51















          3














          I agree with all the points Sean made in his answer.



          However, I think the point the Docs page is trying to make is that Kerberos authentication via Windows never1 passes the password across the network. SQL authentication does, which means there is a chance that someone capturing packets might be able to decrypt that password and login to the SQL Server.



          Windows Authentication is based on tokens. When you login, your account is given a token by the login authority that can be passed around across the network and confirmed by the login authority without the possibility of compromising the account password.



          As a result, SQL Server authentication is less secure than Windows Authentication.






          share|improve this answer




















          • 1





            Yes, this is a great point and I believe that's the basis for the text in the Docs page. If you and the OP believe this, let me know and I'll edit the Docs page to be less ambiguous.

            – Sean Gallardy
            May 1 at 14:50











          • Actually NTLM might pass a hash which can be brute forced (or stolen for v1). It only uses tokens when Kerberos (or the newer Azure AD Token stuff) is used.

            – eckes
            May 1 at 16:23







          • 1





            True, @eckes - I should have noted the gotchas with NTLM

            – Max Vernon
            May 1 at 16:51













          3












          3








          3







          I agree with all the points Sean made in his answer.



          However, I think the point the Docs page is trying to make is that Kerberos authentication via Windows never1 passes the password across the network. SQL authentication does, which means there is a chance that someone capturing packets might be able to decrypt that password and login to the SQL Server.



          Windows Authentication is based on tokens. When you login, your account is given a token by the login authority that can be passed around across the network and confirmed by the login authority without the possibility of compromising the account password.



          As a result, SQL Server authentication is less secure than Windows Authentication.






          share|improve this answer















          I agree with all the points Sean made in his answer.



          However, I think the point the Docs page is trying to make is that Kerberos authentication via Windows never1 passes the password across the network. SQL authentication does, which means there is a chance that someone capturing packets might be able to decrypt that password and login to the SQL Server.



          Windows Authentication is based on tokens. When you login, your account is given a token by the login authority that can be passed around across the network and confirmed by the login authority without the possibility of compromising the account password.



          As a result, SQL Server authentication is less secure than Windows Authentication.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited May 1 at 16:55

























          answered May 1 at 14:13









          Max VernonMax Vernon

          53.2k13116234




          53.2k13116234







          • 1





            Yes, this is a great point and I believe that's the basis for the text in the Docs page. If you and the OP believe this, let me know and I'll edit the Docs page to be less ambiguous.

            – Sean Gallardy
            May 1 at 14:50











          • Actually NTLM might pass a hash which can be brute forced (or stolen for v1). It only uses tokens when Kerberos (or the newer Azure AD Token stuff) is used.

            – eckes
            May 1 at 16:23







          • 1





            True, @eckes - I should have noted the gotchas with NTLM

            – Max Vernon
            May 1 at 16:51












          • 1





            Yes, this is a great point and I believe that's the basis for the text in the Docs page. If you and the OP believe this, let me know and I'll edit the Docs page to be less ambiguous.

            – Sean Gallardy
            May 1 at 14:50











          • Actually NTLM might pass a hash which can be brute forced (or stolen for v1). It only uses tokens when Kerberos (or the newer Azure AD Token stuff) is used.

            – eckes
            May 1 at 16:23







          • 1





            True, @eckes - I should have noted the gotchas with NTLM

            – Max Vernon
            May 1 at 16:51







          1




          1





          Yes, this is a great point and I believe that's the basis for the text in the Docs page. If you and the OP believe this, let me know and I'll edit the Docs page to be less ambiguous.

          – Sean Gallardy
          May 1 at 14:50





          Yes, this is a great point and I believe that's the basis for the text in the Docs page. If you and the OP believe this, let me know and I'll edit the Docs page to be less ambiguous.

          – Sean Gallardy
          May 1 at 14:50













          Actually NTLM might pass a hash which can be brute forced (or stolen for v1). It only uses tokens when Kerberos (or the newer Azure AD Token stuff) is used.

          – eckes
          May 1 at 16:23






          Actually NTLM might pass a hash which can be brute forced (or stolen for v1). It only uses tokens when Kerberos (or the newer Azure AD Token stuff) is used.

          – eckes
          May 1 at 16:23





          1




          1





          True, @eckes - I should have noted the gotchas with NTLM

          – Max Vernon
          May 1 at 16:51





          True, @eckes - I should have noted the gotchas with NTLM

          – Max Vernon
          May 1 at 16:51

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Database Administrators Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f237106%2fhow-encryption-in-sql-login-authentication-works%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

          What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

          Why did Thanos need his ship to help him in the battle scene?Which actor plays Thanos in the Avengers mid-credits scene?Are there economic implications portrayed in comics where the buildings and cities are ruined almost daily?Old X-Men comic where team travels to alien world with a ring-like sun that needs recharging?Why does Ego need help sleeping?Is there an objective answer to who “the strongest Avenger” is?How did Banner get unstuck?Why did Thanos get hit?How did Thanos (or anyone) know the Infinity Stones would give him this power?Did Thanos leave Eitri alive for his after-sales service?In Avengers 1, why does Thanos need Loki?