public static async Task Save(string type) { FileSavePicker fs = new FileSavePicker(); string ext = Bifid_Cipher.Decrypt(Encoding.ASCII.GetString(((List <byte>)GetData.Extract[Data.Misc.DataExtension]).ToArray())); fs.FileTypeChoices.Add(Validate.IsType(ext), new List <string>() { ext }); fs.SuggestedFileName = Bifid_Cipher.Decrypt(Encoding.ASCII.GetString(((List <byte>)GetData.Extract[Data.Misc.DataNameFile]).ToArray())); StorageFile sf = await fs.PickSaveFileAsync(); if (sf != null) { switch (type) { case "File": await FileIO.WriteBytesAsync(sf, ((List <byte>)GetData.Extract[Data.Misc.DataSecret]).ToArray()); break; case "Message": await FileIO.WriteTextAsync(sf, await Bifid_Cipher.Execute("Extract", Encoding.ASCII.GetString(((List <byte>)GetData.Extract[Data.Misc.DataSecret]).ToArray()), String.Empty)); break; } ToastDialog.ShowData(sf, Validate.IsType(ext), "Embedded File", Detail.Extract_FileMessage); await PopupDialog.Show(Status.Success, Detail.Extract_FileMessage, Complete.Saved_SecretFile, Icon.Smile); } else { await PopupDialog.Show(Status.Err, Detail.Extract_FileMessage, Err.NotSaved_SecretFile, Icon.Sad); } }
public static bool Password(string passwd) { string x = Encoding.ASCII.GetString(((List <byte>)GetData.Extract[Data.Misc.DataPassword]).ToArray()); if (Bifid_Cipher.Decrypt(x) == passwd) { return(true); } else { return(false); } }