# Tag Info

2

The answer to this (thanks to help from fkraiem) was literally included in the first sentence of the question. I went wrong by assuming that the probability of the occurrence of a 1 or 2 character key didn't weigh into the calculation. My (rather questionable) reasoning was that since the key did in fact have to be either 1 character or 2 characters (i.e. ...

1

As far as I can tell, your original reasoning is correct. To obtain perfect secrecy with a VigenĂ¨re cipher, the key must not repeat. The key does not repeat whenever it is at least as long as the message, so option 2 is clearly a sufficient (and indeed necessary) condition for perfect secrecy, at least as far as only key length is considered. Options 3 ...

3

The actual "encryption" is done on this line: mysecretmessage[i] ^= ((mysecretvalue>>(8*(i%4)))&255); Clearly, this line XORs every byte (or at least, every element; but it makes sense to assume that this is indeed a byte array) of mysecretmessage with some value derived from mysecretvalue and the byte counter i. So what does the expression ((...

2

Hmm, first about your type of encryption: ...for a Caesar Cipher that encrypts each letter with a different integer as a shift... This actually describes a VigenĂ¨re Cipher. The classic approach to break this kind of cipher is by Determine the key length first Break the underlying Caesar Cipher for each letter of the key. To follow this route a ...

0

Just for simplicity lets assume that your short period "password" was just XORed with plaintext. So we have encryption procedure like: for(int i = 0; i < plaintext_len; i++){ ciphertext[i] = plaintext[i] ^ password[i % password_len]; } When you shift your ciphertext by password_len and XOR it with original ciphertext, you'll cancel out your ...

Top 50 recent answers are included