| Welcome to Crypto. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| My New Cipher; Quite Interesting!! | |
|---|---|
| Topic Started: Apr 15 2008, 07:17 AM (896 Views) | |
| Paarth Dave | Apr 15 2008, 07:17 AM Post #1 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
Hello Guys, This is my cipher on which I am working. I have named it "Catastrophe". It works as follows:- Suppose the plaintext is "CATASTROPHE", the conversion of this word in numericals will be... 03 01 20 01 19 20 18 15 16 08 05 This conversion is according to the value of A being 01 but the next part includes conversing alternate numbers according to the value of A being 02 starting from the second letter. So the modified conversion is 03 00 20 00 19 19 18 14 16 07 05 Now I will rearrange these numbers from last to first including the swapping of the indices. So the arrangement will be as follows:- 50 70 61 41 81 91 91 00 02 00 30 Now let's take a keyword - "1.25" Taking the first part of the keyword and adding its multiples with their swapped indices to the alternate numbers starting from the first. For eg. The first part of the keyword is 1. So its multiples are as follows..1,2,3,4,5,6,7,8,9... Now swapping their indices...10,20,30,40,50,60,70,80,90.... Now adding them.. 50 70 61 41 81 91 91 00 02 00 30 + 10 20 30 40 50 60 _________________________________ 60 70 81 41 111 91 131 00 52 00 90 The other multiples are omitted as the limit is reached. Now taking the second part of the keyword - 25 and repeating the above process but starting from the last.. 60 70 81 41 111 91 131 00 52 00 90 + 521 001 57 05 52 _____________________________________________ 60 591 81 042 111 148 131 05 52 52 90 Now modifying it & removing useless numbers... 60,591,81,42,111,148,131,5,52,52,90 And the presentation of this final ciphertext would be as follows:- Time :- 1:25(the keyword) 60,591,81,42,111,148,131,5,52,52,90 Having a first look at this seems that this is a book cipher. Advanced cryptanalysis with representing these values on a frequency polygon reveals that frequencies keep on varying.. For eg. Let's take the first 5 digits of the ciphertext. 60,591,81,42,111 Observe that the frequencies once go up and then down & again up & then again down.. Now, let's have a challenge for you all.... Time:- 15:05 91,40,83,60,54,10,6,118,97,9,90,106,532,57,102,145,573,15,81,105,662,54,102,64,522,13,113,104,532,34,143,142,612,21,132,130,594 Note: Spaces are not encrypted. |
|
Cryptography Vanquished.... | |
![]() |
|
| jdege | Apr 15 2008, 12:01 PM Post #2 |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Are you familiar with the affine cipher? |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| Paarth Dave | Apr 16 2008, 03:32 AM Post #3 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
Yes, I have read about the Affine cipher in Wikipedia but I did not understand its system. I hope my new cipher is not very closely related to any existing cipher system. |
|
Cryptography Vanquished.... | |
![]() |
|
| jdege | Apr 16 2008, 04:11 AM Post #4 |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I'd call it a progressive polyalphabetic substitution. You're using substitution on alternating letters, using two different alphabets, then adding a fixed number sequence to it. The trick of reversing the text is arguably a transposition, but it's such a trivial one as to hardly be worth the effort. I don't want to discourage you, playing around with new ideas is always worth the effort, but most of your primitives seem to do more to add to the work of encoding and decoding, than to making the systems harder to break. It's easy to design a complex system, but you only want to add complexity when it adds to security, otherwise you're making the lives of your cipher clerks more difficult for no gain. I mentioned the Affine because you seemed focused on systems that involve arithmetic manipulation of the ciphertext, and the Affine is the exemplar of those. One of the difficulties of your system is that in a lenthy message the numbers will grow very large, making the ciphertext much larger than the plaintext. Most of the classical ciphers did their math mod-26, to avoid that, and to increase security - the distribution of the modulo sum of two integers is flat, the ordinary sum is not. The simplest mod-26 cipher is the Caesar shift - every letter of the plaintext is treated as a number between 0 and 25. to which is added mod-26 a constant between 0 and 25. The result is converted back to a letter. This is a pointlessly simple cipher, with only 26 keys. An alternative is to multiply each letter of the plaintext by a constant. Also simple, but with even fewer possible keys. You can only multiply by the numbers for which there are inverses mod-26, which means numbers between 0 and 25 that are relatively prime to 26. Of which there are 12 - the odd numbers other than 13. But suppose you did both - multiply by one number and then add another? That's the Affine cipher. With 12*26 = 312 keys. Still nothing more than a toy, but an interesting exercise. The next step, I suppose, would be the Hill cipher. Hill proposed using matrix multiplication. Using, for example, a 2x2 matrix - containing four numbers, he'd take pairs of letters from the plaintext, treat them as a 2 element vector, multiply that vector by the matrix, and use the resulting vector as the ciphertext. Still no more than a schoolbook exercise, easy to break. But what was fascinating about the Hill cipher was that it could be expanded to use 3x3 matrices, 4x4 matrices, atc. As the Playfair was the first cipher to operate on digraphs, instead of on single characters, the Hill cipher was the first to operate on more than two letters at the time. |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| Paarth Dave | Apr 16 2008, 04:24 AM Post #5 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
What do you mean by vectors and matrix multiplication? It would be very appreciable if you show this method by an example. |
|
Cryptography Vanquished.... | |
![]() |
|
| jdege | Apr 16 2008, 11:59 AM Post #6 |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
A matrix is a two-dimensional array of numbers, a vector is a one-dimensional sequence of numbers. The multiplication of a vector by a matrix yields another vector. Suppose our plaintext is "SEND HELP", and our key is the 2x2 matrix: We take the plaintext two letters at a time, treating each letter as an integer mod-26: We multiply the matrix and the vector: And since 22 = "W" and 14 = "O", we thus encode "SE" as "WO". We do the same process for the remaining pairs of plaintext letters, adding a random padding character at the end if we're one short. To decrypt, we multiply by a matrix that is the inverse of the one we used to encrypt. Not all matrices can be inverted - we can only use invertible matrices as keys. |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| Paarth Dave | Apr 18 2008, 05:45 AM Post #7 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
This is a nice cipher but can be easily broken. Just meant for fun! Anyways, how did you link my cipher 'CATASTROPHE' with the Affine & Hill ciphers? I haven't used any matrices in my system. Rather my system is quite complex to be deciphered by cryptographers even if I tell them the key. |
|
Cryptography Vanquished.... | |
![]() |
|
| jdege | Apr 18 2008, 02:02 PM Post #8 |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Affine doesn't use matrices, it uses arithmetic. Your ciphers have often been based on arithmetic. That's the connection I saw. As for making things difficult to decrypt, even with the key, that seems contrary to the purpose of ciphers - the goal is to make things easy to read with the key, and difficult to read without it. The Affine and Hill ciphers can both be easily broken, but then, so can yours. The Affine's greatest weakness is its keyspace. There simply aren't very many possible keys, and an exhaustive search takes a computer only microseconds. The Hill cipher, with small matrices, also has a small keyspace. But there is no limit to the size of the matrix. The only commercial implementation of the Hill cipher used a 6x6 matrix, which cannot be brute-forced. The Hill cipher's greatest problem is its linearity. For a 2x2 matrix, you have four unknown variables, If you can correctly guess four letters of the plaintext, you have four equations in four unknowns, with allows you to completely recover the key. Now, how would I approach cracking your latest cipher without the key? Your first step is a substitution, replacing each letter with a number. You're using two different alphabets for alternate letters, but in each there are only 26 possible numbers that can result. Your second step is to add one additive sequence to the even-positiioned letters, and another additive sequence to the odd-positioned letters. Take just the numbers corresponding to the odd-positioned letters. Subtract an additive sequence from each. If your odd-positioned letters are encoded as "60 81 111 131 52 90". Your possible additve sequences are "10 20 30 40 60 60". "20 40 60 80 61 81", "30 60 90 21 51 81", etc. Subtract each sequence, in order, from your odd-positioned letters. Check to see if all of the results of these subtractions represent valid letters. Remember, there are only 26 valid possibilities. The results of subtracting the incorrect sequence will often generate values that are not among these possibilities. If every subtraction in a sequence generates a valid value, it's almost certain that it is the sequence that generated it. Do the same for the even-positioned ciphers, working in the other direction. What could you do to make this more difficult? First, use mod-26 addition. With mod-26, every subtraction of a value would yield a valid result. Suppose you have a plaintext letter 'E', in an even position so it encrypts as 5. You added to it 120, resulting in a ciphertext of 125. In trying out various sequences, I subtract 81, giving me 44, which is not a valid possibility. Doing the math mod-26, though, is different. 'E' encrypts as 5, Adding 120 gives 125, which is 21. Subtracting 81 gives me -60 wicth is 18. Every possible subtraction yields a valid result. This makes it much more difficult to determine whether a given sequence is correct or not. Every sequence could be correct. Second, don't line up your periods. You're using two alphabets, on alternating letters, and you're using two additive sequences, on alternating letters. They line up The first additive sequence adds only to your first alphabet, your second additive sequence adds only to your second alphabet. They can be attacked separately. But what would have happened had you used three alphabets? You'd have had a period of six, alphabet 1 + sequence 1, alphabet 2 + sequence 2, alphabet 3 + sequence 1, alphabet 1 + sequence 2, alphabet 2 + sequence 1, and alphabet 3 + sequence 2. Isolating the alphabets from the additive sequences would have been much more difficult. |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| Paarth Dave | Apr 19 2008, 05:35 AM Post #9 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
I am an ameteur in cryptography so I find it difficult to understand some of the above mentioned terms. If you explain what changes can I do with my cipher system by citing an example, I would understand it better. And thanks a lot for your valuable suggestions you have provided so far. I appreciate you for taking time to understand my system and then find weaknesses with it. |
|
Cryptography Vanquished.... | |
![]() |
|
| jdege | Apr 19 2008, 01:23 PM Post #10 |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I'd be happy to answer questions, to the extent I can, but I'm not quite sure where to start. Do you understand what we mean by "alphabet" when we talk about polyalphabetic substitution? A substitution cipher is one in which chunks of the plaintext are replaced by different chunks to form the ciphertext. Most commonly, the chunks are individual letters. These are what we call monoliteral ciphers. In other ciphers, the chunks can be pairs of letters, or larger groups of letters, or individual bits. Playfair is a multiliteral cipher, operating on pairs of letters. So is the Hill cipher, which operates on pairs of letters when using a 2x2 matrix, triplets when using a 3x3 matrix, etc. Modern computer stream ciphers operate on individual bits, modern computer block ciphers operate on blocks of 64, 128, or 256 bits. But most ciphers, throughout history, have been monoliteral, operating on individual letters, as have those that you have offered us, so we'll focus on them. In a simple substitution cipher, there are two alphabets, The plaintext alphabet and the ciphertext alphabet. The plaintext alphabet is the ordinary, standard alphabet that you use to write the message. The ciphertext alphabet is something else. It may involve unique symbols, it may simply be the letters of the standard alphabet in a different order. It doesn't much matter. What matters is that there is a one-to-one correspondence between each letter of the plaintext alphabet and the ciphertext alphabet. So, when you transform a plaintext to a ciphertext by replacing every letter in the plaintext with its corresponding letter from the ciphertext alphabet you're doing a simple substitution cipher. Simple substitution ciphers aren't terribly secure. Newspapers print them in their comics sections, alongside the crossword puzzles, as a form of recreation. There are statistical clues about the plaintext that leak through simple substitution ciphers that make them very easy to break. What you need to understand is that piling substitution on top of substitution doesn't increase security at all. Applying a substitution cipher to the output of a previous substitution cipher just gives you a different substitution cipher. When you encode A as 01, B as 02, C as 03, etc., you're doing a substitution. When you go through again, substitution 10 for 01, 20 for 02, 30 for 03, etc., you're doing another substitution. It's exactly the same as if you'd done A as 10, B as 20, C as 30, etc., in the first place. Adding more of these sorts of transformations, no matter how many of them you add, don't do anything at all towards making the cipher more secure. Do you understand this? |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| Paarth Dave | Apr 20 2008, 07:12 AM Post #11 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
Yes, I now understand what you mean. But I think that when a huge sentence or a paragraph is encrypted using my cipher, there are possibilities that two pairs of different numbers may add up to the same number. Now in this case, substitution is not at all possible. For example, just take the challenge that I had posted earlier in this topic. You may observe that some numbers get repeated and surprisingly, they don't have the same values in the plaintext. You say that my cipher is completely based on substitution and it has maximum 26 possibilities for each number. But by the explaination that I have given, observe that each alphabet if repeated again in the plaintext has a completely different value than its first value. So substitution attacks on ciphertexts based on my system may yield results but it will be so tedious that cryptographers may give up. All I wanted to know is how can I make my system more secure. |
|
Cryptography Vanquished.... | |
![]() |
|
| jdege | Apr 20 2008, 11:56 PM Post #12 |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
You misunderstand me. Your cipher isn't a simple substitution. It doesn't use one alphabet, it uses two. And then it applies two different additives to them. What I'm saying is that within each of the two separate substitutions you are doing, having multiple processes for accomplishing the substitution makes for more work, but not for more security. What I'm saying is that having these two steps, substituting numbers for the letters, then swapping the indexes, is nor more secure than having one. And, in fact, it's less secure than just having one, if that one provided for a larger set of possible substitutions. Think about the Caesar shift - this is a simple substitution made by shifting the standard alphabet by a specified amount - adding a constant to each letter. In a Caesar shift of distance three, each letter is replaced by the third letter following: Now consider a Caesar shift of distance five: The consider what would happen if you applied a Caesar shift of distance three and then applied a Caesar shift of distance five. You'd get exactly the same results as if you applied a Caesar shift of distance eight: In just the same way, applying one substitution to the output of another substitution doesn't make for a more secure cipher, because the result is just another substitution. So if we take the ancient Hebrew AtBash cipher: , and then apply a Caesar shift of three, we get: , which is just another substitution cipher. My point is that your habit of using substitutions made up of two separate steps are more difficult to apply than single substitutions, but they're not more difficult to crack. And I think you're thinking that the complexity you're adding to the encryption process ss adding more security, and it's not. So, how could you make the substitution step of your cipher both less work and more secure? Try doing a straight keyword substitution. In the ACA puzzles, they have four ways of doiing this. They take a keyword, and remove repeated letters, "SECRET" becomes "SECRT". Then for a K1 key, they us that to mix the plaintext alphabet:K1: Notice how the keyword, with the duplicate letters removed is inserted into the alphabet at a specified position with the remaining letters following. The keyword is not placed aligned with 'A', because that would result in 'x y z' encrypting as 'X Y 'Z' anytime the keyword didn't have 'x y 'z. The K2 key uses the keyword to mix the ciphertext alphabet. The K3 key uses the keyword to mix both the plaintex and the ciphertext alphabets, inserted at different positions. The K4 key uses two different keywords to mix the plaintext and the ciphertext keys/ Personally, I prefer columnar transposition key mixing. The keyword is written at the top of a series of columns, one column for each unique letter in the keyword. The remaining alphabet is written beneath, row by row, and the ciphertext alphabet is read off column by column, in alphabetic order of the columns. Written out in rows: Read off in columns: So, what I'm suggesting is that for the first substitution step, instead of using a fixed substitution for each of your two alphabets, you use keyword-mixed alphabets for the substitution. This is the first of a number of suggestions, as to how to create a cipher that has the same structure as that you had suggested, but uses more secure primitives at each step. The result will be a a pretty nasty cipher - the sort that would have caused WWI-era cryptographers real headaches. I'm not listing all of my suggestions now, because I don't want to overwhelm. Each is fairly simple, individually, and the concepts underlying them are worth discussing independently. Do you understand why using a keyword-mixed alphabet is more secure than simply assigning numbers with or without swapping digits? Your system always used the same substitution for each half of the letters. Using a keyword to mix the alphabet results in a very different cipher every time you change the keyword. And it's a lot easier to change a keyword than to change a system. |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| Paarth Dave | Apr 21 2008, 05:16 AM Post #13 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
But even if I use keyword-mixed alphabets for substitution, the concept of the system is still going to be substitution which is fairly easy to break. Substitutions simply put me off. One of my friends who is an amateur symbologist gave a message in his new language and asked me to break it. I found out the message within 2 days because it was all substitution. Even though the system you use may be complex, but if it results only in substitution then the system is not at all secure. The thing which struck me when I read your above post is that why not use the keyword-mixed alphabets in a complex way and then add the values of their corresponding alphabets and then prepare the ciphertext? Or else even process the keyword-mixed alphabets in such a way that cryptographers drop the idea of a keyword based system? |
|
Cryptography Vanquished.... | |
![]() |
|
| jdege | Apr 21 2008, 12:13 PM Post #14 |
|
Elite member
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
We're getting there. Yes, simple substitution yields a cipher that is simple to break. But using a fixed substitution yields a cipher that can simply be read. Your "Catastrophe" cipher has some interesting ideas. You're layering a number of different cipher approaches on top of each other, and if you were implementing each layer in a fairly secure way, you'd have a quite secure result. To break the cipher, you'd need to attack each level individually, and if the underlying layer had any kind of strength, it'd be very difficult to determine when you had a proper solution to the top layer. So if you're substitution layer is done well, figuring out when you've stripped the additive layer would be difficult. So, next step. You're currently using two substitution alphabets. Why stop there? Why not have three? Five? A variable number? The standard Vigenere cipher uses multiple alphabets, one for each letter of the keyword, each of those alphabets being the standard alphabet shifted by the value of the letter in the keyword. A mixed-alphabet Vigenre does the same, only it shifts a mixed alphabet rather than the standard. The standard Vig is considered more secure the longer the keyword is, using a mixed alphabet is about the same as adding five more characters to the keyword. Cracking a standard Vig isn't hard. It's actually easier than cracking a simple substitution. Cracking a mixed alphabet Vig involves figuring out how long the key is, then shifting the various alphabets against each other until they line up, which then gives you a simple substitution to solve. But the point isn't that the Vig can't be cracked, but that it hides the statistical qualities of the plaintext far better than does a simple substitution, and the longer the key the better it does so, which makes the task of recognizing when you've stripped off the additives correctly far more difficult. The Incidence of Coincidence of a standard Vig with keylength 10 or greater, or a mixed-alphabet Vig with keylength five or greater, is indistinguishable from random text. So, when you're trying to strip off the additives, you don't have an easy way of recognizing that the result is correct. |
| When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl. | |
![]() |
|
| Paarth Dave | Apr 22 2008, 04:55 AM Post #15 |
|
Advanced Member
![]() ![]() ![]() ![]() ![]()
|
So, what is the main difference between a mixed alphabet Vig and a standard Vig? And the Incidence of Coincidence? What's that for?
And how can I make my substitution layer more secure? Any ideas? |
|
Cryptography Vanquished.... | |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · Challenges · Next Topic » |





![]](http://209.85.122.85/static/1/pip_r.png)



11:07 AM Nov 23