we all know that Caeasar Cipher accepts only alphabets from A-Z and its key is n<=26.
Caesar Cipher does not accept numbers.
last night , I found an exercise which said that this code a certain code is encoded using Caesar Cipher **BUT** this code is a **composed of numbers and alphabets** like for example "69bc". This surprised me because as I said :" **Caesar Cipher does not accept numbers**" but I see a code with numbers and not only alphabets and this code must be decrypted to plain text.
the solution does not interest me . I am very very interested on and my questions are :
**2)how a code, which is composed from numbers and alphabets, is created using Caesar Cipher encoding???
1)how to decrypt a code (which is encoded using Ceasar Cipher and composed not only from alphabets but numbers like for example "69dc" )if we know that Cisaer Cipher does not accept numbers????????
**
any help would be appreciated
we all know that Caeasar Cipher accepts only alphabets from A-Z and its key is n<=26.
what are you talking about? it accepts any character. Ceaser was Roman, which was a completely different alphabet, so he wouldnt use it for english. i dont know where you got that from. most modern ceaser ciphers extract the ascii value, and then replace the current character with that character + the offset. ill put an example after i finish this
I thought caeser ciphers if they go past the last character they loop back to the start. Hence the shift.
Also you should make the key the modulus of 26 ( if its an English alphabet )
say we have
"Zebra" with a 15 key
That should be "Otqgp" or even "otqgp" without any uppercase allowed.
can you decrypt a code in Caesar Cipher where the code is a mixture of numbers and alphabets and where the key is greater than 26??
for example
a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 ; \ \ . , < , %
the key now is not 26 but 43 and there is not only alphabets from a-z but also numbers and other Ascii characters
so is it possible to decrypt a code , say for example 69bc56dg , using Caesar Cipher with a key greater than 26??? if so , then show me how? with details and examples and I want you to give me the source of your knowledge about how decrypt a code using Caesar Cipher with a key that is greater than 26
You can. Just use a container to store the accepted characters. Then shift the character in that container. Also the key can be ANY number. If the new character's is a size of 42 then say we have 84
That means
1 2
while( key > size )
key -= size;
Another method is
key %= size;
To give the actual number of shifts that make a difference.
@strongard63
Your premise is wrong and you are being very aggressive about it. Caesar cipher is a shift cipher. In instructional contexts, it will be implemented the way Caesar did it: restricting the alphabet. You have to realize that in crypto, the word "alphabet" does not imply letters only -- it means the set of symbols used. There is no compelling reason to need to prove to you that a Caesar cipher can be applied to alphabets other than the letters A..Z. The alphabet can be any set of symbols you want, including spaces and numbers and punctuation, so long as it has a distinct lexographic ordering.
@all
Yes, the shift is a modulo shift, otherwise you would have information loss, since input alphabet equals output alphabet.
DTSCode. You shifted them right. But when they were past the last index you kept going instead of looping back to the start then continue to increment.
*edit
Just look at your output anyways. This is not a-z which is the alphabet he is using:
T�'jvkl'pz';9
I showed you what it was supposed to look like earlier if we had zebra as source:
otqgp
( Most of the times the alphabet is all lowercase so people don't know when a sentence ends and other reasons we use capital letters. )
*edit here's a simple version of a caesar cipher taking only a-z
Your premise is wrong and you are being very aggressive about it
agressive?? not at all
Your premise is wrong , this is why I am here to get corrected
most importantly , you said:"restricting the alphabet. Yo.......... it has a distinct lexographic ordering."
so if it can accepts many characters so can you tell me why the key of Caesar Cipher is restricted only to 26 letters of alphabets from a-z ?????
for example in this site :
http://rosettacode.org/wiki/Caesar_cipher
it says there is only from 1 to 25 keys not more but you said the contrary that it can accepts more , you do not see that you contradict WIKI
if it can accept more than 26 keyes it means that all what is wriiten in WIKIpedia is wrong
Normally the Cipher uses letters, but you could use numbers if you wanted. There is nothing that says it can be only letters. You could easily do a series of 1 to 26 and then set a key and it would shift the 26 numbers just like it would the letters. From what I'm reading on the wiki page cire posted, it just looks like you are doing about the same as just swapping array elements (though I may be looking at it too simply and misunderstanding the article).
The cipher is talking about keys of 26 because A-Z is 26 letters so if they key is over 26 you are doing more work than needed as 27 would be the same as a key of 1. It depends on what you are wanting to shift and what key you want to use. It doesn't restrict you to just alphabet though.
For example, say you had a string that was "A-Z0-9" (just to save space of typing all 26 letters and 10 numbers. Now that is 36 characters (26 letters and 10 numbers) so the key is n<= 36 to shift the 36 characters. What I'm trying to get at is that you set the restrictions, not the cipher.
Normally the Cipher uses letters, but you could use numbers if you wanted. There is nothing that says it can be only letters.
Assuming by the Cipher you mean the caesar cipher, these statements are not correct. The very definition of said cipher precludes the encoding of numbers or other non-letter characters. Of course, it is trivial to whip up something which can do that based on the more general idea of a shift cipher which class the caesar cipher belongs to.
@cire
No, by the Cipher I was meaning shift ciphers. I read the Caesar Cipher wikipedia link and know it has to be A-Z. Sorry, it was late and wasn't fully with it. My point was that wherever he saw numbers being used in a Caesar Cipher means the user did what I mentioned, just wrote a shift cipher and was falsely calling it a Caesar Cipher. There are variants of it (again according to the wiki link), as Augustus Caesar wouldn't loop so X could be AA or such.
Kind of funny that a Mafia boss used a cipher that used numbers to represent letters , but guess it didn't work so well since he was caught.
Why can a caesar cipher not have numbers? You guys are forgetting there are more languages than just ENGLISH. A lot of languages have different alphabets. Also why can someone not create their own "alphabet" that contains letters, symbols , and numbers? Also technically the caesar cipher is a shift of 3 characters to the right so if you use English it is like this
Position: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
English: a b c d e f g h i j k l m n o p q r s t u v w x y z
Caesar: d e f g h i j k l m n o p q r s t u v w x y z a b c