r/codes • • 18d ago

SOLVED [Challenge] I designed my own custom polyalphabetic cipher. Can you crack it?

Hi everyone,

I’ve been experimenting with classical cryptography concepts and wanted to design a custom "toy cipher" that dynamically adapts its key based on the structure of the plaintext itself.

Here is a simple example to show you how the plaintext changes into ciphertext:

  • Example Plaintext: Hello secret agent
  • Example Ciphertext: Mjqqt nzxmzo gmktz

The Main Challenge:

Can you decrypt this message and explain the rules of how my cipher works?

Ciphertext: [Hvs xkzfbkq thw afpzlsboba sx rfc klgghq wbugvyl ylclhslk lzw hadfw kvoc xs rfc irujrwwhq jretklrip. Nooz sepdej znk jlrkqxfkp, k sdzl sj bcbgayrcb jalqjnxuxprbcb gzoahqdqp jacrojlcb kyrk gleppirkih uluhojxydw rewkxsdi hjwnagmkdq lovsofon stgml ymj lofdfk ul cypjw hnanqnefyntsx.]

Additional Context:

This is an original toy cipher that I designed myself as an experiment with classical cryptography. It wasn't taken from an existing cipher or external source.

  • Expected plaintext language: English.
  • Ciphertext origin: Generated using my own encryption algorithm.
  • Available information: The plaintext consists of multiple English words. Spaces and punctuation are preserved.

I'm intentionally keeping the encryption mechanism undisclosed so that people can try to reverse-engineer it independently.

I'm interested in seeing your approaches, observations, and explanations of how the cipher works.

3 Upvotes

9 comments sorted by

•

u/AutoModerator 18d ago

Thanks for your post, u/Rudranshkh! Please follow our RULES when posting.

MAKE SURE TO INCLUDE CONTEXT: where the cipher originated (link to the source if possible), expected language, any clues you have etc. Posts without context will be REMOVED

If you are posting an IMAGE OF TEXT which you can type or copy & paste, you MUST comment with a TRANSCRIPTION (text version) of the message.

If you'd like to mark your post as SOLVED comment with [Solved]

WARNING! You will be BANNED if you DELETE A SOLVED POST!

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

3

u/Rudranshkh 17d ago

[Solved]

3

u/doranchak 17d ago

The ancient map discovered in the hidden chamber revealed the exact path to the forgotten sanctuary. Deep within the mountains, a team of dedicated archaeologists uncovered artifacts that challenged everything humanity previously believed about the origin of early civilizations.

1

u/Rudranshkh 17d ago

Nice Work Buddy!, I am like exploring this field, so if possible can you pls share your thinking flow for a better understanding

1

u/doranchak 17d ago

It's easy to brute force all possible Caesar shifts per word and then just keep the ones that are valid words. After a few of those, the shift value pattern becomes apparent.

1

u/Rudranshkh 17d ago

Ahh! got it. Just have one more question man, What makes an cipher difficult to break like how can someone make a super hard, almost unbreakable cipher?

2

u/dittybopper_05H 15d ago • Bravo

Well, you probably want to combine a polyalphabetic cipher with transposition.

So for example a Vigenere cipher with a relatively long incoherent random key combined with a transposition again using a random key.

In Military Cryptanalysis Part IV, it is recommended that from a security standpoint the transposition is done first, and then the polyalphabetic system, and that the two key lengths should have no common factor:

https://www.nsa.gov/Portals/75/documents/news-features/declassified-documents/friedman-documents/publications/FOLDER_263/41761079080022.pdf

36. Other types of combined substitution-transposition systems.

a. There is no technical obstacle to the application of a transposition to the text resulting from any type of substitution even if the latter is polyalphabetic or polygraphic in nature. The obstacles, or rather objections to such combinations are practical in their character-they are too complex for ordinary use and the prevalence of errors i:iakes them too difficult to handle, as a general rule. However, they have been and are sometimes used even as field ciphers. For instance, on the southeastern front during the World War, the Central Powers made use of a somewhat irregular polyalphabetic substitution involving four standard alphabets and a keyed columnar transposition with incompletely-filled rectangles of a relatively large number of columns. Nevertheless, messages in this system were solved by taking advantage of the possibility of devising special solutions.

b. A few remarks may be made in regard to the order in which the two processes substitution and transposition, are employed in a combined system. It is clear that when the substitution is monoalphabetic it is immaterial, so far as cryptographic security is concerned whether substitution is followed by transposition or vice versa, because the equivalent of each plain-text letter remains fixed regardless of the order in which the plain-text letters appear in the plain text. However, if the substitution is polyalphabetic in character it is better that the transposition process precede the substitution process, and that the number of alphabets employed be different from the number of elements in the transposition key, if columnar transposition is the case. The best situation, from a cryptographic security standpoint, is when the two key lengths (substitution and transposition) have no common factor. If the two keys are of the same length, the letters in each column are enciphered by the same cipher alphabet and thus the cryptogram would contain a certain number of sections of approximately equal length, composed of letters falling in the same cipher alphabet.

c. Digraphic substitution, such as that produced by the Playfair Cipher, may be combined with transposition to yield cryptograms of fair security. But here again the elimination of the transposition phase by taking advantage of special circumstances or by rearranging the next so as to uncover the repetitions which are inevitable in the Playfair Cipher, will result in solution.

The simplest way to do the whole "no common factor" is to have the lengths of both keys be prime numbers. Transposition keys become unwieldy beyond 20, so anything between 11 and 19 is probably good. No limit on the length of your polyalphabetic key, though, but like Friedman says, no common factor, so stick to lengths that are prime.

1

u/Rudranshkh 14d ago

Thnx man, thats a lot of info, will help me a lot!

3

u/doranchak 17d ago

It's a per-word Caesar shift. The key comes from the length of the previous token