5 kyu

Simple Encryption #2 - Index-Difference

324 of 882user5036852
Description
Loading description...
Fundamentals
Cryptography
Security
Strings
Arrays
Algorithms
  • Please sign in or sign up to leave a comment.
  • marjan Avatar

    Can anybody explain me for example AsiqS%:vh how do get "G&HPsf9c?

    ASiQS%:Vh First step A->0 S->18 => 0-18+77=59 That is '7' not 'G' ...

  • CClairvoyant Avatar

    Probably deserves 4 kyu. Took me like 6x longer, than other 5 kyu katas usually take.

  • Theoule Avatar

    Fun kata

  • RazDwaTrzy Avatar

    Hi, I'm trying to solve it but I failed at encrypt 'Kobayashi-Maru-Test'. I get "$-Wy,dM79H'i'o$n0C&I.ZTcMJw5vPlZc Hn!krhlaa;khV mkL:gvtP-S7Rt1Vp2RV;wV9VuhO Iz3dqb.U0w" should equal "$-Wy,dM79H'i'o$n0C&I.ZTcMJw5vPlZc Hn!krhlaa:khV mkL;gvtP-S7Rt1Vp2RV:wV9VuhO Iz3dqb.U0w" any suggestion ?

  • mobley-trent Avatar

    'Kobayashi-Maru-Test' is being returned as 'kobayashi-maru-Test'. Anyone else with the same bug?

  • LS2008 Avatar

    fun kata!

  • marjan Avatar

    How do you know in decrypt case where are upper chars at the beginning of the words? Maybe, after special chars such as ", -...

  • RealKenshiro Avatar

    Very cool kata and original cipher!

  • rge123 Avatar

    It would be way easier to see the space char if

    ".,:;-?! '()$%&" and the '"'-char

    was replaced with

    ".,:;-?! '()$%&" and the '"'-char

  • COlson28 Avatar

    Not sure if this is a question because I'm stupid, or an issue because there is a bug. I'm in C# trying to throw a bog-standard exception (like we were told to do) but I just can't get the test case to pass. This is what I am doing:

    throw new Exception();

    but the test case keeps saying:

    Test Failed Expected: <System.Exception> But was: null

    I can pass out OTHER exceptions and have the test case see those, but obviously that is incorrect because it is not the correct exception. Any help here would be great

  • spocks_robot Avatar

    greetings,

    this part where it says, (the following chars: ".,:;-?! '()$%&" and the '"'-char)....does the last part mean, " symbol as in double qoutation mark for the last char in the region of chars?

  • krakenj Avatar

    This comment has been hidden.

  • G_kuldeep Avatar

    Very nice kata.. Fun to solve.. Thanks;-)

  • jbultema Avatar

    Fun kata. The wording on the explanation of the region-difference was very unclear to me. It took ages for me to figure out what was actually desired. Showing an example for the third character would be very helpful for this point.

    I found an error in the testing for unallowed characters in Python, where the instructions ask to throw an "Exception" but the test is looking for "Error". Easy fix in my code, but should be corrected in either the instructions or test.

  • smokinhiro Avatar

    I try to throw an exception with "throw std::exception()" (or with invalid argument) like many of the solutions do, but I keep getting a message saying "No exception thrown." or "Wrong exception thrown." Could this be a bug?

  • Kindread21 Avatar

    This part of the description seems weird

    "Take the difference from the region-index of the char before (from the input text! Not from the fresh encrypted char before!)."

    This could be read as you should use the index value for the n-1, before any transforms from step 1 (so without any change in case), rather than without any of the transforms during step 2.

    At the very least it should be reworded to be clearer. Also, information is brackets is usually supplemental/optional, rather than required information.

  • w4ff3l Avatar

    Thanks for this Kata! It was really enjoyable. But I feel so dumb everytime I see the other Solutions...

  • itchy_eagler>< Avatar

    iam getting this error "terminating with unexpected exception of type std::exception*" Language used is c++

  • ZhaoGuang888 Avatar

    This comment has been hidden.

  • B1ts Avatar

    It should be made clear in step1 that every 2nd char is to be converted to uppercase if it's lowercase AND to lowercase if it's uppercase. The instructions just mention about uppercase.

    I spent so much time debugging it and I would've given up if there wasn't a hint in this discussion chat.

  • TuffGuy Avatar

    Hey Guys. I am trying to finish this kata with C++. I have passed all the tests except of Random Test. Please, help me. Time: 10ms Passed: 4 Failed: 1 Test Results: ExampleTest _0_EncryptTests _1_DecryptTests _2_EmptyTests ExtendedTests _0_NotAllowedCharactersTests _1_RandomTests Expected: equal to n1,2tvu$ Actual: CqarI9JKg

    How can I understand the meaning of the random test?

  • Deia Avatar

    It would be VERY helpful to indicate where exactly the space is within the region (finally found it hiding between the exclamation point and the apostrophe). It's almost impossible to see in the list of punctuation in the description. Honestly providing a list of all the punctuation in the proper order and just saying "copy-paste this into your code where you need to" would be great since that's not really part of the coding challenge.

    Also please consider extending your example of "Business" to show encryption for the first 3 letters, since the encryption process is slightly different for the first "s".

  • Deia Avatar

    could someone please direct me to a resource explaining what is meant by "region" in this context?? I am not familiar with the term. Thank you!

  • tonioteran Avatar

    I'm having trouble finishing this Kata in c++. Everything seems to be working appropriately (all tests are successful), but there seems to be something within the _0_NotAllowedCharactersTests Extended Tests that's not allowing me to fully submit my solution. I know that there are some prechecks in the instructions, but nothing for c++, yet I think I've narrowed down the error to not having thrown an exception whenever there's an invalid character. I can't seem to do this correctly, given that I get either a SIGABRT or SIGSEGV signal. Any thoughts? Thank you so much!

  • Ze-Marcos Avatar

    This comment has been hidden.

  • Ze-Marcos Avatar

    can you write the rest of the example with "Business" I get how to create the region with all 77 chars, and step 1 and as well step 3. but for some reason I am messing up on step 2. can you write the rest of the example for step 2 please for the string "Business".

  • chimera13 Avatar

    I am quite new to Python and this was a nice challenge to learn a lot about Python. The detailed steps made it understandable even for a non-english speaker. Fabulous task!

  • AlexPuts Avatar

    The detailed descriptions helped a lot, especially these stages. Thanks a lot, it was great.

  • sawamura Avatar

    Nice kata! Thank you.

    I have only a small suggestion: do not use the "from the input text!" expression in the second step of the algorithm, because one has to use the case modified text.

  • docgunthrop Avatar

    This comment has been hidden.

  • oxxidQ Avatar

    Hello,

    I have problem passing first assert in the test EncryptExampleTests. This is the test output:

    String lengths are both 86. Strings differ at index 13. Expected: "$-Wy,dM79H'i'o$n0C&I.ZTcMJw5vPlZc Hn!krhlaa:khV mkL;gvtP-S7Rt..." But was__:"$-Wy,dM79H'i'-vn0C&I.ZT2,Jw5vPlZc H;qkrhlaa:khV mkL;gvtP-S7Rt..." ------------------------^ The " character seems to be causing the issue. Can anybody here give me a hand here? All other test pass sucessfully.

    Thank you

  • pythagoraskitty Avatar

    I am able to pass all tests except the ExtendedTests: _0_NotAllowedCharactersTests. I tried throwing an exception for characters not found in the region, but when '#' occurs in the text to encrypt I still get the message: ✘ Expected std::exception. No exception was thrown.

    I could post some portion of my code here, but I am not sure what the rules are about doing so.

    Thank you for any hints that you could give me.

  • Dentzil Avatar

    C++-Translation kumited!

    Please check it and approve! Thanks. (:

  • zebulan Avatar

    @SteffenVogel,

    Python translation kumited!

    I also made a few changes to the description to (hopefully) make it more readable. If you have any questions, just let me know!

    EDIT:

    Just so you know, I tested the Python translation using both Python 2 and Python 3.

  • smile67 Avatar

    Sorry for the delay, busy day;-)... Again good kata, thanks:-)!