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