Public key algorithm -RSA algorithm

Plain text x = 200412

p = 499, q = 929 (p, q is a prime)

n = p×q = 499×929 =463571

φ(n) = (p-1)(q-1) = (499-1) (929-1) = 462144

Preparative a = 255157, b = 9949 (ab mod φ (n) = 1, 255157 × 9949 = 462144 × 5493 + 1)

encryption:

密文y = x b mod n = 200412 9949 against 463571 = 418883

Decryption:

Mitsubun = Y X A Mod N = 418883 255157 Mod 463517 = 200412

Guess you like

Origin www.cnblogs.com/holaworld/p/11725834.html