Cryptography Reference
In-Depth Information
schemes in use provide a mechanism by which individuals must establish their identity with
an entity called a “Trusted Third Party” or TTP, when publishing their keys. If necessary,
these TTPs can establish that the individual using a certain set of keys is actually the per-
son he or she claims to be. The TTP does not need to know anyone's private keys to do this.
E XAMPLE . For simplicity's sake, we will use small parameters, and so that blocking will
not be an issue, we will arrange it so that n < n * .
Suppose individual A (the sender) chooses p = 7 and q = 19, so that n = 133. Individual
A chooses e = 5 as the encryption exponent, and computes d = e = 5 65 (mod 108).
Individual B (the recipient) chooses p * = 11 and q * = 23, so that n * = 253. Individual B
chooses e = 9 as the encryption exponent, and computes d = e = 9 49 (mod 253).
A wishes to send the message P = 93 to B with a signature. Individual A first computes
93 65
C 1
4 (mod 133)
No one else can do this because A's decryption exponent is private. Individual A then
encrypts using B's public encryption exponent and modulus:
C 4 9
36 (mod 253).
This is the final ciphertext, which is sent to B. C 1 is first recovered by decrypting with
B's private decryption exponent:
36 49
4 C 1 (mod 253).
No one can do this except B, and so privacy is assured. Finally, B uses A's public expo-
nent and modulus to recover the plaintext P :
4 5
93
P (mod 133).
Java Algorithm Writing the methods to sign with RSA in this way are easy since most
of the work has already been done. The methods to do this (from the Ciphers class) follow.
public static byte[] RSAEncipherSigned(
byte[] msg,
BigInteger dSender,
BigInteger nSender,
BigInteger eRecip,
BigInteger nRecip,
SecureRandom sr) {
return RSAEncipherWSalt
(RSAEncipherWSalt(msg,dSender,nSender,sr),eRecip,nRecip,sr);
}
public static byte[] RSADecipherSigned(
byte[] msg,
BigInteger dRecip,
BigInteger nRecip,
Search WWH ::




Custom Search