Encryption/Decryption of Enigma Machine


#1

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

Same here !


#3

Finally find it !


#4

So did I.
Clue: Check the validity of the emitted letters (between ‘A’ and ‘Z’)


#5

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.


#6

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?


#7

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.


#8

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.


#9

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


#10

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


#11

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.


#13

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.


#14

I clarified the constraints.


#15

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.


#16

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


#17

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.


#18

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


#19

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?


#20

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.


#21

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…