Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

I did work on the encryption algorithm and the decryption using the XOR method noticed that when more the key length, the less time spent on encryption and decryption.

I have two questions in particular:

  1. Why the greater the key length less time?
  2. in encryption algorithms using the XOR. Is the key should be a certain length or not?
share|improve this question
    
Could you elaborate a bit what your "encryption algorithm using the XOR method" is exactly? For an one-time pad, the key length should be as much as the message length, so I suppose you are using something with repeated key? –  Paŭlo Ebermann Apr 16 at 20:37
    
Ok for example I use k1 has length 256 bit with message has 1024 bit then I divide message for four parts each part has 256 bit. then I encrypt each chunk by use key1. –  MHS Apr 16 at 20:57
add comment

1 Answer 1

For simple XOR-based encryption algorithms such as OTP, the key size must be the same as the message size. If you choose a smaller key and try to divide the message into chunks, you would not have a perfectly secure scheme anymore.

Now, since you tagged java, I'm assuming that this increase in time for smaller key sizes is due to the code trying to divide the message into chunks. In that case, this doesn't have much to do with the algorithm, but rather with how you are writing your code.

share|improve this answer
    
Since we're talking about implementation, it should be noted that XOR is embarrassingly parallel, if the message size merits it. –  rath Apr 17 at 13:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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