DPAPI Encryption string Pattern

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
 
R

Rob Teixeira [MVP]

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top