How did || come to be used in crypto texts to represent concatenation?












15












$begingroup$


In RFC5647, NIST SP 800-38D, etc., || is used to denote concatenation. How did that come to be?



In most programming languages || represents "or" and + denotes concatenation and the fact that crypto texts just kind of mixed it up seems to make for an easy gotcha.










share|improve this question











$endgroup$












  • $begingroup$
    Don't remember how it started to appears in articles, however, using plus was confusing with math plus if you don't carefully look at the notation of the articles.
    $endgroup$
    – kelalaka
    Dec 24 '18 at 11:39






  • 6




    $begingroup$
    I'd argue that it's programming languages that use weird notation. The symbol for logical or has as far as I can tell always been $lor$. So there isn't really any confusion.
    $endgroup$
    – Maeher
    Dec 24 '18 at 11:53
















15












$begingroup$


In RFC5647, NIST SP 800-38D, etc., || is used to denote concatenation. How did that come to be?



In most programming languages || represents "or" and + denotes concatenation and the fact that crypto texts just kind of mixed it up seems to make for an easy gotcha.










share|improve this question











$endgroup$












  • $begingroup$
    Don't remember how it started to appears in articles, however, using plus was confusing with math plus if you don't carefully look at the notation of the articles.
    $endgroup$
    – kelalaka
    Dec 24 '18 at 11:39






  • 6




    $begingroup$
    I'd argue that it's programming languages that use weird notation. The symbol for logical or has as far as I can tell always been $lor$. So there isn't really any confusion.
    $endgroup$
    – Maeher
    Dec 24 '18 at 11:53














15












15








15


1



$begingroup$


In RFC5647, NIST SP 800-38D, etc., || is used to denote concatenation. How did that come to be?



In most programming languages || represents "or" and + denotes concatenation and the fact that crypto texts just kind of mixed it up seems to make for an easy gotcha.










share|improve this question











$endgroup$




In RFC5647, NIST SP 800-38D, etc., || is used to denote concatenation. How did that come to be?



In most programming languages || represents "or" and + denotes concatenation and the fact that crypto texts just kind of mixed it up seems to make for an easy gotcha.







nist standards notation literature






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 25 '18 at 3:25









Peter Mortensen

1152




1152










asked Dec 24 '18 at 4:15









neubertneubert

1,3571529




1,3571529












  • $begingroup$
    Don't remember how it started to appears in articles, however, using plus was confusing with math plus if you don't carefully look at the notation of the articles.
    $endgroup$
    – kelalaka
    Dec 24 '18 at 11:39






  • 6




    $begingroup$
    I'd argue that it's programming languages that use weird notation. The symbol for logical or has as far as I can tell always been $lor$. So there isn't really any confusion.
    $endgroup$
    – Maeher
    Dec 24 '18 at 11:53


















  • $begingroup$
    Don't remember how it started to appears in articles, however, using plus was confusing with math plus if you don't carefully look at the notation of the articles.
    $endgroup$
    – kelalaka
    Dec 24 '18 at 11:39






  • 6




    $begingroup$
    I'd argue that it's programming languages that use weird notation. The symbol for logical or has as far as I can tell always been $lor$. So there isn't really any confusion.
    $endgroup$
    – Maeher
    Dec 24 '18 at 11:53
















$begingroup$
Don't remember how it started to appears in articles, however, using plus was confusing with math plus if you don't carefully look at the notation of the articles.
$endgroup$
– kelalaka
Dec 24 '18 at 11:39




$begingroup$
Don't remember how it started to appears in articles, however, using plus was confusing with math plus if you don't carefully look at the notation of the articles.
$endgroup$
– kelalaka
Dec 24 '18 at 11:39




6




6




$begingroup$
I'd argue that it's programming languages that use weird notation. The symbol for logical or has as far as I can tell always been $lor$. So there isn't really any confusion.
$endgroup$
– Maeher
Dec 24 '18 at 11:53




$begingroup$
I'd argue that it's programming languages that use weird notation. The symbol for logical or has as far as I can tell always been $lor$. So there isn't really any confusion.
$endgroup$
– Maeher
Dec 24 '18 at 11:53










2 Answers
2






active

oldest

votes


















11












$begingroup$

The origin is set theory and not programming languages. In the context of cryptography, I could describe a set that is
$$x_1 parallel x_2 parallel dots parallel x_n$$
as a concatenation of the series described by
$$parallel_{i=1}^n x_i.$$
Furthermore, it's worth noting that + to a mathematician would suggest that it is a commutative, which might not be true depending on the set (as we could have a set of functions).






share|improve this answer











$endgroup$









  • 3




    $begingroup$
    While I agree that the notation comes from mathematics, I'm not sure exactly what you mean by "a set that is [...] a concatenation sum". I've seen $|$ used to denote the concatenation of strings or tuples, such that if $a = (1,2)$ and $b = (3,4,5)$, then $a,|,b = (1,2,3,4,5)$, and of course one can naturally generalize this to sets of strings or tuples, but I'm not sure if that's what you mean. Or what, if anything, rational numbers have to do with any of it.
    $endgroup$
    – Ilmari Karonen
    Dec 24 '18 at 21:29










  • $begingroup$
    @IlmariKaronen Good points, I will update the answer to reflect that. I was being lazy as it's a holiday here. The real numbers note was just me pointing to that cryptography uses numbers. My work usually has concatenation of functions in a set; however, the set is bounded so I cannot just have general statements without something running out of the bounds.
    $endgroup$
    – b degnan
    Dec 25 '18 at 2:26



















9












$begingroup$

Some languages like PL/I and Oracle Database SQL indeed use || for string concatenation.



One reason is maybe that + might be confusing when talking about fundamental cryptography, since there is a lot of math involved. The mathematical notation for 'OR' would be reversed caret $lor$ and the exclusive 'OR', better known as 'XOR' is a circled plus $oplus$.



But I don't think that there is a specific reason for using || for a string concatenation. If anything then I would presume that someone used it once early and then it has become accustomed until it has become a standard for cryptography.






share|improve this answer









$endgroup$














    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "281"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcrypto.stackexchange.com%2fquestions%2f66067%2fhow-did-come-to-be-used-in-crypto-texts-to-represent-concatenation%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    11












    $begingroup$

    The origin is set theory and not programming languages. In the context of cryptography, I could describe a set that is
    $$x_1 parallel x_2 parallel dots parallel x_n$$
    as a concatenation of the series described by
    $$parallel_{i=1}^n x_i.$$
    Furthermore, it's worth noting that + to a mathematician would suggest that it is a commutative, which might not be true depending on the set (as we could have a set of functions).






    share|improve this answer











    $endgroup$









    • 3




      $begingroup$
      While I agree that the notation comes from mathematics, I'm not sure exactly what you mean by "a set that is [...] a concatenation sum". I've seen $|$ used to denote the concatenation of strings or tuples, such that if $a = (1,2)$ and $b = (3,4,5)$, then $a,|,b = (1,2,3,4,5)$, and of course one can naturally generalize this to sets of strings or tuples, but I'm not sure if that's what you mean. Or what, if anything, rational numbers have to do with any of it.
      $endgroup$
      – Ilmari Karonen
      Dec 24 '18 at 21:29










    • $begingroup$
      @IlmariKaronen Good points, I will update the answer to reflect that. I was being lazy as it's a holiday here. The real numbers note was just me pointing to that cryptography uses numbers. My work usually has concatenation of functions in a set; however, the set is bounded so I cannot just have general statements without something running out of the bounds.
      $endgroup$
      – b degnan
      Dec 25 '18 at 2:26
















    11












    $begingroup$

    The origin is set theory and not programming languages. In the context of cryptography, I could describe a set that is
    $$x_1 parallel x_2 parallel dots parallel x_n$$
    as a concatenation of the series described by
    $$parallel_{i=1}^n x_i.$$
    Furthermore, it's worth noting that + to a mathematician would suggest that it is a commutative, which might not be true depending on the set (as we could have a set of functions).






    share|improve this answer











    $endgroup$









    • 3




      $begingroup$
      While I agree that the notation comes from mathematics, I'm not sure exactly what you mean by "a set that is [...] a concatenation sum". I've seen $|$ used to denote the concatenation of strings or tuples, such that if $a = (1,2)$ and $b = (3,4,5)$, then $a,|,b = (1,2,3,4,5)$, and of course one can naturally generalize this to sets of strings or tuples, but I'm not sure if that's what you mean. Or what, if anything, rational numbers have to do with any of it.
      $endgroup$
      – Ilmari Karonen
      Dec 24 '18 at 21:29










    • $begingroup$
      @IlmariKaronen Good points, I will update the answer to reflect that. I was being lazy as it's a holiday here. The real numbers note was just me pointing to that cryptography uses numbers. My work usually has concatenation of functions in a set; however, the set is bounded so I cannot just have general statements without something running out of the bounds.
      $endgroup$
      – b degnan
      Dec 25 '18 at 2:26














    11












    11








    11





    $begingroup$

    The origin is set theory and not programming languages. In the context of cryptography, I could describe a set that is
    $$x_1 parallel x_2 parallel dots parallel x_n$$
    as a concatenation of the series described by
    $$parallel_{i=1}^n x_i.$$
    Furthermore, it's worth noting that + to a mathematician would suggest that it is a commutative, which might not be true depending on the set (as we could have a set of functions).






    share|improve this answer











    $endgroup$



    The origin is set theory and not programming languages. In the context of cryptography, I could describe a set that is
    $$x_1 parallel x_2 parallel dots parallel x_n$$
    as a concatenation of the series described by
    $$parallel_{i=1}^n x_i.$$
    Furthermore, it's worth noting that + to a mathematician would suggest that it is a commutative, which might not be true depending on the set (as we could have a set of functions).







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Dec 25 '18 at 2:27

























    answered Dec 24 '18 at 12:16









    b degnanb degnan

    2,0481829




    2,0481829








    • 3




      $begingroup$
      While I agree that the notation comes from mathematics, I'm not sure exactly what you mean by "a set that is [...] a concatenation sum". I've seen $|$ used to denote the concatenation of strings or tuples, such that if $a = (1,2)$ and $b = (3,4,5)$, then $a,|,b = (1,2,3,4,5)$, and of course one can naturally generalize this to sets of strings or tuples, but I'm not sure if that's what you mean. Or what, if anything, rational numbers have to do with any of it.
      $endgroup$
      – Ilmari Karonen
      Dec 24 '18 at 21:29










    • $begingroup$
      @IlmariKaronen Good points, I will update the answer to reflect that. I was being lazy as it's a holiday here. The real numbers note was just me pointing to that cryptography uses numbers. My work usually has concatenation of functions in a set; however, the set is bounded so I cannot just have general statements without something running out of the bounds.
      $endgroup$
      – b degnan
      Dec 25 '18 at 2:26














    • 3




      $begingroup$
      While I agree that the notation comes from mathematics, I'm not sure exactly what you mean by "a set that is [...] a concatenation sum". I've seen $|$ used to denote the concatenation of strings or tuples, such that if $a = (1,2)$ and $b = (3,4,5)$, then $a,|,b = (1,2,3,4,5)$, and of course one can naturally generalize this to sets of strings or tuples, but I'm not sure if that's what you mean. Or what, if anything, rational numbers have to do with any of it.
      $endgroup$
      – Ilmari Karonen
      Dec 24 '18 at 21:29










    • $begingroup$
      @IlmariKaronen Good points, I will update the answer to reflect that. I was being lazy as it's a holiday here. The real numbers note was just me pointing to that cryptography uses numbers. My work usually has concatenation of functions in a set; however, the set is bounded so I cannot just have general statements without something running out of the bounds.
      $endgroup$
      – b degnan
      Dec 25 '18 at 2:26








    3




    3




    $begingroup$
    While I agree that the notation comes from mathematics, I'm not sure exactly what you mean by "a set that is [...] a concatenation sum". I've seen $|$ used to denote the concatenation of strings or tuples, such that if $a = (1,2)$ and $b = (3,4,5)$, then $a,|,b = (1,2,3,4,5)$, and of course one can naturally generalize this to sets of strings or tuples, but I'm not sure if that's what you mean. Or what, if anything, rational numbers have to do with any of it.
    $endgroup$
    – Ilmari Karonen
    Dec 24 '18 at 21:29




    $begingroup$
    While I agree that the notation comes from mathematics, I'm not sure exactly what you mean by "a set that is [...] a concatenation sum". I've seen $|$ used to denote the concatenation of strings or tuples, such that if $a = (1,2)$ and $b = (3,4,5)$, then $a,|,b = (1,2,3,4,5)$, and of course one can naturally generalize this to sets of strings or tuples, but I'm not sure if that's what you mean. Or what, if anything, rational numbers have to do with any of it.
    $endgroup$
    – Ilmari Karonen
    Dec 24 '18 at 21:29












    $begingroup$
    @IlmariKaronen Good points, I will update the answer to reflect that. I was being lazy as it's a holiday here. The real numbers note was just me pointing to that cryptography uses numbers. My work usually has concatenation of functions in a set; however, the set is bounded so I cannot just have general statements without something running out of the bounds.
    $endgroup$
    – b degnan
    Dec 25 '18 at 2:26




    $begingroup$
    @IlmariKaronen Good points, I will update the answer to reflect that. I was being lazy as it's a holiday here. The real numbers note was just me pointing to that cryptography uses numbers. My work usually has concatenation of functions in a set; however, the set is bounded so I cannot just have general statements without something running out of the bounds.
    $endgroup$
    – b degnan
    Dec 25 '18 at 2:26











    9












    $begingroup$

    Some languages like PL/I and Oracle Database SQL indeed use || for string concatenation.



    One reason is maybe that + might be confusing when talking about fundamental cryptography, since there is a lot of math involved. The mathematical notation for 'OR' would be reversed caret $lor$ and the exclusive 'OR', better known as 'XOR' is a circled plus $oplus$.



    But I don't think that there is a specific reason for using || for a string concatenation. If anything then I would presume that someone used it once early and then it has become accustomed until it has become a standard for cryptography.






    share|improve this answer









    $endgroup$


















      9












      $begingroup$

      Some languages like PL/I and Oracle Database SQL indeed use || for string concatenation.



      One reason is maybe that + might be confusing when talking about fundamental cryptography, since there is a lot of math involved. The mathematical notation for 'OR' would be reversed caret $lor$ and the exclusive 'OR', better known as 'XOR' is a circled plus $oplus$.



      But I don't think that there is a specific reason for using || for a string concatenation. If anything then I would presume that someone used it once early and then it has become accustomed until it has become a standard for cryptography.






      share|improve this answer









      $endgroup$
















        9












        9








        9





        $begingroup$

        Some languages like PL/I and Oracle Database SQL indeed use || for string concatenation.



        One reason is maybe that + might be confusing when talking about fundamental cryptography, since there is a lot of math involved. The mathematical notation for 'OR' would be reversed caret $lor$ and the exclusive 'OR', better known as 'XOR' is a circled plus $oplus$.



        But I don't think that there is a specific reason for using || for a string concatenation. If anything then I would presume that someone used it once early and then it has become accustomed until it has become a standard for cryptography.






        share|improve this answer









        $endgroup$



        Some languages like PL/I and Oracle Database SQL indeed use || for string concatenation.



        One reason is maybe that + might be confusing when talking about fundamental cryptography, since there is a lot of math involved. The mathematical notation for 'OR' would be reversed caret $lor$ and the exclusive 'OR', better known as 'XOR' is a circled plus $oplus$.



        But I don't think that there is a specific reason for using || for a string concatenation. If anything then I would presume that someone used it once early and then it has become accustomed until it has become a standard for cryptography.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 24 '18 at 12:13









        AleksanderRasAleksanderRas

        2,9521935




        2,9521935






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Cryptography Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcrypto.stackexchange.com%2fquestions%2f66067%2fhow-did-come-to-be-used-in-crypto-texts-to-represent-concatenation%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Bundesstraße 106

            Le Mesnil-Réaume

            Ida-Boy-Ed-Garten