Beruflich Dokumente
Kultur Dokumente
• given a plain text, encrypt the text with the generated key(there will
be a plain text validation)
• givan a cipher text, compute the decryption key and decrypt the text
(there will be a cipher text validation)
2 Implementation
2.1 Technology
Our technology of choice was Python3.6 with PyQt5.11 for the UI. PyQt
offers a great variety of widgets that makes building interfaces easy and fast.
2.2 RSA
Our app uses the RSA class that encapsulates the logic of our application,
which is therefore being decoupled from the UI. Here we can find the implementations
of the Extended Euclidean Algorithm(EEA) and the Repeated Squaring
Modular Exponentiation. We use EEA for computing the greatest common
divisors of numbers as well as for computing the modular inverse of certain
numbers. This proves to be useful in the computation of the decryption key,
and in the generation of the public key.
1
Then, we take:
This part of the algorithm is a probabilistic one, because in case the condition
regarding the greatest common divisors does not hold, we simply generate a
new one. However, due to the range of values we take our values from makes
the probability of not being able to generate a proper e in a reasonable time
is negligable.
c = me mod n
m = cd mod n
The validation of plain an cipher texts is being done based on the rules
that the plain text can only contain lowercase elements of our alphabet, while
the ciphertext can contain only uppercase ones. This can easily be checked
by using regular expressions.
For clarity, our program also offers information about the encryption and
decryption keys, that are being shown once we generate a key.