Ad
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Not sure what you mean. There are elegant algorithmic solutions to the problem using the triplets.

  • Default User Avatar

    Thanks for your help. I posted my solution because no one didn't comment on my first comment.

  • Custom User Avatar

    Please don't post solutions in Discourse. It means you can make changes (if you want) to your code before submitting it. After that, that's the solution it'll show no matter how many times you submit another version. Note this kata is a Draft, so you can't submit your solution.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    I have solved it and passes all test but i don't know why I can't sbmit my solution.

  • Default User Avatar

    Your code is wrong. Don't round it but.. Example: (5.6 => 5), (5.3 => 5), (4.8 => 4)

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    Okay sir, thanks for the advice.

  • Custom User Avatar

    Treat it as a [ bad ] hash function :-)

    FIFY :P

    @author: maybe you could lower the expectations somewhat by using the word "hashing" or "encoding" instead of "encryption". Encryption just is never simple. You might have kept the use of an index by using a modulo; you might have used an xor instead of a division ( or instead of an average ) to keep things more cryptographically sound, but if you want to keep things simple, invoking cryptography is not the way to do it.

    You are free to design your kata any way you like, but set the scene appropriately. :]

  • Custom User Avatar

    A lossy encryption algorithm ?!?

    Treat it as a hash function :-)

  • Default User Avatar

    I'm very thankful for this comment, what I wanted to is to create a very simple encryption but I was wrong for adding the index in a computation. Thank you, I'll fix this.

  • Custom User Avatar

    A lossy encryption algorithm ?!?

    With key "hi", given the ciphertext, you can't know if the first character of the plaintext is 'H' or 'I'.

    As an author, you have a lot of leeway in designing your kata, but this is ridiculous.

    Note: If the process is done but the other characters in the password are not used, encrypt the remaining characters in the password by adding its index and its ascii decimal then add 40 and divide it by 2 and convert the result into a character. Ex. ((index+decimal)+40)/2. Concatenate it to the first encrypted string.

    Given a key and a ciphertext, how will you know where the plaintext ends and the trailing garbage begins? Trailing garbage might look like perfectly valid plaintext ( for medium high indices, you'll get digits ).

    It is even possible to run out of ASCII for longer key values ( note that standard ASCII only goes up to 127 ).

    Please don't make any contributions to OpenSSL just yet. :S

  • Default User Avatar

    It is my bad, what I'm trying to say is the remaining characters that are not used. Thank you again for that.

  • Default User Avatar

    Yeah I know, I'm pretty bad at english but I want to author a problem so I'll thank you for that. I'll fix the grammar soon.

  • Loading more items...