Here I implemented One Time Pad first for only one time and then I used RSA algorithm to encrypt the message.

For RSA algorithm, I pick p = 2143 and q = 3257 value which does not share any common factors and generate a random value between 1 and (p-1)*(q-1). And then generate a public key and private key for RSA encryption and decryption.

My question is: Is it more secure than only use One Time Pad to encrypt the message?

  • 3
    $\begingroup$ OTP, done right, is 100% secure; how can you have more than 100%? $\endgroup$ – dandavis Apr 7 '17 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 Apr 7 '17 at 21:12
  • $\begingroup$ @dandavis : ​ For example, one could have non-malleability. ​ ​ ​ ​ $\endgroup$ – user991 Apr 8 '17 at 5:48
  • $\begingroup$ So you create cipher text using a OTP, then you encrypt the cipher text again with RSA? So you have two layers of encryption. The question then becomes generically are multiple layers of encryption more secure than a single layer? That's a good question and I don't think that the answer is simple. $\endgroup$ – Paul Uszak Apr 8 '17 at 12:34
  • 1
    $\begingroup$ @PaulUszak: I agree it depends on more than what we know from OP, but i said "done right"... $\endgroup$ – dandavis Apr 8 '17 at 21:06

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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