示例#1
0
        public BigInteger BerechneMessageAnhandEinesChiffratsUndPublicKeys(public_key publicKeyVonA, public_key publicKeyVonB, BigInteger chiffre)
        {
            p  = BerechneP(publicKeyVonA, publicKeyVonB);
            q1 = BerechneQ1(publicKeyVonA, p);
            q2 = BerechneQ2(publicKeyVonB, p);

            a = publicKeyVonA.e;
            b = BerechneB(p, q1);

            EuclidExtendedSolution solution = BerechneEEALösung(a, b);

            M = BerechneMessage(publicKeyVonA, chiffre, solution);
            return(M);
        }
示例#2
0
 public BigInteger BerechneMessage(public_key publicKeyVonA, BigInteger chiffre, EuclidExtendedSolution solution)
 {
     return(BigInteger.ModPow(chiffre, solution.X, publicKeyVonA.N));
 }
示例#3
0
 public BigInteger BerechneChiffrat(public_key publicKeyVonA, BigInteger M)
 {
     return(BigInteger.ModPow(M, publicKeyVonA.e, publicKeyVonA.N));
 }
示例#4
0
 public BigInteger BerechneQ2(public_key publicKeyVonB, BigInteger p)
 {
     return(publicKeyVonB.N / p);
 }
示例#5
0
 public static BigInteger BerechneQ1(public_key publicKeyVonA, BigInteger p)
 {
     return(publicKeyVonA.N / p);
 }
示例#6
0
 public static BigInteger BerechneP(public_key publicKeyVonA, public_key publicKeyVonB)
 {
     return(BigInteger.GreatestCommonDivisor(publicKeyVonA.N, publicKeyVonB.N));
 }