Hey mensen,
Ik ben bezig met een app waarvan ik de UserSettings en/of de ApplicationSettings versleuteld wil opslaan.
Ben al een aantal samples en websites verder. Het is mogelijk gebruik te maken van standaard versleuteling:
Alleen in mijn config blijf ik steeds de onversleutelde data zien:
EncryptedSettings is trouwens de naam van mij test applicatie.
Ik heb al wat lopen spelen en heb ook al eens alle ConfigSections versleuteld, maar het deeltje wat ik in mijn My.Settings heb staan dat versleutelt niet.
Ik ben bezig met een app waarvan ik de UserSettings en/of de ApplicationSettings versleuteld wil opslaan.
Ben al een aantal samples en websites verder. Het is mogelijk gebruik te maken van standaard versleuteling:
Visual Basic .NET:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
| Private Sub EncryptConfigSection(ByVal sectionKey As String) Dim config As Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None) Dim section As ConfigurationSection = config.GetSection(sectionKey) If Not (section Is Nothing) Then If Not section.SectionInformation.IsProtected Then If Not section.SectionInformation.IsLocked Then section.SectionInformation.ProtectSection("DataProtectionConfigurationProvider") section.SectionInformation.ForceSave = True config.Save(ConfigurationSaveMode.Full) End If End If End If End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click EncryptConfigSection("userSettings") End Sub |
Alleen in mijn config blijf ik steeds de onversleutelde data zien:
XML:
1
2
3
4
5
6
7
| <applicationSettings> <EncryptedSettings.My.MySettings> <setting name="Password" serializeAs="String"> <value>Plain text password</value> </setting> </EncryptedSettings.My.MySettings> </applicationSettings> |
EncryptedSettings is trouwens de naam van mij test applicatie.
Ik heb al wat lopen spelen en heb ook al eens alle ConfigSections versleuteld, maar het deeltje wat ik in mijn My.Settings heb staan dat versleutelt niet.