byte[] x_plaintext = Encoding.Default.GetBytes(TextBox7.Text); // create a hash code for the plaintext, using the SHA-1 algorithm byte[] x_hashcode = HashAlgorithm.Create("SHA1").ComputeHash(x_plaintext); // create an instance of the DSA implementation class DSACryptoServiceProvider x_dsa = new DSACryptoServiceProvider(); // create the signature formatter DSASignatureFormatter x_formatter = new DSASignatureFormatter(); // set the instance of the DSA algorithm that will sign the data x_formatter.SetKey(x_dsa); // set the name of the hashing algorithm we used to create the hash code x_formatter.SetHashAlgorithm("SHA1"); // create the formatted DSA signature byte[] x_signature = x_formatter.CreateSignature(x_hashcode); TextBox8.Text = Convert.ToBase64String(x_signature);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)