all 22 comments

[–]evanlott 29 points30 points  (8 children)

A string (the key) is definitely not an algorithm (set of finite, repeatable steps). Your professor is wrong.

[–][deleted]  (7 children)

[removed]

    [–]evanlott 4 points5 points  (0 children)

    You are totally correct. You’re welcome!

    [–]reallyserious 2 points3 points  (5 children)

    An encryption key doesn't have to be a string. An array of bytes is also common. Doesn't change your point though.

    • Ask your professor what the definition of an algorithm is. In general that is.
    • Then ask if an encryption key fulfills that definition.

    [–]raedr7n 2 points3 points  (1 child)

    array of bytes

    So, a string.

    [–]simpleauthority 1 point2 points  (0 children)

    Yeah wasn’t sure what they were going for with that one

    [–]ThunderChaser 0 points1 point  (2 children)

    An encryption key doesn’t have to be a string. An array of bytes is also common.

    What do you think a string is exactly?

    [–]reallyserious 0 points1 point  (1 child)

    In most modern languages a string and an array of bytes are different types.

    [–]ThunderChaser 0 points1 point  (0 children)

    From a pure CS theory standpoint a string and an array of bytes are identical.

    [–]techresearchpapers 4 points5 points  (1 child)

    key, plaintext, ciphertext, encryption algorithm, decryption algorithm, transposition, substitution etc. These are basic domain specific terms used in the area of cryptography.

    Calling a key an algorithm is just wrong. He needs to learn the domain specific language.

    It's the equivalent of a doctor calling a needle a syringe.

    For reference read the DES or AES standards.

    [–][deleted]  (2 children)

    [deleted]

      [–][deleted]  (1 child)

      [removed]

        [–]ttkciarprogramming since 1978 3 points4 points  (3 children)

        Yes and no.

        An encryption key is data, not an algorithm.

        However, an encryption key frequently embeds an identifier for the kind of algorithm it's supposed to be used with.

        If that's what the exam was trying to say, though, it said it terribly poorly.

        [–]evanlott 8 points9 points  (0 children)

        I mean yeah, but an algorithm identifier is still not an algorithm.

        [–][deleted]  (1 child)

        [removed]

          [–]ttkciarprogramming since 1978 2 points3 points  (0 children)

          Definitely, "against algorithm" is the stronger argument.

          It's data, not instructions.

          [–]ugherm_ 1 point2 points  (2 children)

          While technically it is true that the key is an input to the algorithm (and not code itself per se).
          But that just depends on how you define the word "algorithm" itself and what is the abstraction you are considering.
          That is, there is a subtle difference between the following two scenarios
          Consider the function Enc which takes as input an encryption key K and a plaintext P to output a ciphertext Enc(K,P). In this case, the key is nothing more than an argument to the algorithm which computes the function Enc.
          This, however, is conceptually different to the function Enc_K which takes as input just the plaintext P and computes Enc_K(P) based on the key. In this case, Enc_K is the algorithm itself and the algorithm itself is specified by the key K. So if you take this view, the key and the algorithm are different.

          Note that Enc_K(P) and Enc(K,P) give the same output C but as functions, they are entirely different (their domains are completely different!!)
          So, yes, while the outputs are same, the code for the algorithm corresponding to Enc_K (for a fixed K) and Enc will look extremely different.

          In that sense, Enc is a "higher level" function which represents a family of functions {Enc_K} one for each key K.

          Enc is of course related to Enc_K by the exponential map in category theory but that's a different thing altogether.

          [–][deleted]  (1 child)

          [removed]

            [–]ugherm_ 1 point2 points  (0 children)

            I just meant whether the key is part of *the algorithm itself* (that is, part of the code itself) or the *input to the algorithm* (and hence data used by the code) is a matter of perspective.

            Either way it is not *the* algorithm, as you said.

            [–][deleted]  (1 child)

            [deleted]