Computer Science Canada

My encryption ponderings

Author:  mirhagk [ Thu Aug 04, 2011 5:16 pm ]
Post subject:  My encryption ponderings

I was working on making a better version of hand encryption, and I came accross an interesting thing. If you use a zero-based index for the alphabetic numbers, it kinda makes things very odd.

a+a=a
b+a=b
c+a=c


it's very odd. On a related note, would anyone like to try to break my encryption? If someone would like to attempt it I will post the encryption method along with encrypted message, and we can see who can unencrypt it first. Note that this is encrypted with pen and paper, but yes, you may use all the computer tools you would like.

Author:  Ultrahex [ Thu Aug 04, 2011 6:16 pm ]
Post subject:  Re: My encryption ponderings

post-away...

Author:  mirhagk [ Thu Aug 04, 2011 9:18 pm ]
Post subject:  RE:My encryption ponderings

Alright I have a very basic sentence and I am working on a bigger one now, otherwise it will be impossible to decrypt (to save me time I'm going to get a computer to encrypt, but the algorithm is easy enough to do without)

The algorithm is basically a branch off of the vegeniere cipher. I doubt it's very good, but it's better than that at least, since it covers it falls. Here's what it does:

Take your keyword: compsci

then use your keyword to encrypt itself (as in a simple adding the letters together). Now you have a 2nd keyword. Use the 2nd keyword to encrypt itself, you'll now have a 3rd one that's 4 times as long as the first. Keep doing this till the key is as long as the message. Now use the key to encrypt the message. The key (other than the first part) will have no english components, and no normal language patterns in it, and it does not need to be repeated, so it overcomes the weaknesses of vegeneiren cipher. (I know I'm spelling that wrong lol).

Do you guys have any obvious mistakes I missed lol?

Author:  Tony [ Thu Aug 04, 2011 10:11 pm ]
Post subject:  RE:My encryption ponderings

If I understand this correctly, you are programmatically expanding a simple key into a running key. Should the full key be truly random, the key itself would be cryptographically secure (the distinction is that security is in the key and not the encryption method). But considering that all of the key's entropy comes from the original weak key, the running key is not truly random. I suspect that this theoretically breakable for long enough texts, especially if more information is know (e.g. key and text are derived from a known language).

Author:  DemonWasp [ Thu Aug 04, 2011 11:37 pm ]
Post subject:  RE:My encryption ponderings

First, a quick guess: your final key tends to contain exclusively these letters: ACEGIKMOQSUWY .

Let's assume that length ( key ) < length ( message ). This is sort of an implicit assumption in the algorithm as you wrote it anyway, so I don't think I'm overreaching here.

Based on your description, the following is my understanding:
key0 = original key = "KEY" (for example)
key1 = key0, "encrypted" by itself and concatenated = "UIWUIW"
key2 = key1, same procedure = "OQSOQSOQSOQS"
(etc)

Let's call the number of such steps "d". If the message is SHORTER than the key, then doublings will be 0, otherwise it will be 1 or more. In general, d will be given by:
code:

d = ceil ( log2 ( msg_length / key_length ) )


So the value of your full key at index i can be computed by:
code:

full_key [ i ] = 2 ^ d * original_key [ i % key_length ] (mod 26);


Since d > 0, we know that full_key [ i ] will be even. Thus, we know that the low bit of every byte in the plaintext is UNDISTURBED by applying the final key.

Even better, we know that there are only 13 possibilities for each entry in the final key (no matter what you put in your original key), because they are all congruent to 2 ^ d mod 26, which gives us only 13 non-negative possibilities: 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24: ACEGIKMOQSUWY .

This reduces your possibility space for the key from 26 ^ key_length to 13 ^ key_length. This means that the possibility space is only 1 / ( 2 ^ key_length ) the size it would be otherwise.

The rest of the attack follows pretty much the same pattern as the attacks on the Vigen?re cipher do, with the added bonuses that we have half as many Caesar ciphers to consider and that we can use that free low-bit to help in frequency analysis.

Finally, once the per-column Caeser ciphers have been cracked, you get both the plaintext and the original key, just as you do in the original Vigen?re cipher.

Author:  Tony [ Fri Aug 05, 2011 12:17 am ]
Post subject:  RE:My encryption ponderings

This interpretation of the key generation is no different than the classic Vigenere's cipher, but using OQS instead of KEY (so probably non-english key, but that doesn't prevent any of the classic attacks (since variants of using numeric keys have also been shown to be breakable)).

My interpretation was that each block of the key_length was encrypted a different number of times, resulting in a running key like OQSUIWKEY (so, key2 + key1 + key0; etc).

Which seemingly fixes attacks that target repeating key blocks.

Author:  DemonWasp [ Fri Aug 05, 2011 12:36 am ]
Post subject:  RE:My encryption ponderings

If true, that gives you even more information to attack the algorithm with...I think. Maybe mirhagk could clarify?

Author:  mirhagk [ Fri Aug 05, 2011 7:36 am ]
Post subject:  RE:My encryption ponderings

Tony got it mostly right, sorry for not clarifying. The key is encrypted with itself, and this new key is appended to the old one. For instance KEY becomes KEYUIW. Then this new key is treated the exact same, making another key of KEYUIWEMUOQS and so on and so forth. I do believe DemonWasp is still correct in that the final values of the key can only be one of those 13 values, so I'm thinking about improving it with this little trick. Instead of encrypting KEY with KEY you'd encrypt it with YEK, and same for each one that comes out. I believe it should give more variance, although I could be wrong.

The whole idea of it is to get a key with enough pseudorandomness that you would need a rediculous amount of text in order to decrypt it. It's already been shown that a truly random key as long as the text is indecipherable. (Assuming of course you don't have unlimited time) so a pseudorandom key should fare fairly well.

There is actually a similar concept to this, where you use the text appended to the key as part of the encryption. The problem with this is that the word THE is nearly guaranteed to be part of the key.

EDIT: This new way may make it less secure, as I see ALOT of triplets (KEY encrypted with YEK is III)
EDIT2: AHHH I REALLY CAN'T DECIDE. The 2nd way shows up less random, but it has more varance(if the letter be is used in the key, it can show up in the final key). The 1st way is restricted to those 13 characters, but looks pretty random (I know it's not, but it looks decent).

Author:  mirhagk [ Fri Aug 05, 2011 8:30 am ]
Post subject:  RE:My encryption ponderings

DRPRBSEJTGTJANWENXUSLQWZOGQMDUJAMTIZYBFGNMMLIDXWWICNNQFUJSUQHNWITGETBAHYZPYUFSCDSDIKXHORNPMDWRDSTMMJLANYIUFUFYNIDYFQQLJGESNHSDCOLPELOGNKDZHEHTACKTJCNQDSWFHEFUDIIVAVHMNEXQQJRTMAAOCTRYPYBENNCGYSOOIDGJYXLQNAPCYJFSDLWNWDNKPSTRELAUODTRYCCCKKFLALCVQOFYDYDOKTRYGCTQIBTKICYSOCVAWXVOPFODGTJSZHGWSDYBAJOACOJAHYWADUQUQYLVOLAVTWYSDEXAPEGJPLADMOKFOXVONMCHCVDCSUBCKPYYDTVSQLIQEXIXGZWPZZMHURRMYXWQBIUUXPFYREQOOKYBSQLUBZUEZWQCGGTGJFOTHSRGOEAISPCRMZSTAWKDOJALULTAJTCFQGKBHYTVHAMNIUUGGYRYLPEONWLADCYTMIUVNQDJYTRKKFBFETQARKIOFLO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GYLPCTGKFMFKRBGTUAVQKHBGMFEZQGRBKTAPIUCNSMLLOECFAFSIZIVENZGYCBUQHLWJKYQUIJZAQFWMLTLORSDHYRBYHQVFIVGQJNEHYACHMJJQQSADOYZMGOCBCGIEFCXEMDOZKGHAAHIYICGTLZOXUQUBZZMDCSDBWKMBAGSKZBKXQNCTSBUUCDOHAFOOBVQYCFCTQICTDKTWMIKQTIMTSDADPERHHGVHMIURGORKJFUVSRLEKADUUYZIUZWLYXWQUPPTCUHEVTIDXWAQSICWLBCZGDIEGTEEZBAMEZZAZNYNWTCXJYSZHCTQQWZCJHOTCJAQJRAAIWMFGHOTCRVMISVUCLMIIAEXESSNUKOFUZSQEZQJWIACCNVQWKJQTLABCPRYTDUIRUDWFDACYWSFAAMNEGMBMLGNTPAJEJOKBEXAPERQXEWKHGXAMBUTVECCLMVPEETWOKYZENSNVPTSNZOPJXQPRUXECARKYBHTOWEQDUAETOBTJGNCUTYQFXTGQYMOTEEPKPIFOVIIJGLUCTDEGMEOSKOYLTLOARFOEDLQIEGMNKEOKQRSDDHHGGORIHJGCXKGSQGNVTSMNZHTEPIARWLYXTQIXETQGFCSDMMLFSOTXHIRCKNGSBEDEFEUJDMECXSOHQNIRXJKUSDKIYTGMLGLEZ

that's using the original (non-reversed key) algorithm.

Author:  DemonWasp [ Fri Aug 05, 2011 11:22 am ]
Post subject:  Re: My encryption ponderings

My criticism (mostly) holds. Beyond the first key_length bytes then, the full key will include only multiples of two, and will therefore have only 13 possibilities. This weakness would disappear if you did something radical, like adding an extra character or removing one, just so the alphabet has an odd number of characters. For example, you could replace all instances of Z with S, or you could add an underscore to the alphabet.

The pattern of the number of "doubling" operations for the repetitions of the original key will be:

key0 = [0]
key1 = [0|1]
key2 = [01|12]
key3 = [0112|1223]
key4 = [01121223|12232334]
key5 = [0112122312232334|1223233423343445]

Obviously that's a fairly simple pattern. I'm too stupid / tired / lazy to write out the algorithm, but there's definitely an easy one (it's a fractal pattern, probably reproducible by an L-system, if it turns out to matter).

At this point, however, we've pretty much exhausted my ability to analyze encryption algorithms. I don't really have any training in the matter and as far as university-level math goes, I've mostly passed by accident.

Author:  mirhagk [ Fri Aug 05, 2011 12:02 pm ]
Post subject:  RE:My encryption ponderings

so by adding a single character to the alphabet it would be more secure? In that case I can just have spaces be a character.

Author:  DemonWasp [ Fri Aug 05, 2011 12:39 pm ]
Post subject:  RE:My encryption ponderings

I wouldn't recommend spaces, for two reasons. First, they're difficult to deal with in the output of the program, particularly in cases where the encrypted text is being parsed out of a message by something that separates tokens by white space.

Second, and more importantly, spaces show up extremely frequently in text of many languages; if you analyze any given text, you'll find that spaces are far more common than the letters 'e', 's', 't', etc. This makes frequency analysis much, much easier.

In fact, it might be best if the alphabet had a prime number of symbols, such as 29. You could add exclamation, full stop (period) and question mark, for example.

Out of curiosity, why are you working on modifying a known-breakable single-key algorithm, when we have public-key encryption (RSA) which nobody seem to think can be cracked in a reasonable period of time?

Author:  mirhagk [ Fri Aug 05, 2011 2:08 pm ]
Post subject:  RE:My encryption ponderings

Well I am doing it because an encryption this simple can be done with a piece of paper and a pencil (and for making it quicker a table to look up what values turn into what). RSA requires a computer in order to be implemented, and so lacks the ability to encode hand written things.

Author:  Brightguy [ Fri Aug 05, 2011 8:23 pm ]
Post subject:  Re: My encryption ponderings

The standard Vigenère-cracking method would work here, except it would take up to ~26 times longer because once the key length is determined you have to try 26 possibilities for each key position rather than directly seeing the proper shift amount in the frequency graph.

Incidentally, RSA is so remarkably simple that it can still be done by hand (though naturally it will be more computationally expensive than this as it requires multiplication).

Author:  DemonWasp [ Fri Aug 05, 2011 10:05 pm ]
Post subject:  RE:My encryption ponderings

Fortunately, exponentiation modulo N (which is what RSA requires) is relatively simple to perform, even by hand.

Author:  mirhagk [ Fri Aug 05, 2011 10:05 pm ]
Post subject:  RE:My encryption ponderings

Perhaps I completely misunderstood everything I have ever read about RSA encryption, but it is NOT doable by hand as far as I know. let's leave out the fact that you must do some very complex coprime math with prime numbers, and the resulting key needs to be about 1-2kilobits in order to actually be secure, and let's assume you already have the keys.

RSA involves raising the decrypted text to the encryption key (exponents) and then using the modular of that. Considering the fact that the key must be 1024 bits, I think that might be just slightly difficult to do by hand.

Author:  Tony [ Fri Aug 05, 2011 10:41 pm ]
Post subject:  RE:My encryption ponderings

First year UWaterloo Algebra had assignments for encrypting/decrypting RSA by hand. It is very much doable.

Author:  Brightguy [ Sat Aug 06, 2011 12:05 am ]
Post subject:  Re: RE:My encryption ponderings

mirhagk @ Fri Aug 05, 2011 10:05 pm wrote:
let's leave out the fact that you must do some very complex coprime math with prime numbers

The math isn't so complex, though; that's what's so beautiful about it. You just find a semiprime n and an integer coprime to phi(n) along with its inverse mod phi(n). Then encyption and decryption is just modular exponentiation. You couldn't ask for something much easier than that!

mirhagk @ Fri Aug 05, 2011 10:05 pm wrote:
RSA involves raising the decrypted text to the encryption key (exponents) and then using the modular of that. Considering the fact that the key must be 1024 bits, I think that might be just slightly difficult to do by hand.

Encryption can be as simple as cubing a number mod n: quite easy, even by hand. True, I wouldn't want to do it for 1024 bit numbers; I was supposing a key size about the same size as the ones in your scheme's example.

Author:  mirhagk [ Sat Aug 06, 2011 12:43 am ]
Post subject:  RE:My encryption ponderings

And it can be noted that for an encryption key as small as that, the security flaws in it make it essential no better. And you still need math, whereas you can make a quick look up chart for letters like:

ABCD

A ABCD
B BCDE
C CDEF
D DEFG


and you can just look at the chart to see what the result of the operation is. This chart makes it take a near neglible amount of time to encrypt something, you basically just need to write it out again. Whereas even cubing it requires a lot of thinking, and converting it to a number, then back again.

(although I guess you could have a chart for each key, although it'd make it much less safe/versatile)

Author:  Brightguy [ Sat Aug 06, 2011 1:21 am ]
Post subject:  Re: RE:My encryption ponderings

Sorry if this is derailing your topic, I just wanted to respond to your offhand comment that RSA required a computer.

mirhagk @ Sat Aug 06, 2011 12:43 am wrote:
And it can be noted that for an encryption key as small as that, the security flaws in it make it essential no better.

Actually, as long as you are careful (e.g., message padding) a small encrypting exponent is not known be insecure.

Author:  Tony [ Sat Aug 06, 2011 1:22 am ]
Post subject:  RE:My encryption ponderings

Alright, security (including encryption) review time!

The purpose of security is to put up a lock/barrier in front of a system/content such that the cost of breaking the lock/barrier is substantially more than the gains from accessing the system/content.

As a practical example, if the cost of renting out a server farm capable of breaking the RSA protecting your bank account is more than the amount of money in your account... then the security is good enough. There are various non-obvious costs that could be involved -- sometimes pirates break DRM just for the challenge. Sometimes groups break into stuff "for the lulz". But given some cost functions for those, the premise is still the same.

So the question here is: how much resources would an adversary party spend on trying to break your encryption?.

Because given the circumstance, it doesn't have to be cryptographically secure. Heck, it doesn't have to be any kind of secure... or even have any content at all. Fun piece of trivia: I once got in trouble because school administration figured that it would be convenient to interpret a passage of Lorem ipsum as a possibly encoded threatening message. Because the "threat" was perceived in the "possibility", it didn't matter if there was no actual secret message at all.

Author:  mirhagk [ Sat Aug 06, 2011 8:37 am ]
Post subject:  RE:My encryption ponderings

Lol I hope you showed them the wikipedia article.

Also your theory is a very good one, however the amount of resources they might spend can VASTLY change depending on who's doing it/why they are doing it/how they are doing it.

For instance if you have a caesar cipher, breaking it by hand still takes a little time, and if your just trying to access a note that someone wrote to their lover, it might not be worth it. On the other hand, you may have some software that can crack caesar cipher (trivial software to write really), in which case it most definetly is worth it.

In this case I believe you are right tony in that this algorithm will more than protect anything that I would write out by hand anyways, so until I work for NASA or the military, I think I'm okay. LOL.


: