private void ButtonDecrypt_Click(object sender, EventArgs e) { if (textBoxDecryptOriginal.TextLength == 0) { return; } var decrypt = chiper.Decrypt(textBoxDecryptOriginal.Text); textBoxDecrypt.Text = decrypt; }
public string Download(string filename, string key, int alg, Download form) { try { StoredFile sf = svc.Download(Username, filename, Token); byte[] f; switch (alg) { case 0: f = DoubleTransposition.Decrypt(sf.data, key, sf.hash); break; case 1: f = XTEA.Decrypt(sf.data, key, sf.hash); break; default: throw new Exception("You have not chosen an algorithm."); } form.Save(filename, f); return("File successfuly downloaded."); } catch (Exception e) { return(e.Message); } }