Example #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);
        }
Example #2
0
 public BigInteger BerechneMessage(public_key publicKeyVonA, BigInteger chiffre, EuclidExtendedSolution solution)
 {
     return(BigInteger.ModPow(chiffre, solution.X, publicKeyVonA.N));
 }
Example #3
0
 public BigInteger BerechneChiffrat(public_key publicKeyVonA, BigInteger M)
 {
     return(BigInteger.ModPow(M, publicKeyVonA.e, publicKeyVonA.N));
 }
Example #4
0
 public BigInteger BerechneQ2(public_key publicKeyVonB, BigInteger p)
 {
     return(publicKeyVonB.N / p);
 }
Example #5
0
 public static BigInteger BerechneQ1(public_key publicKeyVonA, BigInteger p)
 {
     return(publicKeyVonA.N / p);
 }
Example #6
0
 public static BigInteger BerechneP(public_key publicKeyVonA, public_key publicKeyVonB)
 {
     return(BigInteger.GreatestCommonDivisor(publicKeyVonA.N, publicKeyVonB.N));
 }