(* 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[     31567,        830]
NotebookOptionsPosition[     25646,        724]
NotebookOutlinePosition[     27861,        772]
CellTagsIndexPosition[     27818,        769]
WindowTitle->WienerBound
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->
           "329fad84-5383-4c93-a93d-bd4090570f4e"], 
          TemplateBox[{8},
           "Spacer1"]}]],
         TextAlignment->Center,ExpressionUUID->
         "816707ba-145a-4dbf-8c59-ebd783fb48fd"],
        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->
           "7896dad0-d819-409b-830a-c02824981933"]
         }],ExpressionUUID->"ffd18c01-e7ea-447f-88b2-064ce1ad5a40"],
         StripOnInput->False],{
        StyleBox[
          "\"FactorInteger\"", "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup["paclet:ref/FactorInteger"], 
         StyleBox["\"BitLength\"", "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup["paclet:ref/BitLength"], Delimiter, 
         StyleBox[
          "\"Functions\"", "SeeAlsoSection", FontSize -> 14, FontSlant -> 
           "Italic", StripOnInput -> False] :> 
         NotebookFind[EvaluationNotebook[], "SeeAlsoSection", All, CellStyle],
          StyleBox[
          StyleBox[
           "\"WienerAttack\"", "SeeAlsoRelated", StripOnInput -> False], 
           "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/WienerAttack"], 
         StyleBox[
          StyleBox["\"BatchGCD\"", "SeeAlsoRelated", StripOnInput -> False], 
           "SeeAlsoRelated", StripOnInput -> False] :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/ref/BatchGCD"]},
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"SeeAlso"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "bde8d946-7ef8-42c0-8310-f3caa21761fe"],
     "\[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->
           "0384cb8c-9c95-4fae-b386-c840ff080d98"]
         }],ExpressionUUID->"0da0f0dd-fcb2-4de9-8098-7307402862fb"],
         StripOnInput->False],{
        "\"Search\"" :> 
         Documentation`HelpLookup[
          "paclet:WolframInstitute/Puzzles/guide/Search"]},
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"MoreAbout"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "bb344908-1dcb-4bd5-a356-df11d025c56d"],
     "\[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->
           "7c63cce7-8d1a-47cd-ac44-98a2d195fa40"]
         }],ExpressionUUID->"457168b9-c5bd-4a08-968e-f801d986ef94"],
         StripOnInput->False],{
        "\"WolframInstitute/Puzzles/ref/WienerBound\"" :> None, 
         "\"Copy Wolfram Documentation Center URL\"" :> 
         CopyToClipboard["WolframInstitute/Puzzles/ref/WienerBound"], 
         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/WienerBound.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/WienerBound" <> ".html"], 
              None}]}]},
        Appearance->None,
        MenuAppearance->Automatic,
        MenuStyle->"URLMenu"],
       MouseAppearanceTag["LinkHand"]]],
      LineSpacing->{1.4, 0},ExpressionUUID->
      "ab46a463-ed89-4a8d-991f-d6777089cf0c"]
    }], "AnchorBar",
     CacheGraphics->False,ExpressionUUID->
     "49221a8e-2b4d-473c-afd9-9b2fd5f78f29"]}
  }]], "AnchorBarGrid",
 CellID->1,ExpressionUUID->"16d03972-4637-4578-9516-eb25120f7404"],

Cell["WolframInstitute`Puzzles`", "ContextNameCell",ExpressionUUID->"5f7d6cab-a213-4642-8b3d-72b8cde20882"],

Cell[CellGroupData[{

Cell[BoxData[GridBox[{
   {Cell[TextData[{
     Cell[
     "WienerBound", "ObjectName",ExpressionUUID->
      "69c18367-3f53-4b78-9b80-ec31a335abcd"],
     Cell[BoxData[
      TemplateBox[{8},
       "Spacer1"]],ExpressionUUID->"47eff40b-7519-46c6-92d8-31af2924856b"],
     Cell[BoxData[
     ""], "ObjectNameTranslation",ExpressionUUID->
      "387f3f98-d6ce-48ad-8061-5e27d6ef8da6"]
    }],ExpressionUUID->"3555f9f9-7e09-4f8e-a776-479cdc6b0c1f"], 
    "\[SpanFromLeft]"}
  }]], "ObjectNameGrid",ExpressionUUID->"fe58bfd2-3865-4630-b2a2-\
06df483c0928"],

Cell[BoxData[GridBox[{
   {"", Cell[TextData[{
     Cell[BoxData[
      RowBox[{
       TemplateBox[{
         Cell[
          TextData["WienerBound"]], 
         "paclet:WolframInstitute/Puzzles/ref/WienerBound", 
         "WolframInstitute/Puzzles Package Symbol"},
        "PackageLink",
        BaseStyle->"InlineFormula"], "[", 
       StyleBox["n", "TI"], "]"}]], "InlineFormula",
      FontFamily->"Source Sans Pro",
      FontSize->0.9 Inherited,ExpressionUUID->
      "1f0cfc76-48fd-4937-8c9b-e93511c1830b"],
     "\[LineSeparator]",
     "gives the largest integer ",
     StyleBox["d", "TI"],
     " that Wiener's attack provably recovers from a balanced modulus ",
     StyleBox["n", "TI"],
     " = ",
     StyleBox["p", "TI"],
     " ",
     StyleBox["q", "TI"],
     " with ",
     StyleBox["q", "TI"],
     " < ",
     StyleBox["p", "TI"],
     " < 2 ",
     StyleBox["q", "TI"],
     ": the largest ",
     StyleBox["d", "TI"],
     " with 81 ",
     StyleBox["d", "TI"],
     "\:2074 < ",
     StyleBox["n", "TI"],
     ", that is ",
     StyleBox["d", "TI"],
     " < ",
     StyleBox["n", "TI"],
     "^(1/4)/3."
    }],ExpressionUUID->"eae72475-6b8d-403c-953f-4a365fa74be7"]},
   {"", Cell[TextData[{
     Cell[BoxData[
      RowBox[{
       TemplateBox[{
         Cell[
          TextData["WienerBound"]], 
         "paclet:WolframInstitute/Puzzles/ref/WienerBound", 
         "WolframInstitute/Puzzles Package Symbol"},
        "PackageLink",
        BaseStyle->"InlineFormula"], "[", 
       RowBox[{
        StyleBox["n", "TI"], ",", " ", 
        StyleBox["delta", "TI"]}], "]"}]], "InlineFormula",
      FontFamily->"Source Sans Pro",
      FontSize->0.9 Inherited,ExpressionUUID->
      "861ceee6-6086-43d5-ac4e-5e1166910ea9"],
     "\[LineSeparator]",
     "gives de Weger's threshold for a modulus whose prime difference |",
     StyleBox["p", "TI"],
     " - ",
     StyleBox["q", "TI"],
     "| is ",
     StyleBox["delta", "TI"],
     ": the largest ",
     StyleBox["d", "TI"],
     " with (",
     StyleBox["d", "TI"],
     " ",
     StyleBox["delta", "TI"],
     ")\:2074 < ",
     StyleBox["n", "TI"],
     "\.b3, that is ",
     StyleBox["d", "TI"],
     " < ",
     StyleBox["n", "TI"],
     "^(3/4)/",
     StyleBox["delta", "TI"],
     "."
    }],ExpressionUUID->"39efb565-64fa-4c50-865f-14226826f41e"]}
  }]], "Usage",ExpressionUUID->"0fc747bb-4c0f-46bb-b2f0-f6658c4514f8"]
}, 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->"54ed61e2-9a33-4351-85bc-107c2c461ad8"],
  Cell[BoxData[
   TemplateBox[{1},
    "Spacer1"]],ExpressionUUID->"b14e0bfc-04ff-4805-a1dc-dd096bbaf618"],
  "Details and Options"
 }], "NotesFrameText",ExpressionUUID->
  "fb45c959-4bf9-4c84-af71-490fa0a1fbd9"]],ExpressionUUID->"3e5c52c2-3414-\
4b83-85c4-2f65035bae8d"]], "NotesSection",
 ShowGroupOpener->"Thumbnail",
 WholeCellGroupOpener->True,
 CellGroupingRules->{"SectionGrouping", 50},
 CacheGraphics->False,
 CellID->1988814243,ExpressionUUID->"55b9eed2-dd93-42b6-8442-53ef3fbd7498"],

Cell[TextData[{
 "The one-argument form is Theorem 2 of Boneh's ",
 StyleBox["Twenty Years of Attacks on the RSA Cryptosystem", "TI"],
 ", transcribed as an exact integer inequality."
}], "Notes",ExpressionUUID->"47be2e62-8705-4b45-8225-511949f7d7d5"],

Cell[TextData[{
 "The two-argument form is the threshold the default ",
 Cell[BoxData["\<\"deWeger\"\>"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "61430f50-70c3-492d-b31e-731385c7b110"],
 " approximant of ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["WienerAttack"]], 
    "paclet:WolframInstitute/Puzzles/ref/WienerAttack", 
    "WolframInstitute/Puzzles Package Symbol"},
   "PackageLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "bea5cd81-cd28-47b8-8ceb-283091e3287c"],
 " works to. Wiener's balance hypothesis already forces ",
 StyleBox["delta", "TI"],
 " below \[Sqrt]",
 StyleBox["n", "TI"],
 ", so the two-argument form is at least the one-argument form wherever the \
hypothesis holds, and larger the closer the primes are."
}], "Notes",ExpressionUUID->"f02b531c-9145-4e70-8258-bf7bd7125657"],

Cell["\<\
Both are computed by integer Newton iteration and exact comparison. There is \
no floating-point step, so the result is correct even for a modulus adjacent \
to a perfect fourth power.\
\>", "Notes",ExpressionUUID->"463ba15b-f53f-44ac-8c54-59ff6810c0f8"],

Cell[TextData[{
 "NIST FIPS 186-5, Appendix A.1.1 requires 2^(",
 StyleBox["nlen", "TI"],
 "/2) < ",
 StyleBox["d", "TI"],
 " for a key of ",
 StyleBox["nlen", "TI"],
 " bits, so a compliant private exponent is always far above this bound."
}], "Notes",ExpressionUUID->"d93ee55a-c7c1-4e31-bab7-841bdbb70ad2"],

Cell[TextData[{
 Cell[BoxData[
  RowBox[{"WienerBound", "[", "1", "]"}]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "6a22918d-8a31-4085-8daa-2e9690823187"],
 " is 0: no positive exponent qualifies."
}], "Notes",ExpressionUUID->"2b9252ee-b53c-4a11-a9f5-dbe32a90668c"]
}, Closed]],

Cell["", "PageDelimiter",ExpressionUUID->"247e8edb-8642-4c1a-8cc9-b50903dcde6a"],

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->"b8222f65-1814-4577-9259-3d3709299afa"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"836741f8-a3b0-4965-a466-14e96adbbd24"],
 "Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(2)", "ExampleCount",ExpressionUUID->
  "6e44d7c7-2c63-4144-a9cb-9b086af83237"]
}], "PrimaryExamplesSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->418016546,ExpressionUUID->"04a4e34b-f867-4041-bafb-4c3051c1f8e1"],

Cell[BoxData[
 RowBox[{"Needs", "[", "\"\<WolframInstitute`Puzzles`\>\"", "]"}]], "Input", \
"ExampleInitialization",
 CellLabel->"In[1]:=",
 CellID->1969679695,ExpressionUUID->"c24c4178-3ece-4184-8535-95052909557e"],

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->
  "79492f51-b733-488f-bd4a-278617f7f731"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"7ef8e45c-f605-42cb-8755-a8a492d6ccb4"],
 "Basic Examples",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount",ExpressionUUID->
  "170f5d34-318d-4847-98e2-42b512ba4fa5"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->1185079285,ExpressionUUID->"ad66949f-d361-4657-8dfb-50229de14a19"],

Cell[TextData[{
 "The published Wiener example has ",
 StyleBox["d", "TI"],
 " = 5, which sits exactly on the boundary:"
}], "ExampleText",ExpressionUUID->"99b3ef5d-355b-463f-b176-f61b27897f77"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"WienerBound", "[", "90581", "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"1ffe192b-0f0a-4cb3-8738-25ec03910bdc"],

Cell[BoxData["5"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"a4449ef6-2a48-4936-bc67-d2b7de75d8b9"]
}, Open  ]],

Cell["For a 2048-bit modulus the bound is a 511-bit integer:", "ExampleText",ExpressionUUID->"8da7893e-8733-4fd7-a61b-b99a8cadebf3"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"BitLength", "[", 
  RowBox[{"WienerBound", "[", 
   RowBox[{"2", "^", "2048"}], "]"}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[2]:=",ExpressionUUID->"ab38eef7-aaec-42a4-b545-39e197a480e3"],

Cell[BoxData["511"], "Output",
 CellLabel->"Out[2]= ",ExpressionUUID->"628ad810-5f4d-4894-99ef-f406e55daf17"]
}, Open  ]],

Cell["\<\
Primes that differ by only 42 lift the threshold by seven orders of magnitude:\
\>", "ExampleText",ExpressionUUID->"c08b06a0-697a-45f5-a255-a3b66a2482ed"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{
   RowBox[{"WienerBound", "[", "10000005600000343", "]"}], ",", " ", 
   RowBox[{"WienerBound", "[", 
    RowBox[{"10000005600000343", ",", " ", "42"}], "]"}]}], "}"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[3]:=",ExpressionUUID->"331befb8-65f5-445e-b292-07efe1b844ff"],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"3333", ",", "23809533809"}], "}"}]], "Output",
 CellLabel->"Out[3]= ",ExpressionUUID->"04bc3a6a-e027-4f44-afd4-cfb3b67c7fde"]
}, 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->
  "36b9b208-c6a7-434a-87b1-a2262379e6af"],
 Cell[BoxData[
  TemplateBox[{1},
   "Spacer1"]],ExpressionUUID->"417730d4-dc7a-482a-a260-dac901a3922a"],
 "Possible Issues",
 "\[NonBreakingSpace]\[NonBreakingSpace]",
 Cell["(1)", "ExampleCount",ExpressionUUID->
  "c0d66d10-50b7-4193-b4f6-9fefc75d1eea"]
}], "ExampleSection", "ExampleSection",
 WholeCellGroupOpener->True,
 CacheGraphics->False,
 CellID->1305812373,ExpressionUUID->"165457c7-96ba-4238-9f7d-c5ddb7e448b5"],

Cell[TextData[{
 "The obvious spelling of the one-argument form is not usable. At the default \
",
 Cell[BoxData["$MaxExtraPrecision"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "137af098-a4a2-4410-8c92-5b3095f142ca"],
 ", ",
 Cell["Floor[n^(1/4)/3]", "InlineCode",
  FontFamily->"Source Sans Pro",ExpressionUUID->
  "c27b1ce6-ed39-4460-966d-fd95249a3b57"],
 " returns ",
 StyleBox["unevaluated",
  FontWeight->"Bold"],
 " \[LongDash] not an error \[LongDash] once ",
 StyleBox["n", "TI"],
 " is large enough, and a held expression then compares silently as ",
 Cell[BoxData["False"], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "e8b24a3b-7e81-4c9d-b2e7-bef301576adf"],
 " everywhere downstream:"
}], "ExampleText",ExpressionUUID->"f1f19632-0c72-4a3e-8300-75cb3d4f5d19"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Head", "[", 
  RowBox[{"Quiet", "[", 
   RowBox[{"Floor", "[", 
    RowBox[{
     RowBox[{
      RowBox[{"(", 
       RowBox[{
        RowBox[{"81", " ", 
         RowBox[{
          RowBox[{"(", 
           RowBox[{
            RowBox[{"10", "^", "40"}], " ", "+", " ", "1"}], ")"}], "^", 
          "4"}]}], " ", "+", " ", "1"}], ")"}], "^", 
      RowBox[{"(", 
       RowBox[{"1", "/", "4"}], ")"}]}], "/", "3"}], "]"}], "]"}], 
  "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[1]:=",ExpressionUUID->"1f9e57c6-a427-459f-a653-efe8a3833f10"],

Cell[BoxData["Floor"], "Output",
 CellLabel->"Out[1]= ",ExpressionUUID->"c28992f7-fef3-4179-bd86-7ffc2785aa30"]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"WienerBound", "[", 
  RowBox[{
   RowBox[{"81", " ", 
    RowBox[{
     RowBox[{"(", 
      RowBox[{
       RowBox[{"10", "^", "40"}], " ", "+", " ", "1"}], ")"}], "^", "4"}]}], 
   " ", "+", " ", "1"}], "]"}]], "Input",
 CellProlog:>Needs["WolframInstitute`Puzzles`"],
 CellLabel->"In[2]:=",ExpressionUUID->"6daf6184-d693-4dce-909a-3b1cfba89775"],

Cell[BoxData["10000000000000000000000000000000000000001"], "Output",
 CellLabel->"Out[2]= ",ExpressionUUID->"ca83ed99-d4dd-4176-9617-f7bbf7291239"]
}, Open  ]],

Cell["\<\
That threshold falls around a 162-digit modulus, which is well inside \
ordinary RSA range, and is the reason this symbol exists rather than the \
inline expression.\
\>", "ExampleText",ExpressionUUID->"1ca045a8-2016-4fa0-9b8c-970799f04752"],

Cell[TextData[{
 "A bound is not a guarantee about a specific key: it says which exponents \
Wiener's theorem ",
 StyleBox["provably", "TI"],
 " recovers, not which ones ",
 Cell[BoxData[
  TemplateBox[{
    Cell[
     TextData["WienerAttack"]], 
    "paclet:WolframInstitute/Puzzles/ref/WienerAttack", 
    "WolframInstitute/Puzzles Package Symbol"},
   "PackageLink",
   BaseStyle->"InlineFormula"]], "InlineFormula",
  FontFamily->"Source Sans Pro",
  FontSize->0.9 Inherited,ExpressionUUID->
  "d719c87b-256b-44c7-9c21-78820c06d77b"],
 " happens to find. The attack may reach further on a favourable modulus, and \
it reaches no further on an unbalanced one."
}], "ExampleText",ExpressionUUID->"cc752033-80aa-4540-9c3e-63b177d92830"]
}, Closed]]
}, Open  ]],

Cell[BoxData[GridBox[{
   {
    DynamicBox[FEPrivate`ImportImage[
      FrontEnd`FileName[{"Documentation", "FooterIcons"}, 
       "RelatedFunction.png"]],
     ImageSizeCache->{50., {26.47265625, 33.52734375}}], GridBox[{
      {
       StyleBox[
        RowBox[{"See", " ", "Also"}], "SeeAlsoSection"]},
      {Cell[TextData[{
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["WienerAttack"]], 
           "paclet:WolframInstitute/Puzzles/ref/WienerAttack", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "40e68fb5-61f7-4c18-8ed2-bd112af25b79"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["BatchGCD"]], 
           "paclet:WolframInstitute/Puzzles/ref/BatchGCD", 
           "WolframInstitute/Puzzles Package Symbol"},
          "PackageLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "c38edce2-d7b0-4056-b42f-04bf4467ce6f"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["FactorInteger"]], "paclet:ref/FactorInteger"},
          "RefLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "f8f636b4-bab0-41d3-9b6b-5ce1b24010e8"],
        "\[NonBreakingSpace]",
        StyleBox[
        "\[MediumSpace]\[FilledVerySmallSquare]\[MediumSpace]", 
         "InlineSeparator"],
        " ",
        Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["BitLength"]], "paclet:ref/BitLength"},
          "RefLink",
          BaseStyle->"InlineFormula"]], "InlineFormula",
         FontFamily->"Source Sans Pro",ExpressionUUID->
         "4d67dd9f-5e3c-43a0-b368-8bbab4bf23a4"]
       }], "SeeAlso",ExpressionUUID->"0e17836b-50d0-4bcd-8376-8e90ef150474"]}
     }]}
  }]], "SeeAlsoSection",ExpressionUUID->"919eef0c-8805-4369-8e76-\
ef72bf8d5e5b"],

Cell[BoxData[GridBox[{
   {
    DynamicBox[FEPrivate`ImportImage[
      FrontEnd`FileName[{"Documentation", "FooterIcons"}, "RelatedGuide.png"]],
     ImageSizeCache->{50., {26.47265625, 33.52734375}}], GridBox[{
      {
       StyleBox[
        RowBox[{"Related", " ", "Guides"}], "MoreAboutSection"]},
      {
       RowBox[{"\[FilledVerySmallSquare]", Cell[BoxData[
         TemplateBox[{
           Cell[
            TextData["Search"]], 
           "paclet:WolframInstitute/Puzzles/guide/Search"},
          "RefLinkPlain",
          BaseStyle->{"MoreAbout"}]], "MoreAbout",ExpressionUUID->
         "93e7ecda-b89c-4073-97fb-90f5c81fb7f8"]}]}
     }]}
  }]], "MoreAboutSection",ExpressionUUID->"97f71e85-d817-486c-92de-\
8c53ea458450"],

Cell[" ", "FooterCell",ExpressionUUID->"64543d43-6777-4519-9867-6533012e149d"]
},
Saveable->False,
ScreenStyleEnvironment->"Working",
WindowSize->{900, 830},
WindowMargins->{{0, Automatic}, {Automatic, 0}},
WindowTitle->"WienerBound",
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, 59.532321}", 
    "history" -> {"XX", "", "", ""}, "context" -> "WolframInstitute`Puzzles`",
     "keywords" -> {}, "specialkeywords" -> {}, 
    "tutorialcollectionlinks" -> {}, "index" -> True, "label" -> 
    "Wolfram Institute/ Puzzles Symbol", "language" -> "en", "paclet" -> 
    "WolframInstitute/Puzzles", "status" -> "None", "summary" -> 
    "PackageLink[WienerBound,paclet : \
WolframInstitute/Puzzles/ref/WienerBound, WolframInstitute/Puzzles Package \
Symbol][n] gives the largest integer d that Wiener's attack provably recovers \
from a balanced modulus n = p q with q < p < 2 q: the largest d with 81 d\
\:2074 < n, that is d < n^(1/4)/3. PackageLink[WienerBound,paclet : \
WolframInstitute/Puzzles/ref/WienerBound, WolframInstitute/Puzzles Package \
Symbol][n, delta] gives de Weger's threshold for a modulus whose prime \
difference |p - q| is delta: the largest d with (d delta)\:2074 < n\.b3, that \
is d < n^(3/4)/delta.", "synonyms" -> {}, "tabletags" -> {}, "title" -> 
    "WienerBound", "titlemodifier" -> "", "metadescription" -> "", 
    "windowtitle" -> "WienerBound", "type" -> "Symbol", "uri" -> 
    "WolframInstitute/Puzzles/ref/WienerBound", "WorkflowDockedCell" -> ""}, 
  "SearchTextTranslated" -> ""},
CellContext->CellGroup,
FrontEndVersion->"15.0 for Mac OS X ARM (64-bit) (May 19, 2026)",
StyleDefinitions->FrontEnd`FileName[{"Wolfram"}, "Reference.nb"],
ExpressionUUID->"fff2a130-1d21-4ca1-a71b-fe1ef9264a40"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[579, 21, 5863, 143, 70, "AnchorBarGrid",ExpressionUUID->"16d03972-4637-4578-9516-eb25120f7404",
 CellID->1],
Cell[6445, 166, 107, 0, 70, "ContextNameCell",ExpressionUUID->"5f7d6cab-a213-4642-8b3d-72b8cde20882"],
Cell[CellGroupData[{
Cell[6577, 170, 554, 14, 70, "ObjectNameGrid",ExpressionUUID->"fe58bfd2-3865-4630-b2a2-06df483c0928"],
Cell[7134, 186, 2415, 81, 70, "Usage",ExpressionUUID->"0fc747bb-4c0f-46bb-b2f0-f6658c4514f8"]
}, Open  ]],
Cell[CellGroupData[{
Cell[9586, 272, 1444, 34, 70, "NotesSection",ExpressionUUID->"55b9eed2-dd93-42b6-8442-53ef3fbd7498",
 CellGroupingRules->{"SectionGrouping", 50},
 CellID->1988814243],
Cell[11033, 308, 251, 4, 70, "Notes",ExpressionUUID->"47be2e62-8705-4b45-8225-511949f7d7d5"],
Cell[11287, 314, 957, 24, 70, "Notes",ExpressionUUID->"f02b531c-9145-4e70-8258-bf7bd7125657"],
Cell[12247, 340, 264, 4, 70, "Notes",ExpressionUUID->"463ba15b-f53f-44ac-8c54-59ff6810c0f8"],
Cell[12514, 346, 308, 8, 70, "Notes",ExpressionUUID->"d93ee55a-c7c1-4e31-bab7-841bdbb70ad2"],
Cell[12825, 356, 319, 7, 70, "Notes",ExpressionUUID->"2b9252ee-b53c-4a11-a9f5-dbe32a90668c"]
}, Closed]],
Cell[13159, 366, 80, 0, 70, "PageDelimiter",ExpressionUUID->"247e8edb-8642-4c1a-8cc9-b50903dcde6a"],
Cell[CellGroupData[{
Cell[13264, 370, 1400, 37, 70, "PrimaryExamplesSection",ExpressionUUID->"04a4e34b-f867-4041-bafb-4c3051c1f8e1",
 CellID->418016546],
Cell[14667, 409, 216, 4, 70, "Input",ExpressionUUID->"c24c4178-3ece-4184-8535-95052909557e",
 CellID->1969679695],
Cell[CellGroupData[{
Cell[14908, 417, 1236, 31, 70, "ExampleSection",ExpressionUUID->"ad66949f-d361-4657-8dfb-50229de14a19",
 CellID->1185079285],
Cell[16147, 450, 194, 4, 70, "ExampleText",ExpressionUUID->"99b3ef5d-355b-463f-b176-f61b27897f77"],
Cell[CellGroupData[{
Cell[16366, 458, 195, 3, 70, "Input",ExpressionUUID->"1ffe192b-0f0a-4cb3-8738-25ec03910bdc"],
Cell[16564, 463, 107, 1, 70, "Output",ExpressionUUID->"a4449ef6-2a48-4936-bc67-d2b7de75d8b9"]
}, Open  ]],
Cell[16686, 467, 132, 0, 70, "ExampleText",ExpressionUUID->"8da7893e-8733-4fd7-a61b-b99a8cadebf3"],
Cell[CellGroupData[{
Cell[16843, 471, 254, 5, 70, "Input",ExpressionUUID->"ab38eef7-aaec-42a4-b545-39e197a480e3"],
Cell[17100, 478, 109, 1, 70, "Output",ExpressionUUID->"628ad810-5f4d-4894-99ef-f406e55daf17"]
}, Open  ]],
Cell[17224, 482, 164, 2, 70, "ExampleText",ExpressionUUID->"c08b06a0-697a-45f5-a255-a3b66a2482ed"],
Cell[CellGroupData[{
Cell[17413, 488, 345, 7, 70, "Input",ExpressionUUID->"331befb8-65f5-445e-b292-07efe1b844ff"],
Cell[17761, 497, 165, 3, 70, "Output",ExpressionUUID->"04bc3a6a-e027-4f44-afd4-cfb3b67c7fde"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[17975, 506, 1237, 31, 70, "ExampleSection",ExpressionUUID->"165457c7-96ba-4238-9f7d-c5ddb7e448b5",
 CellID->1305812373],
Cell[19215, 539, 874, 22, 70, "ExampleText",ExpressionUUID->"f1f19632-0c72-4a3e-8300-75cb3d4f5d19"],
Cell[CellGroupData[{
Cell[20114, 565, 602, 18, 70, "Input",ExpressionUUID->"1f9e57c6-a427-459f-a653-efe8a3833f10"],
Cell[20719, 585, 111, 1, 70, "Output",ExpressionUUID->"c28992f7-fef3-4179-bd86-7ffc2785aa30"]
}, Open  ]],
Cell[CellGroupData[{
Cell[20867, 591, 371, 10, 70, "Input",ExpressionUUID->"6daf6184-d693-4dce-909a-3b1cfba89775"],
Cell[21241, 603, 147, 1, 70, "Output",ExpressionUUID->"ca83ed99-d4dd-4176-9617-f7bbf7291239"]
}, Open  ]],
Cell[21403, 607, 251, 4, 70, "ExampleText",ExpressionUUID->"1ca045a8-2016-4fa0-9b8c-970799f04752"],
Cell[21657, 613, 737, 18, 70, "ExampleText",ExpressionUUID->"cc752033-80aa-4540-9c3e-63b177d92830"]
}, Closed]]
}, Open  ]],
Cell[22421, 635, 2397, 64, 70, "SeeAlsoSection",ExpressionUUID->"919eef0c-8805-4369-8e76-ef72bf8d5e5b"],
Cell[24821, 701, 740, 19, 70, "MoreAboutSection",ExpressionUUID->"97f71e85-d817-486c-92de-8c53ea458450"],
Cell[25564, 722, 78, 0, 70, "FooterCell",ExpressionUUID->"64543d43-6777-4519-9867-6533012e149d"]
}
]
*)

(* End of internal cache information *)

