[Community Puzzle] Encryption/Decryption of Enigma Machine

Hi,

I passed the all the tests for the Enigma Encryption/Decryption, but once submitted validators 4 and 6 fails.
My implementation seems to be correct as endoing+decoding brings the initial message back.
I encountered small issues when parsing parameters so I think my problem comes from inputs.

Edit: my decode function had a small bug in the reverse formula.
Fixed it and got the 100%

2 Likes

Same here !

Finally find it !

So did I.
Clue: Check the validity of the emitted letters (between ā€˜Aā€™ and ā€˜Zā€™)

i donā€™t effing get it. and since i canā€™t see what are the issues with test cases 4 and 6, i have no clue whatā€™s wrong. iā€™m pretty convinced iā€™ve got it right, but i donā€™t know what the program expects me to do if there are invalid characters. iā€™ve tried returning nothing when there are invalid characters. iā€™ve tried using ToUpper() to make them all uppercase. iā€™ve tried ditching the invalid characters but still process the rest. i dunno! it doesnā€™t work.

Iā€™m guessing here but invalid characters probably mean that you went past the first or last letter of the rotorā€¦ in that case, just remember that youā€™re trying to match the behavior of something thatā€™s a rotor in real life; a wheel; a circle. What happens when you make a full revolution?

thanks for the suggestion! i have done that already though, thatā€™s why iā€™m stumped! i use mod 26 on the zero-normalized characters. for the decoding, i add 26 first so it doesnā€™t make a negative result and it cancels out with the mod 26. i mean, if it was faulty, it wouldnā€™t work with any case.

Your last sentence is a fallacy :wink:

My code worked the same way and failed the same tests until I did something. Itā€™s a simple thing and it has to do with the size of the original message. I donā€™t want to completely give it away here but if you still have trouble, PM me and Iā€™ll share it.

2 Likes

thank you, you are damn right. i needed this hint i guess, because it allowed me to finally focus on the + 26 mod thing, lol. i think iā€™m used to solving issues by seeing the erroneous result, and this hidden validators thing prevent me from doing so, but this being a challenge of sort, guess thereā€™s no avoiding it! i really was pissed, lol

well , I think the statement needs more clarification , message.length<X , min<Number<max .

I guess Iā€™m having the same problem as you folks, Iā€™m stuck on the 4 and 6 validators :frowning:

Will try to think about the ā€œoriginal message sizeā€ hint, but not sure it will help me.

Problem during submit here.

Validating every test encode and decode, checking characters outside A-Z during the shift. Mysteriously failing test 8, (encode) and weā€™ve no freaking log or test to see whatā€™s the problem this is annoying.

I clarified the constraints.

Iā€™ve sent you the validator by PM. Could you tell us what was the issue in your code? Maybe we can improve the test cases.

Juste checked out, encode and decode works fine, still canā€™t understand why i get an error on this precise test.

After some investigation, the only tips i could give is: Care for your (int)char value, some special characters may create some unexpected results and wrong your shift.

1 Like

I also have similar problem. So can i get validator?

Hi iā€™m having trouble with the DECODE process Test #3. In ENCODE, i know i have to apply the Casesar Shift plus 3 rotos in order. But in DECODE what is the secuence?? Do i have to rest the values in Caesar Shift?. Apply rotos in inverse order?

2 Likes

Hello all,

Same issue here. I cannot get test #4 and #6 to pass.
I checked the contraints, have no hard-coded valuesā€¦
It is really annoying. I am trying to solve this for quite a while now and nothing works. Really having no error message or return on those tests that fail other than ā€œno hard coded value allowedā€ is frustrating.

Is there any way I can see what exactly is not passing the tests ?
I am using the java IDE.

Well in decode you do just the opposite.
So if you want to decode letter Y, you look which letter X gives you Y after rotor 3;
Then which letter Z gives you X after rotor 2, and so onā€¦