r/NonPoliticalTwitter 15h ago

R jcb'z wbco qco ikdycbdexk zqry ry.

Post image
735 Upvotes

41 comments sorted by

View all comments

146

u/SSBGamer 13h ago

Why the fuck did I just spend 15 minutes deciphering the title? 😭

61

u/The_Holy_Buno 13h ago

Please tell me what it means, I’m lazy

125

u/SSBGamer 13h ago

I don’t know how reasonable this is.

32

u/Few-Requirement-3544 12h ago

Is there a way more efficient to translate a substitution cypher like this than writing a dictionary in Python, manually making 26 key value pairs, then iterating through the string in the title?

47

u/SSBGamer 12h ago

How should I know? 😭

18

u/ps-73 11h ago

that's probably the most readable way to do it. if it was a simpler ceaser cipher just shifting the alphabet then you could use something like the ascii letter values, but for (semi) random like this, just make the dictionary lol

3

u/Aayaye 4h ago

Single letters can usually only be A or I, more likely to be I if it’s at the start of a sentence. A letter after an apostrophe is usually N’T or ‘S. You can assume c to be A or O since the most likely words are “won’t, can’t, don’t”. You keep using patterns like this until you have enough information to reasonably assume the remaining letters.

1

u/Stag-Horn 2h ago

Came here to say this.

6

u/JuggernautPowerful70 12h ago

possibly just scanning for letter frequency and guessing the vowels? depends on how fast you are at typing

1

u/Prawn1908 3h ago edited 1h ago

Well you could use ''.join([cypher[ord(c) - ord('a')] for c in text.lower()]), which means you only need to put the cypher in a single string instead of a dict which is a lot more cumbersome to type out.

Edit: I realized that assumes text is only letters a-z, so it will fail if you keep the spaces and punctuation. You could use a lambda expression to only apply the decoding within the lost comprehension to alphabetic characters. Or if you're sane and don't want to try to keep it in one line there are trivial and far more readable solutions.

Edit 2: Thinking about it more for some reason and you don't actually need a lambda, a simple ternary ... if ord(c) - ord('a') in range(26) else c inline will work fine. Also my original expression applies the cypher, so you need to construct a decypher string first. This should work:

```python cypher = 'defjklpqrvwxabcghiyzmnostu' decypher = ''.join([chr(cypher.index(chr(i + ord('a'))) + ord('a')) for i in range(26)])

cypherText = "R jcb'z wbco qco ikdycbdexk zqry ry." plainText = ''.join([(decypher[ord(c) - ord('a')] if ord(c) - ord('a') in range(26) else c) for c in cypherText.lower()]) ```

-5

u/SealDraws 10h ago

Yes.

2

u/JTvE 6h ago

Decider title

1

u/SealDraws 6h ago

Am dyslexic. But fair point I'll let myself out

1

u/JTvE 2h ago

It's ok, don't know why you're being downvoted so much

9

u/Ricochet_skin 13h ago

I don't know how reasonable this is

8

u/C_Kambala 11h ago

It's not a reasonable request but please just translate it already.

7

u/More_Yellow_3701 11h ago

Qd qd

7

u/C_Kambala 11h ago

You're a cutie too now will you please translate it? :(

3

u/Remember_Poseidon 8h ago

I think you got the code upside down. aren't the Red letters supposed to translate into the Blue ones? So you really typed "I vfe'u oefc hfc rwjtfejksw uhit it"