User:Pandar Mayur/sandbox

Caesar shift cryptography and RSA algorithm combination
(1). Introduction.

(2). Problem. (3). Solution 3.1 Algorithm steps. 3.2 RSA algorithm 3.3 RSA algorithm steps. Proof y^d = x^(ed)×mod(n) gcd(e, (p - 1)(q - 1)) = 1 ed = 1 + mod((p -1)(q - 1)) every K such that ed = 1 + K ×(p -1) × (q - 1) y^d = x^(ed) = x(1 + K × (p - 1) × (q - 1))mod(n) = x × x(k × (p - 1) ×(q -1))mod(n) gcd(x, p) = 1 x^(p -1) =1 × mod(p)(format little therom) gcd(x, q) = 1 x^(q -1) = 1 × mod(q) y^d =x × (x^(p - 1))^(K × (q - 1)) = x × mod(p) y^d = x ^ (x^(q - 1))^(K × (p -1)) = x × mod(q) y^d =x × mod(p × q)  y^d = x × mod(n) So, y^d = z then z = x×mod(n) So,z = x 4. Example. n = p × q = 5 ×7 = 35 e is gcd(e, (p - 1) × (q - 1)) = 1 gcd(e, 4 × 6) = 1 So, we choose e = 5 d = e^(-1)×mod((P - 1) × (q - 1)) d = 5^(-1) × mod(4 × 6) d = 5(-11) × mod(24) d = 5 y = x^e × mod(n) y = 35 × mod(35) y = 243 × mod(35) y = 33 z = y^d × mod(n) = (33)^5 × mod(35) = 39135393 × mod(35) z = 3 it shifted by -3 so, it's become "I am Mayur"{8,0,12,12,0,24,20,17}.
 * The world of this time is digital..
 * we need to protect our message and data.
 * Our algorithm is a little bits difference. We encode message by Caesar shift algorithm and pass the shift key to the receiver by RSA algorithm.
 * In this first steps we encode message by shift Caesar cryptography. Caesar cipher cryptography is the one of the oldest cryptography.
 * Caesar cipher Method named after Julius Caesar.
 * Who used it with shift of three to protect messages of military significance.
 * For example we have a message "Mayur"{12,0,24,20,17} is shifted by 3. So, it's become "Pdbxu"{15,3,1,23,20}
 * above message "Mayur" is called plaintext. and "Pdbxu" is called ciphertext.
 * Now we will public this encoded message.
 * Next we will move to RSA algorithm.
 * In the third step receiver need to decode this encoded message.for this sender send a shift key value by the RSA algorithm.
 * The RSA cryptosystem, invented by Ron Rivest, Adi Shamir, and Len Adleman[18], was first publicized in the August 1977 issue of       Scientific America n. The cryptosystem is most commonly used for providing privacy and ensuring authenticity of digital data. (Boneh et al., 1999)
 * In such a cryptosystem, the encryption key is public and it is different from the decryption key which is kept secret (private).(Rivest, n.d.)
 * 1) Choose large prime number p and q.
 * 2) Calculate n = p × q.
 * 3) Choose e ≠ 1 such that gcd(e, (p - 1)(q - 1)) = 1
 * 4) Compute d = e^(-1)×mod((p - 1)(q - 1))
 * 5) Public e & n (it called public key)
 * 6) d is secret(private) key.
 * 7) Compute y = x^e×mod(n)
 * 8) When compute the y and d send it to the receiver.
 * 9) Receiver compute z=y^d×mod(n)
 * Now we need to prove that this z is shift key.So, we need to prove that z = x
 * After reach shift key value to the receiver. Receiver decode the message that is public.For decode he/she use the complement of encoded shift key. For example above We encode Mayur{12,0,24,20,17} to Pdbxu{15,3,1,23,20}. So, this is hear we decode from Pdbxu{15,3,1,23,20} to Mayur.{12,0,24,20,17}
 * Now we give A message called "I am Mayur"{8,0,12,12,0,24,20,17} and it send to the Receiver.
 * we shifted it by 3. so it's Become "Ldppdbxu"{11,3,15,15,3,1,23,20}.
 * Now we move the RSA algorithm to send the shift key value(x).
 * We choose p = 5 and q = 7. So,
 * Now public e & n.
 * Find
 * calculate
 * I Send y and d to receiver.
 * I calculate the value of which is our shifting key.
 * So, our decode message got by encoded message shift by -3(complement of). our encoded message is "Ldppdbxu"{11,3,15,15,3,1,23,20}