Re: Help encrypt conn string - no ASP, no server, can't protect keys, can't use Windows Authentication



Hi,

you are right, there is no way to accomplish this - at least not with a mainstream operating system like Windows.

You will always hit the problem that if the application is able to decrypt the data (running in the users context), the user is able too.

You can try to set up all kinds of obstacles and raise the bar by making it harder to decrypt the data, but there is no bulletproof solution to this.

dominick

I've seen several questions posted since October regarding the
encryption of connection strings, but none of them seem to address my
particular need.

I want to deploy a .NET 2.0 Windows Forms application that uses an MS
Access 2003 database. The database has been encoded and password
protected to prevent direct manipulation. The database is used to
store application-related data, and access is controlled by the
application, which reads information from a user table in the
database. The application provides all authentication and
authorization for database activities. The application can't be used
unless the user authenticates with information stored in the user
table in the database.

I need a way to encrypt the connection string, which includes the
password, without hard-coding it in the application.

The application is targeted for Windows XP for use at home, but could
also be used on a machine connected to a network, such as an active
directory domain. This particular app isn't being designed to
interact with AD or a network environment.

The samples I've seen on the Internet use DPAPI and other encryption
schemes that seem to require keys, but, unless I didn't see it or
don't understand it, I don't see a way to generate encryption keys
during design time that can be deployed with any way of protecting the
keys.

I can't use Windows Authentication/Integrated Security because, given
the potential environments this application would be used in, there's
no guarantee that the person booting up and signing on the computer is
the actual intended user.

The example I've seen that uses ProtectedData clearly won't work
because once the connection string is encrypted, it can only be
decrypted on the machine it's being used on.

My understanding is that I can't use hashing because it creates a
1-way encryption, and I need to be able to decrypt it to connect to
the database.

I've been able to "encrypt" the connection string using AsnEncodeData
and put the results in the app.config file, and could probably do the
same thing with CryptoAPITransform, but it occurs to me that someone
that knows how to program in .NET could implement they're own
AsnEncodeData or CryptoAPITransform decoders to read the connection
string.

Is there any way to encrypt the connection string so it can't be
hacked in this situation?

Or do I need to create a second app that runs as a Custom Action
during deployment that encrypts the connection string for that machine
only?

TIA.

Dave



.



Relevant Pages

  • Re: Ecrypting a database
    ... Windows comes with a native file/folder encryption, ... account would need access to the database to unencrypt the ... >> I have a SQL database which will only be accessed only ...
    (microsoft.public.sqlserver.security)
  • Re: Help encrypt conn string - no ASP, no server, cant protect keys, cant use Windows Authentica
    ... per machine DPAPI encryption of the connection string is probably ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... The database has been encoded and password ...
    (microsoft.public.dotnet.security)
  • Help encrypt conn string - no ASP, no server, cant protect keys, cant use Windows Authentication
    ... The database has been encoded and password protected to ... I need a way to encrypt the connection string, which includes the password, ... The samples I've seen on the Internet use DPAPI and other encryption schemes ... that seem to require keys, but, unless I didn't see it or don't understand ...
    (microsoft.public.dotnet.security)
  • Re: Ecrypting a database
    ... Agreed Nick, There are some problems surely using ACLs and Windows ... > Windows comes with a native file/folder encryption, ... > account would need access to the database to unencrypt the ...
    (microsoft.public.sqlserver.security)
  • Re: The strongest alghorim?
    ... When you use an encrypted database, ... system has to use a fixed key to encrypt and decrypt ... This is how Windows Authentication ... > Did you try Google for VB encryption API? ...
    (microsoft.public.access.security)