To use the OTP with RSA, I implemented the one-time pad first for only one time, and then I used the RSA algorithm to encrypt the message.

For the RSA algorithm, I pick $p$ = 2143 and $q$ = 3257, values which do not share any common factors and generate a random value between 1 and $(p-1)(q-1)$. Then generate a public key and private key for RSA encryption and decryption.

My question is: Is it more secure than only using the one-time pad to encrypt the message?

  • 3
    $\begingroup$ OTP, done right, is 100% secure; how can you have more than 100%? $\endgroup$
    – dandavis
    Commented Apr 7, 2017 at 19:23
  • $\begingroup$ Could you please expand on how you use RSA? When and how do you manage the key(s)? A bit more detail should lead to a more accurate answer. $\endgroup$
    – Paul Uszak
    Commented Apr 7, 2017 at 21:12
  • $\begingroup$ @dandavis : ​ For example, one could have non-malleability. ​ ​ ​ ​ $\endgroup$
    – user991
    Commented Apr 8, 2017 at 5:48
  • 1
    $\begingroup$ @dandavis I think that is a very simplistic and incorrect view. The security of a crypto SYSTEM depends on much much more than the underlying mathematics (which comparatively are simple). $\endgroup$
    – Paul Uszak
    Commented Apr 8, 2017 at 12:57
  • 1
    $\begingroup$ @PaulUszak: I agree it depends on more than what we know from OP, but i said "done right"... $\endgroup$
    – dandavis
    Commented Apr 8, 2017 at 21:06

1 Answer 1


It depends on what you would use the RSA algorithm for since a one-time pad (assuming you implement it correctly) should achieve perfect secrecy, which means its ciphertext cannot be cracked. RSA is one of the first public-key cryptosystems that can also be considered as secure when you are using large enough primes.

So to answer your question, it cannot be more secure than using OTP only since it simply provides the perfect secrecy. But OTP does have its limitations and that's why we have other encryption schemes and algorithms so that we can choose the most suitable one in different situations.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.