예제 #1
0
        public BigInteger decryptedDigest(DSASignedString signedText, SignKey key)
        {
            BigInteger w  = signedText.S.ModInverse(Domain.Q);
            BigInteger d  = digest(signedText.Text);
            BigInteger u1 = (d * w) % Domain.Q;
            BigInteger u2 = (signedText.R * w) % Domain.Q;
            BigInteger v  = ((BigInteger.ModPow(Domain.G, u1, Domain.P) * BigInteger.ModPow(key.Value, u2, Domain.P)) % Domain.P) % Domain.Q;

            CheckSignatureIntermediateValues = String.Format("W: {0:D}, h(M'): {1:D}, u1: {2:D}, u2: {3:D}, V: {4:D}, R: {5:D}, S: {6:D}, Y: {7:D}", w, d, u1, u2, v, signedText.R, signedText.S, key.Value);
            return(v);
        }
예제 #2
0
 public BigInteger decryptedDigest(DSASignedString signedText, SignKey key)
 {
     BigInteger w = signedText.S.ModInverse(Domain.Q);
     BigInteger d = digest(signedText.Text);
     BigInteger u1 = (d * w) % Domain.Q;
     BigInteger u2 = (signedText.R * w) % Domain.Q;
     BigInteger v = ((BigInteger.ModPow(Domain.G, u1, Domain.P) * BigInteger.ModPow(key.Value, u2, Domain.P)) % Domain.P) % Domain.Q;
     CheckSignatureIntermediateValues = String.Format("W: {0:D}, h(M'): {1:D}, u1: {2:D}, u2: {3:D}, V: {4:D}, R: {5:D}, S: {6:D}, Y: {7:D}", w, d, u1, u2, v, signedText.R, signedText.S, key.Value);
     return v;
 }
예제 #3
0
 public bool checkSignature(DSASignedString signedText, SignKey key)
 {
     return decryptedDigest(signedText, key) == signedText.R;
 }
예제 #4
0
 public bool checkSignature(DSASignedString signedText, SignKey key)
 {
     return(decryptedDigest(signedText, key) == signedText.R);
 }