static string decrypt(string input) { string output = null; string key = Setting.userPassword; AESservice aes = new AESservice(xSalt, xAesIv); CryptObject cryptObject = aes.decrypt(input, key); if (cryptObject.operationSuccess) { output = cryptObject.value; } else { output = null; } return(output); }
void decrypt() { string ciphertext = getInput(textBox1); string password = getInput(textBox2); AESservice aesService = getAESsettings(); CryptObject cryptObject = aesService.decrypt(ciphertext, password); string output = cryptObject.value; if (cryptObject.operationSuccess) { printOutput(output); } else { MessageBox.Show(output, "Błąd", MessageBoxButtons.OK, MessageBoxIcon.Error); } }