How do I write an RSA Square and Multiply Using Big Integer in Java? [on hold]











up vote
-4
down vote

favorite












My homework requirement is that I ask the user to input three positive integers as “base”, “exponent”, and “modulus”. All three of these integers must be BigInteger data types.



Next I have to implement the RSA Square and Multiply algorithm to find “base^exponent mod modulus”. Then print out the result.



How could I go about this?










share|improve this question









New contributor




Josh Keznor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as too broad by James K Polk, Stephen C, GhostCat, Enzokie, gnat Nov 4 at 22:13


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.











  • 3




    Welcome to Stack Overflow! While I appreciate that you are only asking for help and not to actually do your homework for you, this question is one we cannot answer without defeating the purpose of this assignment. Please review your class notes and feel free to edit this question to be more specific with where you are having difficulty. Read also: An open letter to students with homework problems
    – Joe C
    Nov 4 at 10:12






  • 1




    Other users marked your question for low quality and need for improvement. I re-worded/formatted your input to make it easier to read/understand. Please review my changes to ensure they reflect your intentions. But I think your question is still not answerable. You should edit your question now, to include your own efforts (see help me is not a question ). Feel free to drop me a comment in case you have further questions or feedback for me.
    – GhostCat
    Nov 4 at 13:38










  • Exponentiation by squaring
    – James K Polk
    Nov 4 at 15:20















up vote
-4
down vote

favorite












My homework requirement is that I ask the user to input three positive integers as “base”, “exponent”, and “modulus”. All three of these integers must be BigInteger data types.



Next I have to implement the RSA Square and Multiply algorithm to find “base^exponent mod modulus”. Then print out the result.



How could I go about this?










share|improve this question









New contributor




Josh Keznor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as too broad by James K Polk, Stephen C, GhostCat, Enzokie, gnat Nov 4 at 22:13


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.











  • 3




    Welcome to Stack Overflow! While I appreciate that you are only asking for help and not to actually do your homework for you, this question is one we cannot answer without defeating the purpose of this assignment. Please review your class notes and feel free to edit this question to be more specific with where you are having difficulty. Read also: An open letter to students with homework problems
    – Joe C
    Nov 4 at 10:12






  • 1




    Other users marked your question for low quality and need for improvement. I re-worded/formatted your input to make it easier to read/understand. Please review my changes to ensure they reflect your intentions. But I think your question is still not answerable. You should edit your question now, to include your own efforts (see help me is not a question ). Feel free to drop me a comment in case you have further questions or feedback for me.
    – GhostCat
    Nov 4 at 13:38










  • Exponentiation by squaring
    – James K Polk
    Nov 4 at 15:20













up vote
-4
down vote

favorite









up vote
-4
down vote

favorite











My homework requirement is that I ask the user to input three positive integers as “base”, “exponent”, and “modulus”. All three of these integers must be BigInteger data types.



Next I have to implement the RSA Square and Multiply algorithm to find “base^exponent mod modulus”. Then print out the result.



How could I go about this?










share|improve this question









New contributor




Josh Keznor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











My homework requirement is that I ask the user to input three positive integers as “base”, “exponent”, and “modulus”. All three of these integers must be BigInteger data types.



Next I have to implement the RSA Square and Multiply algorithm to find “base^exponent mod modulus”. Then print out the result.



How could I go about this?







java rsa biginteger






share|improve this question









New contributor




Josh Keznor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Josh Keznor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 4 at 13:38









GhostCat

85k1680139




85k1680139






New contributor




Josh Keznor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 4 at 10:10









Josh Keznor

1




1




New contributor




Josh Keznor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Josh Keznor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Josh Keznor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as too broad by James K Polk, Stephen C, GhostCat, Enzokie, gnat Nov 4 at 22:13


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






put on hold as too broad by James K Polk, Stephen C, GhostCat, Enzokie, gnat Nov 4 at 22:13


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 3




    Welcome to Stack Overflow! While I appreciate that you are only asking for help and not to actually do your homework for you, this question is one we cannot answer without defeating the purpose of this assignment. Please review your class notes and feel free to edit this question to be more specific with where you are having difficulty. Read also: An open letter to students with homework problems
    – Joe C
    Nov 4 at 10:12






  • 1




    Other users marked your question for low quality and need for improvement. I re-worded/formatted your input to make it easier to read/understand. Please review my changes to ensure they reflect your intentions. But I think your question is still not answerable. You should edit your question now, to include your own efforts (see help me is not a question ). Feel free to drop me a comment in case you have further questions or feedback for me.
    – GhostCat
    Nov 4 at 13:38










  • Exponentiation by squaring
    – James K Polk
    Nov 4 at 15:20














  • 3




    Welcome to Stack Overflow! While I appreciate that you are only asking for help and not to actually do your homework for you, this question is one we cannot answer without defeating the purpose of this assignment. Please review your class notes and feel free to edit this question to be more specific with where you are having difficulty. Read also: An open letter to students with homework problems
    – Joe C
    Nov 4 at 10:12






  • 1




    Other users marked your question for low quality and need for improvement. I re-worded/formatted your input to make it easier to read/understand. Please review my changes to ensure they reflect your intentions. But I think your question is still not answerable. You should edit your question now, to include your own efforts (see help me is not a question ). Feel free to drop me a comment in case you have further questions or feedback for me.
    – GhostCat
    Nov 4 at 13:38










  • Exponentiation by squaring
    – James K Polk
    Nov 4 at 15:20








3




3




Welcome to Stack Overflow! While I appreciate that you are only asking for help and not to actually do your homework for you, this question is one we cannot answer without defeating the purpose of this assignment. Please review your class notes and feel free to edit this question to be more specific with where you are having difficulty. Read also: An open letter to students with homework problems
– Joe C
Nov 4 at 10:12




Welcome to Stack Overflow! While I appreciate that you are only asking for help and not to actually do your homework for you, this question is one we cannot answer without defeating the purpose of this assignment. Please review your class notes and feel free to edit this question to be more specific with where you are having difficulty. Read also: An open letter to students with homework problems
– Joe C
Nov 4 at 10:12




1




1




Other users marked your question for low quality and need for improvement. I re-worded/formatted your input to make it easier to read/understand. Please review my changes to ensure they reflect your intentions. But I think your question is still not answerable. You should edit your question now, to include your own efforts (see help me is not a question ). Feel free to drop me a comment in case you have further questions or feedback for me.
– GhostCat
Nov 4 at 13:38




Other users marked your question for low quality and need for improvement. I re-worded/formatted your input to make it easier to read/understand. Please review my changes to ensure they reflect your intentions. But I think your question is still not answerable. You should edit your question now, to include your own efforts (see help me is not a question ). Feel free to drop me a comment in case you have further questions or feedback for me.
– GhostCat
Nov 4 at 13:38












Exponentiation by squaring
– James K Polk
Nov 4 at 15:20




Exponentiation by squaring
– James K Polk
Nov 4 at 15:20












1 Answer
1






active

oldest

votes

















up vote
0
down vote













I guess your teacher wanted to give you a hint by using java.math.BigInteger, because it already has methods to implement a solution.
I'd suggest to start with reading documentation for java.math.BigInteger class, especially for methods valueOf(int n), pow(int exponent) and mod(BigInteger m).
Using those you will be able to implement formula that you have provided in your question.






share|improve this answer




























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    I guess your teacher wanted to give you a hint by using java.math.BigInteger, because it already has methods to implement a solution.
    I'd suggest to start with reading documentation for java.math.BigInteger class, especially for methods valueOf(int n), pow(int exponent) and mod(BigInteger m).
    Using those you will be able to implement formula that you have provided in your question.






    share|improve this answer

























      up vote
      0
      down vote













      I guess your teacher wanted to give you a hint by using java.math.BigInteger, because it already has methods to implement a solution.
      I'd suggest to start with reading documentation for java.math.BigInteger class, especially for methods valueOf(int n), pow(int exponent) and mod(BigInteger m).
      Using those you will be able to implement formula that you have provided in your question.






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        I guess your teacher wanted to give you a hint by using java.math.BigInteger, because it already has methods to implement a solution.
        I'd suggest to start with reading documentation for java.math.BigInteger class, especially for methods valueOf(int n), pow(int exponent) and mod(BigInteger m).
        Using those you will be able to implement formula that you have provided in your question.






        share|improve this answer












        I guess your teacher wanted to give you a hint by using java.math.BigInteger, because it already has methods to implement a solution.
        I'd suggest to start with reading documentation for java.math.BigInteger class, especially for methods valueOf(int n), pow(int exponent) and mod(BigInteger m).
        Using those you will be able to implement formula that you have provided in your question.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 4 at 13:56









        Kamil

        1,6281834




        1,6281834















            這個網誌中的熱門文章

            Xamarin.form Move up view when keyboard appear

            Post-Redirect-Get with Spring WebFlux and Thymeleaf

            Anylogic : not able to use stopDelay()