DPAPI Encryption string Pattern

  • Thread starter Thread starter Shaun
  • Start date Start date
S

Shaun

Hi,
I'm trying to implement encryption of connection string using DPAPI
User Store.
One of the objective is, after reading the connection string from
Web.config file, my program has to know if the string is encrypted or
a regular connection string, & depending on this my application uses
the connection string or decrupts & reads the connection string.

I don't want to append any special characters into the string, or want
to add in any special attribute to XML section of web.config file.
I need to read a pattern of the encrypted string from DPAPI, & decide
weather it is encrypted or not.

Can anybody help me with a repeated pattern of Hashing, or some
special repeated characters I could use to compare & check if the
string is encrypted or not.

A help is greatly appreciated.
Thanking you
Shaun
 
I don't believe you are going to succeed in that.
My advice is to just add ONE line in the config file to the AppSettings
node. Something like:
<add key="encryptConnectString" value="On">

Then, in code, you can use the following:

If AppSettings("encryptConnectString") = "On" Then ...

-Rob Teixeira [MVP]
 
Back
Top