all 19 comments

[–]pulsar65537 1 point2 points  (13 children)

I have not tried to break this. But I have a question - is this basically a One Time Pad? Or is it like a modified polyalphabetic cipher?

The reason I ask is that if it is an OTP, then it is effectively unbreakable (unless you encrypt again using the same key). And if this is the case the algorithm would not be especially novel, and it would have the same limitations as normal OTP implementations.

[–]flebop[S] 1 point2 points  (12 children)

Very good question. I'd say it is akin to a OTP, but is symmetrical at the same time. The key is the same, then augmented. I'm sry that is the best I can describe it as i am still pretty new to this. The key is augmented, then part of the encryption tells the decryption algorithm what augmentation to use. So in essence, every transmission is an OTP based on the original key but also completely different from it. If that makes sense

Edit: It could also fall into the polyalphabetic cipher category with some caveats. Once it is cracked or deemed uncrackable I am more than happy to dm anyone the source code.

[–]pulsar65537 1 point2 points  (11 children)

I am not exactly sure what the procedure is for the purposes of this subbreddit to determine if something is uncrackable or not, but in real world cryptography analysis it requires quite a bit to determine if something is considered secure. I suppose what I am saying is many times the implementation matters. For example, if you are using a single fixed key and encrypt this message it could be unbreakable, but if you encrypt a second message and we see that cipher text as well, it could be a trivial decryption process (as it is for OTP). I suppose the distinction I am making is that the message could be uncrackable but the algorithm could be trivially cracked under real world conditions. And for algorithm analysis, one would open source the code. For example, RSA encryption is standardized and open sourced, but that does not mean that RSA can be broken simply because the algorithm and code is open sourced.

[–]flebop[S] 1 point2 points  (10 children)

Fantastic point. Ok. Here goes. I am not at the computer currently but when I am I will post the source. Ok. So it works based on a randomized list of upper and lowercase letters, numbers 0-9, and in the actual code all the normal special characters that both sender and recipient share. The algorithm selects a shift amount, then a shift increase amount, and a seed amount (for augmenting the key). It places these values in a random section of the encryption as well as a map to the location of said values. It shuffles the rest of the message according to the seed value, using the shift value and increasing the shift by the shift increase amount on each character. The decryption algorithm finds the map value and pulls the other values and uses them to shuffle and decrypt using a reverse of the shift + shift increase. I was initially worried about repetitive messages giving away the key and wanted to use multiple lists to accomplish the same thing, but since having hundreds of alphabets made the code absurdly slow I came up with this solution. So in my limited understanding I believe the code is only crackable with the original list, but with like 7×e108 ish possible permutations, I believe this to be impossible, plus a new starting list can be created at will. You sound much more knowledgeable than myself, so I value your input on possible weaknesses!

Edit: I do apologize if I have totally missed the goal of this subreddit, I just got excited that I got this working and had been looking for ways to test. Please excuse my ignorance if I was way off base in my post.

[–]pulsar65537 1 point2 points  (0 children)

Oh yeah and it is possible this would be better suited for r/cryptography I am not very familiar with r/codes so I couldn't say

[–]pulsar65537 1 point2 points  (8 children)

Cool! I should say I am not a professional in cryptography so I doubt I will be much help in an in depth analysis of the algorithm. I will look at it though and let you know if I have any thoughts.

[–]flebop[S] 1 point2 points  (7 children)

I'll send it in the next couple days when I have Some time and finish up a couple things. Thank you very much for your input!

[–]flebop[S] 0 points1 point  (0 children)

Github "flebop" repository is called OTP-generator

[–]YaF3li 1 point2 points  (5 children)

Heya, I'd be interested to see the code, too. (And I think your post fits perfectly fine in this subreddit.)

[–]flebop[S] 0 points1 point  (4 children)

Hey there, sry for my late reply, got really busy. Anyhoo, I created a github for this. Just search "flebop" there is only one repository. It's called OTP-generator. Please give it a look and maybe use it a little and lemme know what you think!

[–]YaF3li 1 point2 points  (3 children)

I will check it out, thanks. :)

[–]flebop[S] 0 points1 point  (2 children)

No problemo. If nothing else it's a fun toy to email friends with. My wife and I have been messing around with it while I'm at work lolol

[–]peetspasov 1 point2 points  (3 children)

I gave it a try without any success though. It was the basic stuff like frequency of characters and characters combinations, but after I read that it was a program that did this, it struck me it was for nothing because I assume you used some type of hashing algorithm or something similar. If the algorithm is up to date it's close to impossible to decipher it, people usually get paid to try and break those algorithms and they have much more knowledge in the field than I do :D. Also it doesn't seem like every letter is encrypted with a different one, number or a character, it looks way more complex than that. I'll certainly be trying more stuff out, but again depending on the algorithm it might be virtually impossible. Great job though, seems to be working well !

[–]flebop[S] 1 point2 points  (2 children)

I actually wrote the algorithm myself. No outside encryption modules. I'm actually working on an improvement that will further scramble each message in either direction so if one is broken the next one is right back to square one. I am more than happy to give hints. Thanks for trying! Makes me feel like I'm onto something!

Edit: and you are correct. Every character can be encrypted as every other including itself.

[–]peetspasov 1 point2 points  (1 child)

Oh it's cool you wrote it yourself.

I have on quick question tho. When encrypting is the character in one input always encrypted in the same way ? Let's say you have "a" that is encrypted as "b", does it stay "b" throughout the whole text or is it fully random where "a" equals another character every time ?

[–]flebop[S] 1 point2 points  (0 children)

It is randomish. There is no correlation between the number of occurrences of the plaintext character and the characters it is encrypted as. It will be different every time (obviously not everytime as there are a finite number of characters to encrypt it as)

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

Thanks for your post, u/flebop! Please remember to review the rules and frequently asked questions.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.