This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
billysback's profile picture

Gridlock - Encryption

Started by billysback, 15 October 2013 - 04:50 PM
billysback #1
Posted 15 October 2013 - 06:50 PM
I'm not about to claim this is in unbreakable, but I just want to know how strong this encryption actually is…
I got the idea whilst watching The Fifth Estate earlier today (film about Wiki Leaks, it talked about their OS's security stuff), and the basic concept is it plots letters on a 2D grid and jumbles them about the grid a bit, it shouldn't be too hard to follow if you look at the code… maybe…

anyway, I'll give the program and an example of some encrypted text, I want to see if you guys can un-encrypt it without the password (no doubt you can, but I want to know how/how easy it was) :P/>

paste: http://pastebin.com/801UFAuW
Usage:
follow instructions, encryption/decryption outputted to file "enc" (log of all cryptions done)

Example text: 2Fv:@RL9NTL$..LTFLL9

How it works, for people who are interested:
Spoilerit scrambles every character available in CC in to a 2D graph (effectively), giving each character a value
it splits the text up in to chunks of 4 and makes 2 pairs (2 coordinates) out of that set of 4 characters
it uses the 2 pairs to get 2 coordinates then gets the 2 intersections of the two directional lines (along the x and y) that intersect those two coordinates.
it then 4 individual numbers of these 2 intersection-coordinates back in to an un-muddled character sequence, and uses these characters in the encryption.

Immediate negatives to this method:
the encryption is split up in to groups of 4 sets of characters, so you know characters are groups
if you get the character sequence you can easily convert the letters back to the intersections, but without the password it will be harder to find out the appropriate letters, though it would be extremely easy to also muddle the character sequence using the password as well..

Advantages:
No trace of the password that I could tell…
Adds practically no letters to the original text

NOTE:
I have no idea if this method, or a similar method, already exists, if it does I'd love a link to it to see how it's meant to be done, as I'm sure my way is flawed as hell
Parmacoy #2
Posted 16 October 2013 - 01:21 AM
How long would it take if someone didn't know the key, but used brute force using the letter groups, would the time taken to crack it that way be a waste of cpu time?
billysback #3
Posted 16 October 2013 - 06:12 AM
How long would it take if someone didn't know the key, but used brute force using the letter groups, would the time taken to crack it that way be a waste of cpu time?
this would require making the presumption that all the coordinates you converted from the encrypted text are correct, if you also shuffled the character sequence using the password then you would have no reliable way to know you have a correct set of coordinates…
I guess you could go through every possible character sequence and every possible letter group or "grid" and look to see if any of them are humanly eligible… But you could get artifacts using that method, and it would also require personally looking through a tonne of text…

I can't really think of another way to crack it.

On the current version you could do the same as the above method but you have the luxury of being able to presume you have to correct coordinates when you get the intersects using the character sequence…
tuogex #4
Posted 16 October 2013 - 09:56 PM
If the characters are shuffled on runtime each time, how does decryption work? Does it just spit out a password with the encrypted string?
Dragon53535 #5
Posted 17 October 2013 - 12:09 AM
If the characters are shuffled on runtime each time, how does decryption work? Does it just spit out a password with the encrypted string?
I'm not sure how the decryption exactly works, but from what i experimented with it I believe that: Basically the whole thing has two passwords, "password" and "text" lets view it as this, the password is a keyword used to decrypt, the text is the final product, or the actual password so to speak. So if you were to in the decryption put the "password" as what you entered for the encryption, and in text you put the encrypted text, the result is the text you inputed.
AgentE382 #6
Posted 17 October 2013 - 08:13 AM
In my free time yesterday, I made your code standard Lua compatible and applied some minor speed improvements.

Today, I will speed optimize it and start brute-forcing the sample text in your post. Note that I will be using the standard, standalone Lua interpreter instead of CC due to speed considerations. (Actually, I'll probably run it in LuaJIT.)

I'll also try cryptanalyzing the algorithm.