Due in (3) days max..
Write a program as described below first in Java and then again in Kotlin. In both cases, the difficult operations are available to you in java.lang.BigInteger.
Perform the basic math in encrypting and decrypting messages in the Rivest-Shamir-Adleman cryptosystem, a cryptosystem for public-key encryption The input consists of any number of lines of plain text and of encrypted text. The text in the case will be a single number, possibly large (but not too large).
message 981723918274
message 8432981723918274
cipher 9834598734559
message 2314986213123475435
The output of the program is of the same from, except the plain text has been replaced by the encrypted text and vice versa.
The program is an involution, that is to say, it is its own inverse. Running the program again on its output will result in the original input.
There are only a few key values in the program:
message -- a number (the plain text)
cipher -- a number (the encrypted message)
p, q -- two primes
totient -- (p-1)(q-1)
e -- the public key (for our purposes a prime number)
d -- the modular multiplicative inverse of e mod the totient
Encryption:
Encryption is simple (a single function call). Raise the message to the power e mod the product of the primes p and q.
Decryption:
Decryption is simple (a single function call). Raise the cipher to the power d mod the product of the primes p and q.
Key Generation:
For the scheme to work we need to generate three primes. For the results to be reproducible we must generate the same three primes. To do this we require the program to take two properties seed and bits. The program will be run like this:
java -Dseed=23434 -Dbits=100 RSA
kotlin -Dseed=23434 -Dbits=100 RSA
Create the primes p, q, and e in that order using the probablePrime function with the arguments bits and a random number generator using the given seed.
Programs with the same seed, the same bits, and the same input will produce the same output.
Sample Input/Output:
For -Dseed=23434 -Dbits=100 and the input:
message 981723918274
message 8432981723918274
cipher 9834598734559
message 2314986213123475435
(The white space between the label and the number can be one or more spaces.) The output is:
cipher 191853804053733607643460120109149562803779107775517482874222
cipher 990247782703453419935166393974114859351043136440810572699234
message 952014225310412564875114228138574997898437010425924791995896
cipher 8919361814022696132891758631023073401838209481380951402492
Comments:
Write the programs as clearly as possible, including reasonable comments.
Links:
[login to view URL] : [login to view URL]
Rivest-Shamir-Adleman cryptosystem:
[login to view URL](cryptosystem)
Hello.
I have worked on similar projects, therefore, I'm confident that I'm the man for the job.
Relevant Skills and Experience
JAVA
Kotlin
Proposed Milestones
$30 USD - Complete the job
$30 USD 3 napon belül
5,0 (8 értékelés)
3,8
3,8
6 szabadúszó adott átlagosan $52 USD összegű árajánlatot erre a munkára
am great with java i have worked on many cryptosystheme i have crafeted amany from scratch including des3 ,rsa ,am good with generating big prime numbers in an optimised way