jcryptool / crypto

JCrypTool Crypto Plug-ins
https://www.cryptool.org
Eclipse Public License 1.0
67 stars 37 forks source link

Extended-RSA plug-in input validation fix; Code cleanup #335

Closed tassadarius closed 3 years ago

tassadarius commented 3 years ago

Fix issue #332

Fix input validation; Reduce monster class

        The Identity.java class is/was a UI monster with 3000 LOC.

        There are two major things in this commit:
                1. Decoupling some RSA operations from the UI
                2. Make the key creation input validation work properly

        There are now 3 new files:
                RSAKey.java (Interface which contains an RSA key)
                RSAKeyMultiprime.java (implements above, for Multiprime)
                KeyInputValidator.java (validate input, gives error msg)

        I moved much of the RSA computation from Identity.java to
        the 3 other files, which should now work better.

        The input validation should now work properly. For the primes as
        well as for e. Also phi(n) is now displayed, instead of letting
        the user calculate it for himself.

        Small UI changes. Also applied some small UI changes, mainly fix
        some height bugs and display bugs, remove unnecessary font
        colors.

        TODO:
        It would really be nice to break up the rest of the
        monster class