(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Wolfram 15.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       154,          7]
NotebookDataLength[     50743,       1355]
NotebookOptionsPosition[     41238,       1179]
NotebookOutlinePosition[     43295,       1228]
CellTagsIndexPosition[     43217,       1223]
WindowTitle->HMACHash
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[GridBox[{
   {GridBox[{
      {
       ItemBox[Cell[BoxData[
         RowBox[{
          TemplateBox[{12},
           "Spacer1"], Cell[
          "WOLFRAM INSTITUTE/ PUZZLES SYMBOL", "PacletNameCell",
           TextAlignment->Center,ExpressionUUID->
           "08141855-0294-4e3b-8051-947f54a79901"], 
          TemplateBox[{8},
           "Spacer1"]}]],
         TextAlignment->Center,ExpressionUUID->
         "122b227f-2a78-49f1-bafd-cc5837139b84"],
        Background->LightDarkSwitched[
          RGBColor[0.490196, 0.576471, 0.690196]],
        ItemSize->Full], ""}
     },
     GridBoxAlignment->{"Rows" -> {{Center}}},
     GridBoxItemSize->{"Columns" -> {Full, 
         Scaled[0.02]}, "Rows" -> {{2.5}}}], Cell[TextData[{
     Cell[BoxData[
      TagBox[
       ActionMenuBox[
        FrameBox[Cell[TextData[{
          "See Also",
          " ",
          Cell[BoxData[
           GraphicsBox[
            {GrayLevel[0.66667], Thickness[0.13], 
             LineBox[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]},
            AspectRatio->1,
            ImageSize->20,
            PlotRange->{{-3, 4}, {-1, 1}}]],ExpressionUUID->
           "f5927284-cf05-44db-8103-01b8b832d570"]
         }],ExpressionUUID->"7cb718f1-d9c3-45be-9635-eafd7b96ccfa"],
         StripOnInput->False],{
        StyleBox["\"Hash\"", "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup["paclet:ref/Hash"], 
         StyleBox["\"ByteArray\"", "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup["paclet:ref/ByteArray"], Delimiter, 
         StyleBox[
          "\"Functions\"", "SeeAlsoSection", FontSize -> 14, FontSlant -> 
           "Italic", StripOnInput -> False] :> 
         NotebookFind[EvaluationNotebook[], "SeeAlsoSection", All, CellStyle],
          StyleBox[
          StyleBox["\"PBKDF2Key\"", "SeeAlsoRelated", StripOnInput -> False], 
           "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/PBKDF2Key"], 
         StyleBox[
          StyleBox["\"BIP39Seed\"", "SeeAlsoRelated", StripOnInput -> False], 
           "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/BIP39Seed"], 
         StyleBox[
          StyleBox[
           "\"ElectrumSeedVersion\"", "SeeAlsoRelated", StripOnInput -> 
            False], "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/ElectrumSeedVersion"]},
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"SeeAlso"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "2a535ef0-334c-49dd-ade3-ad330d535d29"],
     "\[ThickSpace]\[ThickSpace]\[ThickSpace]\[ThickSpace]\[ThickSpace]\
\[ThickSpace]",
     Cell[BoxData[
      TagBox[
       ActionMenuBox[
        FrameBox[Cell[TextData[{
          "Related Guides",
          " ",
          Cell[BoxData[
           GraphicsBox[
            {GrayLevel[0.66667], Thickness[0.13], 
             LineBox[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]},
            AspectRatio->1,
            ImageSize->20,
            PlotRange->{{-3, 4}, {-1, 1}}]],ExpressionUUID->
           "86b70262-d396-480b-932b-726e4e991cdc"]
         }],ExpressionUUID->"84bcfaaa-a775-4315-9dd4-1baa59c75239"],
         StripOnInput->False],{
        "\"Seeds\"" :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/guide/Seeds"]},
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"MoreAbout"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "7ae99f79-c7d7-49ca-b3d0-afa22e20eba4"],
     "\[ThickSpace]\[ThickSpace]\[ThickSpace]\[ThickSpace]\[ThickSpace]\
\[ThickSpace]",
     Cell[BoxData[
      TagBox[
       ActionMenuBox[
        FrameBox[Cell[TextData[{
          "URL",
          " ",
          Cell[BoxData[
           GraphicsBox[
            {GrayLevel[0.66667], Thickness[0.13], 
             LineBox[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]},
            AspectRatio->1,
            ImageSize->20,
            PlotRange->{{-3, 4}, {-1, 1}}]],ExpressionUUID->
           "98e6d89c-8e83-42cb-bcc4-55fab9ee2de7"]
         }],ExpressionUUID->"feb10110-7ed5-4091-a803-0d6e2f4a4b57"],
         StripOnInput->False],{
        "\"WolframInstitute/Puzzles/ref/HMACHash\"" :> None, 
         "\"Copy Wolfram Documentation Center URL\"" :> 
         CopyToClipboard["WolframInstitute/Puzzles/ref/HMACHash"], Delimiter, 
         "\"Copy web URL\"" :> 
         Module[{DocumentationSearch`Private`nb$}, 
           DocumentationSearch`Private`nb$ = 
            NotebookPut[
             Notebook[{
               Cell[BoxData[
                 MakeBoxes[
                  Hyperlink[
                   "http://reference.wolfram.com/language/WolframInstitute/\
Puzzles/ref/HMACHash.html"], StandardForm]], "Input", TextClipboardType -> 
                 "PlainText"]}, Visible -> False]]; 
           SelectionMove[DocumentationSearch`Private`nb$, All, Notebook]; 
           FrontEndTokenExecute[DocumentationSearch`Private`nb$, "Copy"]; 
           NotebookClose[DocumentationSearch`Private`nb$]; Null], 
         "\"Go to web URL\"" :> 
         FrontEndExecute[{
           NotebookLocate[{
             URL[If[TrueQ[False], 
                 "http://reference.wolfram.com/system-modeler/", 
                 "http://reference.wolfram.com/language/"] <> 
               "WolframInstitute/Puzzles/ref/HMACHash" <> ".html"], None}]}]},
        
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"URLMenu"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "633dfb4e-de78-4a42-9318-20b54871644d"]
    }], "AnchorBar",
     CacheGraphics->False,ExpressionUUID->
     "b7e1610b-af69-416b-94c7-26ea1861f9fe"]}
  }]], "AnchorBarGrid",
 CellID->1,ExpressionUUID->"a8046eae-c6c3-4710-9c25-de7f16e19660"],

Cell["WolframInstitute`Puzzles`", "ContextNameCell",ExpressionUUID->"247cd8c3-6e9c-478e-8db8-4834ea9947e3"],

Cell[CellGroupData[{

Cell[BoxData[GridBox[{
   {Cell[TextData[{
     Cell[
     "HMACHash", "ObjectName",ExpressionUUID->
      "79aab17e-f56d-4d7e-92b3-b3fb986b20b8"],
     Cell[BoxData[
      TemplateBox[{8},
       "Spacer1"]],ExpressionUUID->"7223855a-d6e4-4502-a2cf-e35a3fa17ed6"],
     Cell[BoxData[
     ""], "ObjectNameTranslation",ExpressionUUID->
      "99e95391-967f-40d7-b69c-335928306d67"]
    }],ExpressionUUID->"ac20cd59-f6ef-4551-bc46-36b59e07f8c9"], 
    "\[SpanFromLeft]"}
  }]], "ObjectNameGrid",ExpressionUUID->"75d38131-ce7c-42db-a8f7-\
f8865e9dc3f0"],

Cell[BoxData[GridBox[{
   {"", Cell[TextData[{
     Cell[BoxData[
      RowBox[{
       TemplateBox[{
         Cell[
          TextData["HMACHash"]], 
         "paclet:WolframInstitute/Puzzles/ref/HMACHash", 
         "WolframInstitute/Puzzles Package Symbol"},
        "PackageLink",
        BaseStyle->"InlineFormula"], "[", 
       RowBox[{
        StyleBox["key", "TI"], ",", " ", 
        StyleBox["message", "TI"], ",", " ", 
        StyleBox["type", "TI"]}], "]"}]], "InlineFormula",
      FontFamily->"Source Sans Pro",
      FontSize->0.9 Inherited,ExpressionUUID->
      "81e2e292-790b-43ce-a980-03e00df93cea"],
     "\[LineSeparator]",
     "gives the RFC 2104 keyed hash of ",
     StyleBox["message", "TI"],
     " under ",
     StyleBox["key", "TI"],
     " as a ",
     Cell[BoxData[
      TemplateBox[{
        Cell[
         TextData["ByteArray"]], "paclet:ref/ByteArray"},
       "RefLink",
       BaseStyle->"InlineFormula"]], "InlineFormula",
      FontFamily->"Source Sans Pro",ExpressionUUID->
      "c971d699-d5a5-4a33-a81a-eb99047c0a45"],
     ", with ",
     StyleBox["type", "TI"],
     " the underlying hash ",
     Cell[BoxData["\"\<SHA256\>\""], "InlineFormula",
      FontFamily->"Source Sans Pro",
      FontSize->0.9 Inherited,ExpressionUUID->
      "a3ec6487-e349-4ce8-b3be-00c31b28927f"],
     " or ",
     Cell[BoxData["\"\<SHA512\>\""], "InlineFormula",
      FontFamily->"Source Sans Pro",
      FontSize->0.9 Inherited,ExpressionUUID->
      "cd8ec7d3-0ea4-4a1c-9346-f3fe896be17f"],
     "."
    }],ExpressionUUID->"7f54e13d-eb89-40db-bc81-d2444c2425cd"]}
  }]], "Usage",ExpressionUUID->"a9fe4048-c6e9-4c5c-963b-4c7f638000f8"]
}, Open  ]],

Cell[CellGroupData[{

Cell[TextData[Cell[BoxData[Cell[TextData[{
  Cell[BoxData[
   DynamicBox[ToBoxes[
     If[CurrentValue[
        EvaluationCell[], "CellGroupOpen"] =!= Closed, 
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], 
      Rotate[
       Style[
        Graphics[{
          Thickness[0.18], 
          RGBColor[0.8509803921568627, 0.396078431372549, 0], 
          Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
         PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
        0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]],
    ImageSizeCache->{
     13.600000000000001`, {-0.1685058593749993, 13.768505859375}}]],
   ExpressionUUID->"7b25b5b5-c939-4970-906d-2781eaf176d3"],
  Cell[BoxData[
   TemplateBox[{1},
    "Spacer1"]],ExpressionUUID->"5b2d37e2-a501-435b-b7fd-0a62de63a4ab"],
  "Details and Options"
 }], "NotesFrameText",ExpressionUUID->
  "b6b61f34-518a-4c33-ab63-830e428015cd"]],ExpressionUUID->"213872f1-534f-\
489d-a65a-52fb7e422259"]], "NotesSection",
 ShowGroupOpener->"Thumbnail",
 WholeCellGroupOpener->True,
 CellGroupingRules->{"SectionGrouping", 50},
 CacheGraphics->False,
 CellID->1452470630,ExpressionUUID->"1b1a6f78-324b-40f0-b1bf-4709e648c3dd"],

Cell[TextData[{
 "HMAC is ",
 Cell[BoxData[
  RowBox[{
   StyleBox["H", "TI"], 
   StyleBox["(",
    SpanMaxSize->1], 
   RowBox[{
    StyleBox["(",
     SpanMaxSize->1], 
    RowBox[{
     SubscriptBox[
      StyleBox["K", "TI"], "0"], "\[CirclePlus]", 
     StyleBox["opad",
      FontSlant->"Plain"]}], 
    StyleBox[")",
     SpanMaxSize->1], 
    RowBox[{"\\", "Vert"}], 
    StyleBox["H", "TI"], 
    StyleBox["(",
     SpanMaxSize->1], 
    RowBox[{
     StyleBox["(",
      SpanMaxSize->1], 
     RowBox[{
      SubscriptBox[
       StyleBox["K", "TI"], "0"], "\[CirclePlus]", 
      StyleBox["ipad",
       FontSlant->"Plain"]}], 
     StyleBox[")",
      SpanMaxSize->1], 
     RowBox[{"\\", "Vert"}], 
     StyleBox["m", "TI"]}], 
    StyleBox[")",
     SpanMaxSize->1]}], 
   StyleBox[")",
    SpanMaxSize->1]}]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "fa66608c-6794-43f2-8076-6161eee5acbd"],
 ", where ",
 Cell[BoxData[
  SubscriptBox[
   StyleBox["K", "TI"], "0"]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "4819cccd-a096-42ac-925f-9ba283f04f9c"],
 " is the key hashed down if it is longer than one block and then zero-padded \
to one block."
}], "Notes",ExpressionUUID->"1f2ea70d-ed29-46d8-bb30-034f52f42291"],

Cell[TextData[{
 "The block size is 64 bytes for ",
 Cell[BoxData["\<\"SHA256\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "dc1277b4-06f3-4d02-bee5-65962defbdc7"],
 " and 128 bytes for ",
 Cell[BoxData["\<\"SHA512\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "00596576-a538-4138-aaf0-52a82f21f091"],
 "; the digest is 32 and 64 bytes respectively."
}], "Notes",ExpressionUUID->"9632b231-fdfc-4bed-8a23-c2ff611cbd3f"],

Cell[TextData[{
 StyleBox["key", "TI"],
 " and ",
 StyleBox["message", "TI"],
 " may each be a ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["ByteArray"]], "paclet:ref/ByteArray"},
   "RefLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",ExpressionUUID->
  "68955627-11b0-41fc-be98-bf2d3eb980e0"],
 " or a ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["String"]], "paclet:ref/String"},
   "RefLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",ExpressionUUID->
  "c53b668e-b276-4870-bf0b-c6d106d8c4d6"],
 "; a string stands for its UTF-8 bytes, so ",
 Cell[BoxData[
  RowBox[{
   TemplateBox[{
     Cell[
      TextData["HMACHash"]], "paclet:WolframInstitute/Puzzles/ref/HMACHash", 
     "WolframInstitute/Puzzles Package Symbol"},
    "PackageLink",
    BaseStyle->"InlineFormula"], "[", 
   RowBox[{"\<\"\!\(\*StyleBox[\"k\", \"TI\"]\)\"\>", ",", 
    " ", "\<\"\!\(\*StyleBox[\"m\", \"TI\"]\)\"\>", ",", 
    " ", "\<\"SHA256\"\>"}], "]"}]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "5e9bd0f3-c815-41c0-9da9-f295309b646d"],
 " and the ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["StringToByteArray"]], "paclet:ref/StringToByteArray"},
   "RefLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",ExpressionUUID->
  "674bd1b9-7e5c-48e9-b240-0a2b7412439c"],
 " forms agree."
}], "Notes",ExpressionUUID->"4b29014a-eafb-4f97-9915-2b88241fd066"],

Cell["\<\
The result is never truncated. RFC 4231 test case 5 truncates its output to \
128 bits; that truncation is the caller's to apply.\
\>", "Notes",ExpressionUUID->"27332685-c67f-454c-9eb8-25eb98bd615d"],

Cell[TextData[{
 "A hash name other than ",
 Cell[BoxData["\<\"SHA256\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "58f85eb3-7d31-499d-b13b-000db014aec0"],
 " or ",
 Cell[BoxData["\<\"SHA512\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "bad9e2d8-ab6d-4c86-8244-e3e925c9401d"],
 " matches no definition and the call is returned unevaluated, as does a ",
 StyleBox["key", "TI"],
 " or ",
 StyleBox["message", "TI"],
 " that is neither a string nor a byte array."
}], "Notes",ExpressionUUID->"b67ef27b-08bb-4657-b82c-323225eb6092"],

Cell[TextData[{
 "The Wolfram Language has no built-in keyed hash: ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["Hash"]], "paclet:ref/Hash"},
   "RefLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",ExpressionUUID->
  "4d7fc9a3-b59f-4a7d-8d22-bb6c9e6e1ad7"],
 " takes no key and ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["GenerateDerivedKey"]], "paclet:ref/GenerateDerivedKey"},
   "RefLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",ExpressionUUID->
  "0f598591-c417-479a-a76f-1ab360009585"],
 " offers only scrypt."
}], "Notes",ExpressionUUID->"ec877745-e410-432a-8c57-94ed22ddbe3e"]
}, Closed]],

Cell["", "PageDelimiter",ExpressionUUID->"748ebda4-dae0-4024-bd0a-7a346a267465"],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[
     MatchQ[
      CurrentValue[
       EvaluationNotebook[], {
       TaggingRules, "Openers", "PrimaryExamplesSection"}, Open], 
      Alternatives[True, Open]], 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]],
   ImageSizeCache->{
    13.600000000000001`, {4.251494140625001, 9.348505859375}}]],
  ExpressionUUID->"6a1443ce-358e-40cf-b08e-4e74c348ff2e"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"7988d099-a9ab-4bd2-9e27-74c5b355df40"],
 "Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(12)", "ExampleCount",ExpressionUUID->
  "23a5800a-dcdf-4cde-894d-94d0554d53ff"]
}], "PrimaryExamplesSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->1227262961,ExpressionUUID->"ae675965-9063-4aa4-9b9f-11cf839331e7"],

Cell[BoxData[
 RowBox[{"Needs", "[", "\"\<WolframInstitute`Puzzles`\>\"", "]"}]], "Input", \
"ExampleInitialization",
 CellLabel->"In[1]:=",
 CellID->1969679695,ExpressionUUID->"80630023-360c-422c-8aa3-adb39f9d07f8"],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "92cb5350-aa55-4a44-8133-ec803160376c"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"02631bde-1f17-412f-9ad9-67f7782c9ae2"],
 "Basic Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(3)", "ExampleCount",ExpressionUUID->
  "1eaa26c7-f40f-4d55-9e55-bac4956be4bf"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->28156092,ExpressionUUID->"52a475cf-9a0f-43c5-a931-d95de83155af"],

Cell[TextData[{
 "RFC 4231 test case 1, HMAC-SHA-512 of ",
 Cell[BoxData["\<\"Hi There\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "8fcce880-fda2-4f70-9830-66e7dfbd3081"],
 " under a 20-byte key of ",
 Cell[BoxData[
  RowBox[{"0", "x0b"}]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "a53a7b19-2ca0-427f-8dfe-9b01f7ad0ad8"],
 ":"
}], "ExampleText",
 CellTags->
  "TextAnnotation",ExpressionUUID->"c71fe834-5296-47d4-a589-8fe5811326c5"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ByteListToHexString", "[", 
  RowBox[{"HMACHash", "[", 
   RowBox[{
    RowBox[{"ByteArray", "[", 
     RowBox[{"ConstantArray", "[", 
      RowBox[{"16^^0b", ",", " ", "20"}], "]"}], "]"}], ",", 
    " ", "\"\<Hi There\>\"", ",", " ", "\"\<SHA512\>\""}], "]"}], 
  "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"a96a50d4-76e7-4254-a48d-2897ca114574"],

Cell[BoxData["\<\"\
87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cdedaa833b7d6b8a7\
02038b274eaea3f4e4be9d914eeb61f1702e696c203a126854\"\>"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"a4c29282-935e-47b9-8531-247e4e74208d"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "c2ab3dbf-d1ba-4c3b-a146-7ea663665f98"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"9cd80a9d-fc08-47b1-\
bd73-76b13c104b8b"],

Cell["The same case over SHA-256 gives a 32-byte digest instead:", \
"ExampleText",ExpressionUUID->"75e16838-fa63-4cbc-9b1d-e5dc3264130a"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ByteListToHexString", "[", 
  RowBox[{"HMACHash", "[", 
   RowBox[{
    RowBox[{"ByteArray", "[", 
     RowBox[{"ConstantArray", "[", 
      RowBox[{"16^^0b", ",", " ", "20"}], "]"}], "]"}], ",", 
    " ", "\"\<Hi There\>\"", ",", " ", "\"\<SHA256\>\""}], "]"}], 
  "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"218fc54c-624a-4c47-89c3-8ca07f88612a"],

Cell[BoxData["\<\"\
b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7\"\>"], \
"Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"fcad0036-1766-4c2f-bd90-93d36641cf52"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "215a61e7-e98b-41eb-beb8-0f07c668e983"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"aba0e526-3c9a-44ae-\
9e83-f80ff25efbdc"],

Cell[TextData[{
 "RFC 4231 test case 2, with the key ",
 Cell[BoxData["\<\"Jefe\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "6953fde9-6d2a-405f-a91b-8a3508276318"],
 " given directly as a string:"
}], "ExampleText",ExpressionUUID->"440e7ccf-835e-4284-aa73-8228a2eb2f8c"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ByteListToHexString", "[", 
  RowBox[{"HMACHash", "[", 
   RowBox[{"\"\<Jefe\>\"", ",", " ", "\"\<what do ya want for nothing?\>\"", ",",
     " ", "\"\<SHA512\>\""}], "]"}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"f28f2b77-eb74-4c5c-91e7-4969de536512"],

Cell[BoxData["\<\"\
164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7ea2505549758bf75c05a99\
4a6d034f65f8f0e6fdcaeab1a34d4a6b4b636e070a38bce737\"\>"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"068fc8c5-88b4-4926-b07d-afd436d9b35a"]
}, Open  ]]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "5c68b45d-9204-4e2c-90ca-428a714776dc"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"1b0a2caa-fb66-4add-8854-f3a2ad9f5bc6"],
 "Scope",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(3)", "ExampleCount",ExpressionUUID->
  "608d80f6-cf7c-4ec2-9852-ebf32a200b44"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->1293636265,ExpressionUUID->"9c8de5de-6794-4f11-8ee8-6f7099c2c231"],

Cell["\<\
A key longer than the block size is hashed down first, which is what RFC 4231 \
test case 6 exercises with a 131-byte key:\
\>", "ExampleText",ExpressionUUID->"2c163ea9-06de-4a66-8080-662f78b0d995"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ByteListToHexString", "[", 
  RowBox[{"HMACHash", "[", 
   RowBox[{
    RowBox[{"ByteArray", "[", 
     RowBox[{"ConstantArray", "[", 
      RowBox[{"16^^aa", ",", " ", "131"}], "]"}], "]"}], ",", 
    " ", "\"\<Test Using Larger Than Block-Size Key - Hash Key First\>\"", ",",
     " ", "\"\<SHA256\>\""}], "]"}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"852a397d-1072-4b30-9e6a-f2e28d90098b"],

Cell[BoxData["\<\"\
60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54\"\>"], \
"Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"68da7473-2d04-4bb8-9824-4abd7ba760e4"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "9489389c-8199-4d1c-9371-70466321b9a2"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"03708bb6-9655-438b-\
af7f-0f82c0675dc1"],

Cell[TextData[{
 "Binary data needs no encoding detour, since a ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["ByteArray"]], "paclet:ref/ByteArray"},
   "RefLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",ExpressionUUID->
  "711b1b91-e442-4dec-b219-327bb9ff547e"],
 " is accepted directly:"
}], "ExampleText",ExpressionUUID->"e1af383e-c9f0-4621-9bdc-99f75d7a8ae3"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ByteListToHexString", "[", 
  RowBox[{"HMACHash", "[", 
   RowBox[{
    RowBox[{"ByteArray", "[", 
     RowBox[{"ConstantArray", "[", 
      RowBox[{"16^^aa", ",", " ", "20"}], "]"}], "]"}], ",", " ", 
    RowBox[{"ByteArray", "[", 
     RowBox[{"ConstantArray", "[", 
      RowBox[{"16^^dd", ",", " ", "50"}], "]"}], "]"}], ",", 
    " ", "\"\<SHA512\>\""}], "]"}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"9e850bf2-147c-4cb6-b246-1ecdd64c0ef0"],

Cell[BoxData["\<\"\
fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33b2279d39bf3e848279a722\
c806b485a47e67c807b946a337bee8942674278859e13292fb\"\>"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"c6fa11b4-8a5b-48b6-be1f-719b3e494c9f"]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "c5ab9280-bd8b-4441-9c86-8302da5da616"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"133feee4-965c-4a80-\
98c9-359157d8fe96"],

Cell["An empty key and an empty message are both admitted:", "ExampleText",ExpressionUUID->"29858841-1607-4063-8b74-62e64cf0a5e7"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ByteListToHexString", "[", 
  RowBox[{"HMACHash", "[", 
   RowBox[{"\"\<\>\"", ",", " ", "\"\<\>\"", ",", " ", "\"\<SHA256\>\""}], 
   "]"}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"60d410a5-a2b9-439f-bb85-e3b271ea5e05"],

Cell[BoxData["\<\"\
b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad\"\>"], \
"Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"1cd9aac7-9e45-4ed8-9df1-e182cc8fdbb8"]
}, Open  ]]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "dd197736-30b0-4b00-abb9-a9e3b4515cf2"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"15d639be-e834-4b7b-a875-f6930ee14794"],
 "Applications",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(2)", "ExampleCount",ExpressionUUID->
  "e8e94ff5-62e4-4a4a-a2d2-e15f4038b115"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->258228157,ExpressionUUID->"b56b988c-1b17-4f28-b8a7-bfddcbef0108"],

Cell[TextData[{
 "The Electrum version 2 seed test is an HMAC-SHA-512 under the fixed key ",
 Cell[BoxData["\<\"Seed version\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "9531902a-c475-4087-aa70-c3f908fe22e1"],
 ", whose leading hexadecimal digits name the kind of seed:"
}], "ExampleText",ExpressionUUID->"0ed9e4ef-5f9e-46a2-8d04-9f3519c79413"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"StringTake", "[", 
  RowBox[{
   RowBox[{"ByteListToHexString", "[", 
    RowBox[{"HMACHash", "[", 
     RowBox[{"\"\<Seed version\>\"", ",", 
      " ", "\"\<wild father tree among universe such mobile favorite target \
dynamic credit identify\>\"", ",", " ", "\"\<SHA512\>\""}], "]"}], "]"}], ",",
    " ", "4"}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"94822922-db34-421d-aed4-0fb89ba957fd"],

Cell[BoxData["\<\"1001\"\>"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"948aa17f-ddb1-4a37-a14b-34a4334bf7a8"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "a944c128-9c48-41b8-86c5-2b2d079b77f7"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"c33d9064-5d85-421f-\
bcd7-b4d903cc1022"],

Cell[TextData[{
 "BIP32 master key generation is an HMAC-SHA-512 of the seed under the key ",
 Cell[BoxData["\<\"Bitcoin seed\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "ba16af11-d7d0-49b0-8183-9db9c0a1f4b2"],
 ", whose left half is the master private key:"
}], "ExampleText",ExpressionUUID->"d0e2d5d7-796c-498d-a567-a5b5c93d933a"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ByteListToHexString", "[", 
  RowBox[{"Take", "[", 
   RowBox[{
    RowBox[{"HMACHash", "[", 
     RowBox[{"\"\<Bitcoin seed\>\"", ",", " ", 
      RowBox[{
      "BIP39Seed", 
       "[", "\"\<abandon abandon abandon abandon abandon abandon abandon \
abandon abandon abandon abandon about\>\"", "]"}], ",", 
      " ", "\"\<SHA512\>\""}], "]"}], ",", " ", "32"}], "]"}], "]"}]], "Input",\

 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"4a0c2a8e-6544-42fc-935e-dab29a06ca68"],

Cell[BoxData["\<\"\
1837c1be8e2995ec11cda2b066151be2cfb48adf9e47b151d46adab3a21cdf67\"\>"], \
"Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"3c94975c-94cf-48e4-bf6e-311ada4f2de4"]
}, Open  ]]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "cdd626d0-49db-4622-92c7-7772d95edeaf"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"c74412cc-0543-407d-a84a-51701078d45d"],
 "Properties & Relations",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(2)", "ExampleCount",ExpressionUUID->
  "0492b821-b661-4c25-ae04-01a99a4d3c1b"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->2123667759,ExpressionUUID->"15a85978-133c-4243-919d-02442ca0dee1"],

Cell[TextData[{
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["PBKDF2Key"]], "paclet:WolframInstitute/Puzzles/ref/PBKDF2Key", 
    "WolframInstitute/Puzzles Package Symbol"},
   "PackageLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "17fe90ef-5b77-4774-95c6-1e6b25138448"],
 " is this function iterated, so a single-iteration derivation is one keyed \
hash of the salt with a block counter appended:"
}], "ExampleText",ExpressionUUID->"89dd2e3e-3bff-493d-8b28-649a6baf6b8f"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"PBKDF2Key", "[", 
   RowBox[{"\"\<password\>\"", ",", " ", "\"\<salt\>\"", ",", " ", "1", ",", 
    " ", "64"}], "]"}], " ", "===", " ", 
  RowBox[{"HMACHash", "[", 
   RowBox[{"\"\<password\>\"", ",", " ", 
    RowBox[{"Join", "[", 
     RowBox[{
      RowBox[{"StringToByteArray", "[", 
       RowBox[{"\"\<salt\>\"", ",", " ", "\"\<UTF8\>\""}], "]"}], ",", " ", 
      RowBox[{"ByteArray", "[", 
       RowBox[{"{", 
        RowBox[{"0", ",", " ", "0", ",", " ", "0", ",", " ", "1"}], "}"}], 
       "]"}]}], "]"}], ",", " ", "\"\<SHA512\>\""}], "]"}]}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"28bf8c78-42c9-449b-97a5-d56da240ac04"],

Cell[BoxData["True"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"d3d116cb-a04e-41e4-9d78-82b047b40326"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "1983326f-4cde-427d-ba45-9e8a22fbbe2c"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"ef353850-71e7-4595-\
aba0-5ce5d9b3980b"],

Cell["\<\
A keyed hash is not the hash of the key joined to the message, which is the \
length-extension mistake HMAC exists to prevent:\
\>", "ExampleText",ExpressionUUID->"90bf8ffa-dc29-4f1b-8e3f-aa794d114bf7"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"HMACHash", "[", 
   RowBox[{"\"\<key\>\"", ",", " ", "\"\<message\>\"", ",", 
    " ", "\"\<SHA256\>\""}], "]"}], " ", "===", " ", 
  RowBox[{"Hash", "[", 
   RowBox[{
    RowBox[{"StringToByteArray", "[", 
     RowBox[{"\"\<keymessage\>\"", ",", " ", "\"\<UTF8\>\""}], "]"}], ",", 
    " ", "\"\<SHA256\>\"", ",", " ", "\"\<ByteArray\>\""}], "]"}]}]], "Input",\

 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"c3eb680b-851e-447a-8969-80f7b1609840"],

Cell[BoxData["False"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"d79f8f06-79d7-46d5-998b-4eccd7af81e7"]
}, Open  ]]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell[TextData[{
 Cell[BoxData[
  DynamicBox[ToBoxes[
    If[CurrentValue[
       EvaluationCell[], "CellGroupOpen"] =!= Closed, 
     Style[
      Graphics[{
        Thickness[0.18], 
        RGBColor[0.8509803921568627, 0.396078431372549, 0], 
        Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
       PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
      0.68 Inherited], 
     Rotate[
      Style[
       Graphics[{
         Thickness[0.18], 
         RGBColor[0.8509803921568627, 0.396078431372549, 0], 
         Line[{{-1.8, 0.5}, {0, 0}, {1.8, 0.5}}]}, AspectRatio -> 1, 
        PlotRange -> {{-3, 4}, {-1, 1}}, ImageSize -> 20], Magnification -> 
       0.68 Inherited], Rational[1, 2] Pi, {-1.65, -1}]]]]],ExpressionUUID->
  "b2ac9a13-29d4-4112-933a-fd3e1b86eee1"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"119c6ed6-fa17-44bf-8e14-e025e5b4eca9"],
 "Possible Issues",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(2)", "ExampleCount",ExpressionUUID->
  "d754a9f4-268a-4051-8209-40292e2abcb2"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->1305812373,ExpressionUUID->"cad53816-bf23-4981-8dbc-1bb22538ad94"],

Cell["\<\
The hash name is case-sensitive and only two are supported, so anything else \
is returned unevaluated:\
\>", "ExampleText",ExpressionUUID->"6fb48660-d05e-4b4a-82d9-fa2d25f7a32a"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"HMACHash", "[", 
  RowBox[{"\"\<key\>\"", ",", " ", "\"\<message\>\"", ",", 
   " ", "\"\<sha256\>\""}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"44be7d50-c45a-43de-a61a-b5935bc3a746"],

Cell[BoxData[
 RowBox[{"HMACHash", "[", 
  RowBox[{"\<\"key\"\>", ",", "\<\"message\"\>", ",", "\<\"sha256\"\>"}], 
  "]"}]], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"dea32cbe-fed6-46a6-887a-5e35abcd8c41"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 InterpretationBox[Cell[
  "\t", "ExampleDelimiter",ExpressionUUID->
   "892c6885-0253-4b9a-bb78-e04297a16991"],
  $Line = 0; Null]], "ExampleDelimiter",ExpressionUUID->"0ae74154-2948-4ff3-\
a218-c7c6f7b618b5"],

Cell[TextData[{
 "A key given as a list of byte values is not a ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["ByteArray"]], "paclet:ref/ByteArray"},
   "RefLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",ExpressionUUID->
  "db06bb0b-64eb-48ff-b62d-29f331d79532"],
 " and matches no definition:"
}], "ExampleText",ExpressionUUID->"90b81edf-0ebf-405c-8512-2376cdd01a48"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"HMACHash", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"1", ",", " ", "2", ",", " ", "3"}], "}"}], ",", 
   " ", "\"\<message\>\"", ",", " ", "\"\<SHA256\>\""}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"a783d51f-1973-482c-9039-e12b6b342586"],

Cell[BoxData[
 RowBox[{"HMACHash", "[", 
  RowBox[{
   RowBox[{"{", 
    RowBox[{"1", ",", "2", ",", "3"}], "}"}], ",", "\<\"message\"\>", 
   ",", "\<\"SHA256\"\>"}], "]"}]], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"10780a1a-c6d4-4fd2-9af4-5655e975f7c6"]
}, Open  ]]
}, Open  ]]
}, Closed]]
}, Open  ]],

Cell[BoxData[GridBox[{
   {
    DynamicBox[FEPrivate`ImportImage[
      FrontEnd`FileName[{"Documentation", "FooterIcons"}, 
       "RelatedFunction.png"]]], GridBox[{
      {
       StyleBox[
        RowBox[{"See", " ", "Also"}], "SeeAlsoSection"]},
      {Cell[TextData[{
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["PBKDF2Key"]], 
           "paclet:WolframInstitute/Puzzles/ref/PBKDF2Key", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "2fd24864-5217-436d-a497-4e03ed83cbba"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["BIP39Seed"]], 
           "paclet:WolframInstitute/Puzzles/ref/BIP39Seed", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "5808eebf-dc81-4ce8-ae76-22b73f11bcba"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["ElectrumSeedVersion"]], 
           "paclet:WolframInstitute/Puzzles/ref/ElectrumSeedVersion", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "cb986beb-c914-4900-8a65-9192e0736495"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["Hash"]], "paclet:ref/Hash"},
          "RefLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "8b3318cb-e228-4bdf-96e3-fbe129eada2b"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["ByteArray"]], "paclet:ref/ByteArray"},
          "RefLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "0f738c84-4060-4ae5-b62b-3f2e7d6d4929"]
       }], "SeeAlso",ExpressionUUID->"7a1ac7aa-9197-473e-b17a-8c9fad79b5fb"]}
     }]}
  }]], "SeeAlsoSection",ExpressionUUID->"a3bd80ba-a5e9-4691-a49a-\
630675d28419"],

Cell[BoxData[GridBox[{
   {
    DynamicBox[FEPrivate`ImportImage[
      FrontEnd`FileName[{"Documentation", "FooterIcons"}, 
       "RelatedGuide.png"]]], GridBox[{
      {
       StyleBox[
        RowBox[{"Related", " ", "Guides"}], "MoreAboutSection"]},
      {
       RowBox[{"\[FilledVerySmallSquare]", Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["Seeds"]], "paclet:WolframInstitute/Puzzles/guide/Seeds"},
          "RefLinkPlain",
          BaseStyle->{"MoreAbout"}]], "MoreAbout",ExpressionUUID->
         "b30abc68-076c-4fc9-9d35-d7081a55a3b2"]}]}
     }]}
  }]], "MoreAboutSection",ExpressionUUID->"c9007ce9-28ff-4a43-a173-\
d19426a8c4df"],

Cell[" ", "FooterCell",ExpressionUUID->"8707e093-1db3-45b3-8b55-418a6d3073b6"]
},
Saveable->False,
ScreenStyleEnvironment->"Working",
WindowSize->{900, 830},
WindowMargins->{{0, Automatic}, {Automatic, 0}},
WindowTitle->"HMACHash",
TaggingRules->{
 "ModificationHighlight" -> False, "ColorType" -> "", "LinkTrails" -> "", 
  "ExampleCounter" -> 1, 
  "Openers" -> {
   "PrimaryExamplesSection" -> Open, "ExampleSection" -> {"0" -> Open}, 
    "AllOptsTable" -> Closed}, "NewStyles" -> True, 
  "CitationPopupData" -> $Failed, "ShowCitation" -> False, "HasOptions" -> 
  True, "RootCaptions" -> "", "HeaderCoreAreaLink" -> {}, 
  "Metadata" -> {
   "built" -> "{2026, 8, 27, 0, 11, 36.445380}", 
    "history" -> {"XX", "", "", ""}, "context" -> "WolframInstitute`Puzzles`",
     "keywords" -> {}, "specialkeywords" -> {}, 
    "tutorialcollectionlinks" -> {}, "index" -> True, "label" -> 
    "Wolfram Institute/ Puzzles Symbol", "language" -> "en", "paclet" -> 
    "WolframInstitute/Puzzles", "status" -> "None", "summary" -> 
    "PackageLink[HMACHash,paclet : WolframInstitute/Puzzles/ref/HMACHash, \
WolframInstitute/Puzzles Package Symbol][key, message, type] gives the RFC \
2104 keyed hash of message under key as a ByteArray, with type the underlying \
hash SHA256 or SHA512.", "synonyms" -> {}, "tabletags" -> {}, "title" -> 
    "HMACHash", "titlemodifier" -> "", "metadescription" -> "", "windowtitle" -> 
    "HMACHash", "type" -> "Symbol", "uri" -> 
    "WolframInstitute/Puzzles/ref/HMACHash", "WorkflowDockedCell" -> ""}, 
  "SearchTextTranslated" -> ""},
CellContext->CellGroup,
FrontEndVersion->"15.0 for Mac OS X ARM (64-bit) (May 19, 2026)",
StyleDefinitions->FrontEnd`FileName[{"Wolfram"}, "Reference.nb"],
ExpressionUUID->"c6b6c23c-da8b-44a4-9220-169caabe58c4"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{
 "TextAnnotation"->{
  Cell[18469, 521, 545, 15, 70, "ExampleText",ExpressionUUID->"c71fe834-5296-47d4-a589-8fe5811326c5",
   CellTags->"TextAnnotation"]}
 }
*)
(*CellTagsIndex
CellTagsIndex->{
 {"TextAnnotation", 43059, 1217}
 }
*)
(*NotebookFileOutline
Notebook[{
Cell[576, 21, 6081, 147, 70, "AnchorBarGrid",ExpressionUUID->"a8046eae-c6c3-4710-9c25-de7f16e19660",
 CellID->1],
Cell[6660, 170, 107, 0, 70, "ContextNameCell",ExpressionUUID->"247cd8c3-6e9c-478e-8db8-4834ea9947e3"],
Cell[CellGroupData[{
Cell[6792, 174, 551, 14, 70, "ObjectNameGrid",ExpressionUUID->"75d38131-ce7c-42db-a8f7-f8865e9dc3f0"],
Cell[7346, 190, 1664, 46, 70, "Usage",ExpressionUUID->"a9fe4048-c6e9-4c5c-963b-4c7f638000f8"]
}, Open  ]],
Cell[CellGroupData[{
Cell[9047, 241, 1444, 34, 70, "NotesSection",ExpressionUUID->"1b1a6f78-324b-40f0-b1bf-4709e648c3dd",
 CellGroupingRules->{"SectionGrouping", 50},
 CellID->1452470630],
Cell[10494, 277, 1335, 49, 70, "Notes",ExpressionUUID->"1f2ea70d-ed29-46d8-bb30-034f52f42291"],
Cell[11832, 328, 530, 12, 70, "Notes",ExpressionUUID->"9632b231-fdfc-4bed-8a23-c2ff611cbd3f"],
Cell[12365, 342, 1547, 47, 70, "Notes",ExpressionUUID->"4b29014a-eafb-4f97-9915-2b88241fd066"],
Cell[13915, 391, 209, 3, 70, "Notes",ExpressionUUID->"27332685-c67f-454c-9eb8-25eb98bd615d"],
Cell[14127, 396, 642, 16, 70, "Notes",ExpressionUUID->"b67ef27b-08bb-4657-b82c-323225eb6092"],
Cell[14772, 414, 694, 20, 70, "Notes",ExpressionUUID->"ec877745-e410-432a-8c57-94ed22ddbe3e"]
}, Closed]],
Cell[15481, 437, 80, 0, 70, "PageDelimiter",ExpressionUUID->"748ebda4-dae0-4024-bd0a-7a346a267465"],
Cell[CellGroupData[{
Cell[15586, 441, 1402, 37, 70, "PrimaryExamplesSection",ExpressionUUID->"ae675965-9063-4aa4-9b9f-11cf839331e7",
 CellID->1227262961],
Cell[16991, 480, 216, 4, 70, "Input",ExpressionUUID->"80630023-360c-422c-8aa3-adb39f9d07f8",
 CellID->1969679695],
Cell[CellGroupData[{
Cell[17232, 488, 1234, 31, 70, "ExampleSection",ExpressionUUID->"52a475cf-9a0f-43c5-a931-d95de83155af",
 CellID->28156092],
Cell[18469, 521, 545, 15, 70, "ExampleText",ExpressionUUID->"c71fe834-5296-47d4-a589-8fe5811326c5",
 CellTags->"TextAnnotation"],
Cell[CellGroupData[{
Cell[19039, 540, 433, 10, 70, "Input",ExpressionUUID->"a96a50d4-76e7-4254-a48d-2897ca114574"],
Cell[19475, 552, 246, 3, 70, "Output",ExpressionUUID->"a4c29282-935e-47b9-8531-247e4e74208d"]
}, Open  ]],
Cell[CellGroupData[{
Cell[19758, 560, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"9cd80a9d-fc08-47b1-bd73-76b13c104b8b"],
Cell[19985, 567, 138, 1, 70, "ExampleText",ExpressionUUID->"75e16838-fa63-4cbc-9b1d-e5dc3264130a"],
Cell[CellGroupData[{
Cell[20148, 572, 433, 10, 70, "Input",ExpressionUUID->"218fc54c-624a-4c47-89c3-8ca07f88612a"],
Cell[20584, 584, 182, 3, 70, "Output",ExpressionUUID->"fcad0036-1766-4c2f-bd90-93d36641cf52"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[20815, 593, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"aba0e526-3c9a-44ae-9e83-f80ff25efbdc"],
Cell[21042, 600, 328, 7, 70, "ExampleText",ExpressionUUID->"440e7ccf-835e-4284-aa73-8228a2eb2f8c"],
Cell[CellGroupData[{
Cell[21395, 611, 342, 6, 70, "Input",ExpressionUUID->"f28f2b77-eb74-4c5c-91e7-4969de536512"],
Cell[21740, 619, 246, 3, 70, "Output",ExpressionUUID->"068fc8c5-88b4-4926-b07d-afd436d9b35a"]
}, Open  ]]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[22047, 629, 1227, 31, 70, "ExampleSection",ExpressionUUID->"9c8de5de-6794-4f11-8ee8-6f7099c2c231",
 CellID->1293636265],
Cell[23277, 662, 208, 3, 70, "ExampleText",ExpressionUUID->"2c163ea9-06de-4a66-8080-662f78b0d995"],
Cell[CellGroupData[{
Cell[23510, 669, 482, 10, 70, "Input",ExpressionUUID->"852a397d-1072-4b30-9e6a-f2e28d90098b"],
Cell[23995, 681, 182, 3, 70, "Output",ExpressionUUID->"68da7473-2d04-4bb8-9824-4abd7ba760e4"]
}, Open  ]],
Cell[CellGroupData[{
Cell[24214, 689, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"03708bb6-9655-438b-af7f-0f82c0675dc1"],
Cell[24441, 696, 417, 11, 70, "ExampleText",ExpressionUUID->"e1af383e-c9f0-4621-9bdc-99f75d7a8ae3"],
Cell[CellGroupData[{
Cell[24883, 711, 534, 12, 70, "Input",ExpressionUUID->"9e850bf2-147c-4cb6-b246-1ecdd64c0ef0"],
Cell[25420, 725, 246, 3, 70, "Output",ExpressionUUID->"c6fa11b4-8a5b-48b6-be1f-719b3e494c9f"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[25715, 734, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"133feee4-965c-4a80-98c9-359157d8fe96"],
Cell[25942, 741, 130, 0, 70, "ExampleText",ExpressionUUID->"29858841-1607-4063-8b74-62e64cf0a5e7"],
Cell[CellGroupData[{
Cell[26097, 745, 309, 6, 70, "Input",ExpressionUUID->"60d410a5-a2b9-439f-bb85-e3b271ea5e05"],
Cell[26409, 753, 182, 3, 70, "Output",ExpressionUUID->"1cd9aac7-9e45-4ed8-9df1-e182cc8fdbb8"]
}, Open  ]]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[26652, 763, 1233, 31, 70, "ExampleSection",ExpressionUUID->"b56b988c-1b17-4f28-b8a7-bfddcbef0108",
 CellID->258228157],
Cell[27888, 796, 402, 7, 70, "ExampleText",ExpressionUUID->"0ed9e4ef-5f9e-46a2-8d04-9f3519c79413"],
Cell[CellGroupData[{
Cell[28315, 807, 483, 10, 70, "Input",ExpressionUUID->"94822922-db34-421d-aed4-0fb89ba957fd"],
Cell[28801, 819, 118, 1, 70, "Output",ExpressionUUID->"948aa17f-ddb1-4a37-a14b-34a4334bf7a8"]
}, Open  ]],
Cell[CellGroupData[{
Cell[28956, 825, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"c33d9064-5d85-421f-bcd7-b4d903cc1022"],
Cell[29183, 832, 390, 7, 70, "ExampleText",ExpressionUUID->"d0e2d5d7-796c-498d-a567-a5b5c93d933a"],
Cell[CellGroupData[{
Cell[29598, 843, 541, 13, 70, "Input",ExpressionUUID->"4a0c2a8e-6544-42fc-935e-dab29a06ca68"],
Cell[30142, 858, 182, 3, 70, "Output",ExpressionUUID->"3c94975c-94cf-48e4-bf6e-311ada4f2de4"]
}, Open  ]]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[30385, 868, 1244, 31, 70, "ExampleSection",ExpressionUUID->"15a85978-133c-4243-919d-02442ca0dee1",
 CellID->2123667759],
Cell[31632, 901, 571, 13, 70, "ExampleText",ExpressionUUID->"89dd2e3e-3bff-493d-8b28-649a6baf6b8f"],
Cell[CellGroupData[{
Cell[32228, 918, 729, 16, 70, "Input",ExpressionUUID->"28bf8c78-42c9-449b-97a5-d56da240ac04"],
Cell[32960, 936, 110, 1, 70, "Output",ExpressionUUID->"d3d116cb-a04e-41e4-9d78-82b047b40326"]
}, Open  ]],
Cell[CellGroupData[{
Cell[33107, 942, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"ef353850-71e7-4595-aba0-5ce5d9b3980b"],
Cell[33334, 949, 212, 3, 70, "ExampleText",ExpressionUUID->"90bf8ffa-dc29-4f1b-8e3f-aa794d114bf7"],
Cell[CellGroupData[{
Cell[33571, 956, 525, 12, 70, "Input",ExpressionUUID->"c3eb680b-851e-447a-8969-80f7b1609840"],
Cell[34099, 970, 111, 1, 70, "Output",ExpressionUUID->"d79f8f06-79d7-46d5-998b-4eccd7af81e7"]
}, Open  ]]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[34271, 978, 1237, 31, 70, "ExampleSection",ExpressionUUID->"cad53816-bf23-4981-8dbc-1bb22538ad94",
 CellID->1305812373],
Cell[35511, 1011, 189, 3, 70, "ExampleText",ExpressionUUID->"6fb48660-d05e-4b4a-82d9-fa2d25f7a32a"],
Cell[CellGroupData[{
Cell[35725, 1018, 272, 5, 70, "Input",ExpressionUUID->"44be7d50-c45a-43de-a61a-b5935bc3a746"],
Cell[36000, 1025, 214, 4, 70, "Output",ExpressionUUID->"dea32cbe-fed6-46a6-887a-5e35abcd8c41"]
}, Open  ]],
Cell[CellGroupData[{
Cell[36251, 1034, 224, 5, 70, "ExampleDelimiter",ExpressionUUID->"0ae74154-2948-4ff3-a218-c7c6f7b618b5"],
Cell[36478, 1041, 422, 11, 70, "ExampleText",ExpressionUUID->"90b81edf-0ebf-405c-8512-2376cdd01a48"],
Cell[CellGroupData[{
Cell[36925, 1056, 331, 7, 70, "Input",ExpressionUUID->"a783d51f-1973-482c-9039-e12b6b342586"],
Cell[37259, 1065, 264, 6, 70, "Output",ExpressionUUID->"10780a1a-c6d4-4fd2-9af4-5655e975f7c6"]
}, Open  ]]
}, Open  ]]
}, Closed]]
}, Open  ]],
Cell[37574, 1077, 2898, 78, 70, "SeeAlsoSection",ExpressionUUID->"a3bd80ba-a5e9-4691-a49a-630675d28419"],
Cell[40475, 1157, 678, 18, 70, "MoreAboutSection",ExpressionUUID->"c9007ce9-28ff-4a43-a173-d19426a8c4df"],
Cell[41156, 1177, 78, 0, 70, "FooterCell",ExpressionUUID->"8707e093-1db3-45b3-8b55-418a6d3073b6"]
}
]
*)

(* End of internal cache information *)

