Section.SectionInformation.ForceSave
(1)
RsaProtectedConfigurationProvider
(1)
GetSection
(1)
Encrypt
(1)
Shift
(1)
SSectionName
(1)
IsNot
(1)
MyKey
(1)

Encrypt a Key in app.config

Asked By Ryan
12-Mar-10 02:06 PM
The following code encrypts the entire section of <appSettings> in app.config.
How do I encrypt only a Key (MyKey) in that section; not the entire section?
e.g.

Private Sub ProtectSection(ByVal sSectionName As [String])
Dim config As Configuration =
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
Dim section As ConfigurationSection = config.GetSection(sSectionName)
If section IsNot Nothing Then
If Not section.IsReadOnly() Then

section.SectionInformation.ProtectSection("RsaProtectedConfigurationProvider")
section.SectionInformation.ForceSave = True
config.Save(ConfigurationSaveMode.Modified)
End If
End If
End Sub

"Ryan" wrote:About the best you could do is come up with some kind of keyboard

Mr. Arnold replied to Ryan
12-Mar-10 04:20 PM
About the best you could do is come up with some kind of keyboard key
strokes encryption of  Shift-key, non Shift-key, Ctrl-Key, non Ctrl-key,
alpha, numeric, and special keys key combination sequence to come up with an
encrypted key for MyKeyValue.

You could get some kind of free Keylogger so you can see the results of the
keystrokes and make it a long sequence. The longer the sequence makes it
harder to crack.

You can use Google, as you might see some free code that will do it for you.
Post Question To EggHeadCafe