Log in

View Full Version : static key caesar cipher



zstar
04-15-2010, 10:01 AM
Hi,

I had done a substitution caesar cipher before for an assignment in which the 1 page encrypted the text with a shift value of 3 and decrypted it on another page with the same value. I had lost marks somehow because i was missing a 'static key' but I thought they were referring to the 'shift key', but it made me think is it another key they are talking about? Can anyone give me an idea as to what I am supposed to add to my caesar cipher to get this static key? so far the methods just do encrypt(message,shiftvalueof3) and the same with decrypt, what am I missing here?

Is it a different key they were talking about or would I have implemented the key wrongly? This is confusin gme because I have to do a randomized key based on a random value next for the caesar cipher, would they mean the shifting key in this case?

Also it says I need to make a protocol for 'key agreement between client and server', so would I need to make the client and server agree on that shifting key?

djr33
04-15-2010, 05:23 PM
I believe the idea is that it works as a password. You will have a much stronger algorithm if you have an extra piece of input that you use to encrypt with. The idea is that you aren't just shifting each letter by 3, etc., but instead you are shifting it by a VARIABLE amount. In this way, it is possible to 'decrypt' using any key, but only when the right key is applied does it translate into something useful-- the others just generate nonsense.
The simplest answer I can think of is shifting letters by some number, so that A->B and B->C and Z->A if that number is 1. The 'password' then IS that number. Your algorithm takes the number and applies it. Then only THAT number [read password] will properly decrypt it. Any other number will function but give useless results.

Of course you want to choose a password that is quite long and complex (and probably applied in a complex way that is hard to track) so that: 1) it is not possible to use pattern matching to deduce what the password should be; 2) it takes a long time to run through each possible password and attempt to find it that way. (In other words, a single digit password algorithm is a terrible idea, but it gets the idea across.)

And a 'shifting key' then is, I believe, a rotating/changing version of a static key. It could be, for example, based on the date (somehow). I don't see it as that special, though, since it's also predictable.


I don't claim to know anything about formal cryptology-- just hoping I've understood what you're looking for. This isn't really a programming question and terms can change in use, so you're probably best asking your instructor exactly what he means by it (or maybe your textbook).

BLiZZaRD
04-15-2010, 09:29 PM
It basically works along the 2 part encryption technique of "Asymmetric Key Encryption".

While this is not physical security, you are also not encrypting nor decrypting physical materials (like a note to take across the battlefield). The idea is the same though. One Commander (you) tell the other Commander (the receiver) the shift will be 3. This is also sent on a Wednesday, and both commanders know that on a Wednesday the static key is 'pegleg'.

The reason for this extra step then, is in case the rival Commander learns that the shift is 3 and he sees your scout running along the tree line and shoots him to get the message from him, he shifts 3 and the message is still garbled. Because he doesn't know that it was encrypted on Wednesday and that he needs the keyword 'pegleg' to apply either before or after (more likely) the shift.

A good guide is found on wikipedia here (http://en.wikipedia.org/wiki/Public-key_cryptography) and I am willing to bet your textbook has some information that is pertinent as well.

zstar
04-17-2010, 08:29 AM
thanks alot guys, it all makes sense now :)