Je suis impatient de sécuriser mon fichier XML avec un standard de sécurité. Malheureusement, je ne pouvais pas trouver un moyen correct de crypter/décrypter mes données.UWP crypter/décrypter XmlSerializer
J'ai besoin de crypter le fichier avant qu'il ne soit créé. Comment puis-je sécuriser mon fichier, sinon?
Here's un extrait de mon XMLSerializer
public static async Task SaveObjectToXml<T>(T objectToSave,string Path , string filename)
{
// stores an object in XML format in file called 'filename'
var serializer = new XmlSerializer(typeof(T));
StorageFolder folder = await StorageFolder.GetFolderFromPathAsync(Path);
StorageFile file = await folder.CreateFileAsync(filename,CreationCollisionOption.ReplaceExisting);
Stream stream = await file.OpenStreamForWriteAsync();
using (stream)
{
serializer.Serialize(stream, objectToSave);
}
}
Un grand merci à l'avance!
C'était l'idée. Avez-vous une idée de comment crypter la chaîne à AES ?? J'ai lu un post sur le forum de Microsoft: https://social.msdn.microsoft.com/Forums/en-US/52080335-0016-4370-889b-3afe0c0dcb7a/how-to-do-simple-aes-encryptiondecryption- in-metro? forum = winappswithcsharp .... la dernière question est de comprendre pour quoi "passe-chaîne" est nécessaire et comment je peux le créer. –
Il fonctionne parfaitement maintenant! Merci de votre aide –