private async Task Logon() { Key = CryptoInterface.GestAesKey(LoginPasswordBox.Password); LoginPasswordBox.Password = ""; IBuffer A = await StorageInterface.ReadBufferFromRoamingFolder("PWM/A"); IBuffer B = await StorageInterface.ReadBufferFromRoamingFolder("PWM/B"); //Debug.WriteLine("Up to here I believe this to be OK"); //Debug.WriteLine(LoginPasswordBox.Password.GetHexString()); //Debug.WriteLine(Key); IBuffer EA = CryptoInterface.EncryptAes(Key, A); //Debug.WriteLine("Now this could be unreachable code"); if (!CryptographicBuffer.Compare(B, EA))//Falsches Passwort, da die testfiles nicht zampassen { Debug.WriteLine("FALSCHES PASSWORT"); await UserInteraction.ShowDialogAsync("INFORMATION", "Falsches Passwort!"); return; } Debug.WriteLine("HAVE DONE SETUP WITH PASSWORD"); MODE_REGULAR.Visibility = MODE_REGULAR_BAR.Visibility = Visibility.Visible; MODE_LOGIN.Visibility = MODE_SETUP.Visibility = Visibility.Collapsed; await Refresh(); }
private async void InitialSetupButton_Click(object sender, RoutedEventArgs e) { String PWD = SetupAPasswordBox.Password; Debug.WriteLine(PWD); Key = CryptoInterface.GestAesKey(PWD); IBuffer X = CryptoInterface.CreateTestfile(); await StorageInterface.WriteBufferToRoamingFolder("PWM/A", X); await StorageInterface.WriteBufferToRoamingFolder("PWM/B", CryptoInterface.EncryptAes(Key, X)); await CryptoInterface.InitialSetup(Key); await CryptoInterface.StorePasswords("Dieser Passwortmanager" + INTRASPLIT + "Kein Benutzername" + INTRASPLIT + PWD + INTERSPLIT, Key); Debug.WriteLine("HAVE DONE SETUP WITH PASSWORD"); MODE_REGULAR.Visibility = MODE_REGULAR_BAR.Visibility = Visibility.Visible; MODE_LOGIN.Visibility = MODE_SETUP.Visibility = Visibility.Collapsed; await Refresh(); }