locked
Move an existing SQL Server Compact 3.5 DB to an encrypted version RRS feed

  • Question

  • How can I convert an existing SQL Server Compact database into an encrypted version with password request?

    The application is written in Visual Studio Community 2017 with C #, LINQ to SQL, Click Once, and SQL Server Compact 3.5 SP2.

    The database consists of 11 tables that are linked together.

    Is it possible to encrypt this database? I realize that then the connection string must be adjusted.

    Friday, December 14, 2018 10:58 PM

Answers

  • You can do it from code: http://erikej.blogspot.com/2013/09/sql-server-compact-code-snippet-20.html 

    Or you can use one of my tools, for example "SQL Server Compact Toolbox" to set a password (from the maintenance menu)


    Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com

    • Proposed as answer by Alberto P. Silva Tuesday, December 18, 2018 5:07 PM
    • Marked as answer by Chris Schog Sunday, December 23, 2018 12:07 PM
    Sunday, December 16, 2018 7:30 AM

All replies

  • Hello Chris,

    see Securing Databases (SQL Server Compact) => Changing Passwords and Encryption Settings for a Database


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Saturday, December 15, 2018 6:25 AM
  • Hi Olaf, I have understood that this is possible during the creation of an database “You can create encrypted databases by supplying both encryption and password properties when the database is created. “ Can I also convert an existing DB? Or do I need to write a program to copy each table into a new encrypted DB? I guess that is like reinventing the wheel Regards Chris
    Saturday, December 15, 2018 6:55 AM
  • You can do it from code: http://erikej.blogspot.com/2013/09/sql-server-compact-code-snippet-20.html 

    Or you can use one of my tools, for example "SQL Server Compact Toolbox" to set a password (from the maintenance menu)


    Please mark as answer, if this was it. Visit my SQL Server Compact blog http://erikej.blogspot.com

    • Proposed as answer by Alberto P. Silva Tuesday, December 18, 2018 5:07 PM
    • Marked as answer by Chris Schog Sunday, December 23, 2018 12:07 PM
    Sunday, December 16, 2018 7:30 AM
  • Beware that the encryption mechanism for those databases does not resist to brute force attacks, since there's only a password to find and the engine itself does not have any protection to detect continuous password breaking attempts.

    Alberto Silva / www.moving2u.pt - R&D Manager / Former Microsoft MVP (2003-2015)

    Tuesday, December 18, 2018 5:11 PM
  • Hi Alberto,

    that is a very good suggestion. I will check that this evening.

    kind regards

    Chris

    Tuesday, December 18, 2018 5:21 PM
  • works perfectly. Thank you very much for the fast response. And yes, I am aware that a brute force attack may crack the password.

    Merry Christmas to all of you

    Chris

    Sunday, December 23, 2018 12:09 PM