(************** Content-type: application/mathematica ************** Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 35351, 1323]*) (*NotebookOutlinePosition[ 36006, 1346]*) (* CellTagsIndexPosition[ 35962, 1342]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell[TextData[{ "Applying prime factorisation in ", StyleBox["Mathematica", FontSlant->"Italic"], ":\nRSA encryption functions" }], "Subtitle"], Cell["\<\ Ivan Cnop Vrije Universiteit Brussel icnop@vub.ac.be\ \>", "Subsubtitle"], Cell[CellGroupData[{ Cell["Introduction", "Subsection"], Cell[TextData[{ "In this text,we let students write their own RSA code. This code is due to \ Rivest, Shamir and Adleman and universally used.\nSome instructions use list \ operations. The usage of list programming is limited in this notebook to the \ very simple Range, Length and Select commands that perform exactly what their \ name suggests. No hidden programming is necessary.\nFor the theoretical \ background it is useful to try out the Ugroups text first.\nIt is recommended \ to start a new session with ", StyleBox["Mathematica", FontSlant->"Italic"], " Kernel." }], "Text", FontWeight->"Bold"] }, Closed]], Cell[CellGroupData[{ Cell["Products of 2 primes", "Section"], Cell[TextData[{ "How do we recognise that a number is the product of exactly two prime \ numbers? \nLet us start with numbers we can factor by hand and check how ", StyleBox["Mathematica", FontSlant->"Italic"], " does this." }], "Text", FontWeight->"Bold"], Cell[CellGroupData[{ Cell["Introductory example", "Subsection"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{ StyleBox["FactorInteger", FontColor->RGBColor[1, 0, 0]], "[", "94", "]"}], "//", "TableForm"}]], "Input", CellAutoOverwrite->False], Cell[BoxData[ TagBox[GridBox[{ {"2", "1"}, {"47", "1"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$]]]], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Length[%]\)], "Input"], Cell[BoxData[ \(2\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{ StyleBox["FactorInteger", FontColor->RGBColor[1, 0, 0]], "[", "96", "]"}], "//", "TableForm"}]], "Input", CellAutoOverwrite->False], Cell[BoxData[ TagBox[GridBox[{ {"2", "5"}, {"3", "1"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$]]]], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(FactorInteger[9] // TableForm\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ TagBox[GridBox[{ {"3", "2"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$]]]], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Length[%]\)], "Input"], Cell[BoxData[ \(1\)], "Output"] }, Closed]], Cell[TextData[{ "Now that we know primes are found in the first column, we select this \ first column by ", StyleBox["First[Transpose[ ]]", FontWeight->"Bold"] }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(First[Transpose[FactorInteger[91]]]\)], "Input"], Cell[BoxData[ \({7, 13}\)], "Output"] }, Closed]], Cell["\<\ and the \"good\" integer are those which are exactly this \ product:\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Times @@ First[Transpose[FactorInteger[91]]]\)], "Input"], Cell[BoxData[ \(91\)], "Output"] }, Closed]], Cell["Here is a list of the smallest prime factors", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Table[ First[First[Transpose[FactorInteger[n]]]], {n, 2, 200}]\)], "Input"], Cell[BoxData[ \({2, 3, 2, 5, 2, 7, 2, 3, 2, 11, 2, 13, 2, 3, 2, 17, 2, 19, 2, 3, 2, 23, 2, 5, 2, 3, 2, 29, 2, 31, 2, 3, 2, 5, 2, 37, 2, 3, 2, 41, 2, 43, 2, 3, 2, 47, 2, 7, 2, 3, 2, 53, 2, 5, 2, 3, 2, 59, 2, 61, 2, 3, 2, 5, 2, 67, 2, 3, 2, 71, 2, 73, 2, 3, 2, 7, 2, 79, 2, 3, 2, 83, 2, 5, 2, 3, 2, 89, 2, 7, 2, 3, 2, 5, 2, 97, 2, 3, 2, 101, 2, 103, 2, 3, 2, 107, 2, 109, 2, 3, 2, 113, 2, 5, 2, 3, 2, 7, 2, 11, 2, 3, 2, 5, 2, 127, 2, 3, 2, 131, 2, 7, 2, 3, 2, 137, 2, 139, 2, 3, 2, 11, 2, 5, 2, 3, 2, 149, 2, 151, 2, 3, 2, 5, 2, 157, 2, 3, 2, 7, 2, 163, 2, 3, 2, 167, 2, 13, 2, 3, 2, 173, 2, 5, 2, 3, 2, 179, 2, 181, 2, 3, 2, 5, 2, 11, 2, 3, 2, 191, 2, 193, 2, 3, 2, 197, 2, 199, 2}\)], "Output"] }, Closed]], Cell["\<\ Here is a list of all prime factors,without multiplicity, as is \ used in the computation of the Euler phi function.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Table[First[Transpose[FactorInteger[n]]], {n, 2, 200}] // TableForm\)], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {"2", "\<\"\"\>", "\<\"\"\>"}, {"3", "\<\"\"\>", "\<\"\"\>"}, {"2", "\<\"\"\>", "\<\"\"\>"}, {"5", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "\<\"\"\>"}, {"7", "\<\"\"\>", "\<\"\"\>"}, {"2", "\<\"\"\>", "\<\"\"\>"}, {"3", "\<\"\"\>", "\<\"\"\>"}, {"2", "5", "\<\"\"\>"}, {"11", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "\<\"\"\>"}, {"13", "\<\"\"\>", "\<\"\"\>"}, {"2", "7", "\<\"\"\>"}, {"3", "5", "\<\"\"\>"}, {"2", "\<\"\"\>", "\<\"\"\>"}, {"17", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "\<\"\"\>"}, {"19", "\<\"\"\>", "\<\"\"\>"}, {"2", "5", "\<\"\"\>"}, {"3", "7", "\<\"\"\>"}, {"2", "11", "\<\"\"\>"}, {"23", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "\<\"\"\>"}, {"5", "\<\"\"\>", "\<\"\"\>"}, {"2", "13", "\<\"\"\>"}, {"3", "\<\"\"\>", "\<\"\"\>"}, {"2", "7", "\<\"\"\>"}, {"29", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "5"}, {"31", "\<\"\"\>", "\<\"\"\>"}, {"2", "\<\"\"\>", "\<\"\"\>"}, {"3", "11", "\<\"\"\>"}, {"2", "17", "\<\"\"\>"}, {"5", "7", "\<\"\"\>"}, {"2", "3", "\<\"\"\>"}, {"37", "\<\"\"\>", "\<\"\"\>"}, {"2", "19", "\<\"\"\>"}, {"3", "13", "\<\"\"\>"}, {"2", "5", "\<\"\"\>"}, {"41", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "7"}, {"43", "\<\"\"\>", "\<\"\"\>"}, {"2", "11", "\<\"\"\>"}, {"3", "5", "\<\"\"\>"}, {"2", "23", "\<\"\"\>"}, {"47", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "\<\"\"\>"}, {"7", "\<\"\"\>", "\<\"\"\>"}, {"2", "5", "\<\"\"\>"}, {"3", "17", "\<\"\"\>"}, {"2", "13", "\<\"\"\>"}, {"53", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "\<\"\"\>"}, {"5", "11", "\<\"\"\>"}, {"2", "7", "\<\"\"\>"}, {"3", "19", "\<\"\"\>"}, {"2", "29", "\<\"\"\>"}, {"59", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "5"}, {"61", "\<\"\"\>", "\<\"\"\>"}, {"2", "31", "\<\"\"\>"}, {"3", "7", "\<\"\"\>"}, {"2", "\<\"\"\>", "\<\"\"\>"}, {"5", "13", "\<\"\"\>"}, {"2", "3", "11"}, {"67", "\<\"\"\>", "\<\"\"\>"}, {"2", "17", "\<\"\"\>"}, {"3", "23", "\<\"\"\>"}, {"2", "5", "7"}, {"71", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "\<\"\"\>"}, {"73", "\<\"\"\>", "\<\"\"\>"}, {"2", "37", "\<\"\"\>"}, {"3", "5", "\<\"\"\>"}, {"2", "19", "\<\"\"\>"}, {"7", "11", "\<\"\"\>"}, {"2", "3", "13"}, {"79", "\<\"\"\>", "\<\"\"\>"}, {"2", "5", "\<\"\"\>"}, {"3", "\<\"\"\>", "\<\"\"\>"}, {"2", "41", "\<\"\"\>"}, {"83", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "7"}, {"5", "17", "\<\"\"\>"}, {"2", "43", "\<\"\"\>"}, {"3", "29", "\<\"\"\>"}, {"2", "11", "\<\"\"\>"}, {"89", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "5"}, {"7", "13", "\<\"\"\>"}, {"2", "23", "\<\"\"\>"}, {"3", "31", "\<\"\"\>"}, {"2", "47", "\<\"\"\>"}, {"5", "19", "\<\"\"\>"}, {"2", "3", "\<\"\"\>"}, {"97", "\<\"\"\>", "\<\"\"\>"}, {"2", "7", "\<\"\"\>"}, {"3", "11", "\<\"\"\>"}, {"2", "5", "\<\"\"\>"}, {"101", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "17"}, {"103", "\<\"\"\>", "\<\"\"\>"}, {"2", "13", "\<\"\"\>"}, {"3", "5", "7"}, {"2", "53", "\<\"\"\>"}, {"107", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "\<\"\"\>"}, {"109", "\<\"\"\>", "\<\"\"\>"}, {"2", "5", "11"}, {"3", "37", "\<\"\"\>"}, {"2", "7", "\<\"\"\>"}, {"113", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "19"}, {"5", "23", "\<\"\"\>"}, {"2", "29", "\<\"\"\>"}, {"3", "13", "\<\"\"\>"}, {"2", "59", "\<\"\"\>"}, {"7", "17", "\<\"\"\>"}, {"2", "3", "5"}, {"11", "\<\"\"\>", "\<\"\"\>"}, {"2", "61", "\<\"\"\>"}, {"3", "41", "\<\"\"\>"}, {"2", "31", "\<\"\"\>"}, {"5", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "7"}, {"127", "\<\"\"\>", "\<\"\"\>"}, {"2", "\<\"\"\>", "\<\"\"\>"}, {"3", "43", "\<\"\"\>"}, {"2", "5", "13"}, {"131", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "11"}, {"7", "19", "\<\"\"\>"}, {"2", "67", "\<\"\"\>"}, {"3", "5", "\<\"\"\>"}, {"2", "17", "\<\"\"\>"}, {"137", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "23"}, {"139", "\<\"\"\>", "\<\"\"\>"}, {"2", "5", "7"}, {"3", "47", "\<\"\"\>"}, {"2", "71", "\<\"\"\>"}, {"11", "13", "\<\"\"\>"}, {"2", "3", "\<\"\"\>"}, {"5", "29", "\<\"\"\>"}, {"2", "73", "\<\"\"\>"}, {"3", "7", "\<\"\"\>"}, {"2", "37", "\<\"\"\>"}, {"149", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "5"}, {"151", "\<\"\"\>", "\<\"\"\>"}, {"2", "19", "\<\"\"\>"}, {"3", "17", "\<\"\"\>"}, {"2", "7", "11"}, {"5", "31", "\<\"\"\>"}, {"2", "3", "13"}, {"157", "\<\"\"\>", "\<\"\"\>"}, {"2", "79", "\<\"\"\>"}, {"3", "53", "\<\"\"\>"}, {"2", "5", "\<\"\"\>"}, {"7", "23", "\<\"\"\>"}, {"2", "3", "\<\"\"\>"}, {"163", "\<\"\"\>", "\<\"\"\>"}, {"2", "41", "\<\"\"\>"}, {"3", "5", "11"}, {"2", "83", "\<\"\"\>"}, {"167", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "7"}, {"13", "\<\"\"\>", "\<\"\"\>"}, {"2", "5", "17"}, {"3", "19", "\<\"\"\>"}, {"2", "43", "\<\"\"\>"}, {"173", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "29"}, {"5", "7", "\<\"\"\>"}, {"2", "11", "\<\"\"\>"}, {"3", "59", "\<\"\"\>"}, {"2", "89", "\<\"\"\>"}, {"179", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "5"}, {"181", "\<\"\"\>", "\<\"\"\>"}, {"2", "7", "13"}, {"3", "61", "\<\"\"\>"}, {"2", "23", "\<\"\"\>"}, {"5", "37", "\<\"\"\>"}, {"2", "3", "31"}, {"11", "17", "\<\"\"\>"}, {"2", "47", "\<\"\"\>"}, {"3", "7", "\<\"\"\>"}, {"2", "5", "19"}, {"191", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "\<\"\"\>"}, {"193", "\<\"\"\>", "\<\"\"\>"}, {"2", "97", "\<\"\"\>"}, {"3", "5", "13"}, {"2", "7", "\<\"\"\>"}, {"197", "\<\"\"\>", "\<\"\"\>"}, {"2", "3", "11"}, {"199", "\<\"\"\>", "\<\"\"\>"}, {"2", "5", "\<\"\"\>"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ {{2}, {3}, {2}, {5}, {2, 3}, {7}, {2}, {3}, {2, 5}, {11}, {2, 3}, {13}, {2, 7}, {3, 5}, {2}, {17}, {2, 3}, {19}, {2, 5}, {3, 7}, { 2, 11}, {23}, {2, 3}, {5}, {2, 13}, {3}, {2, 7}, {29}, {2, 3, 5}, { 31}, {2}, {3, 11}, {2, 17}, {5, 7}, {2, 3}, {37}, {2, 19}, {3, 13}, { 2, 5}, {41}, {2, 3, 7}, {43}, {2, 11}, {3, 5}, {2, 23}, {47}, {2, 3}, {7}, {2, 5}, {3, 17}, {2, 13}, {53}, {2, 3}, {5, 11}, {2, 7}, {3, 19}, {2, 29}, {59}, {2, 3, 5}, {61}, {2, 31}, {3, 7}, {2}, {5, 13}, { 2, 3, 11}, {67}, {2, 17}, {3, 23}, {2, 5, 7}, {71}, {2, 3}, {73}, {2, 37}, {3, 5}, {2, 19}, {7, 11}, {2, 3, 13}, {79}, {2, 5}, {3}, {2, 41}, {83}, {2, 3, 7}, {5, 17}, {2, 43}, {3, 29}, {2, 11}, {89}, {2, 3, 5}, {7, 13}, {2, 23}, {3, 31}, {2, 47}, {5, 19}, {2, 3}, {97}, {2, 7}, {3, 11}, {2, 5}, {101}, {2, 3, 17}, {103}, {2, 13}, {3, 5, 7}, {2, 53}, {107}, {2, 3}, {109}, {2, 5, 11}, {3, 37}, {2, 7}, {113}, {2, 3, 19}, {5, 23}, {2, 29}, {3, 13}, {2, 59}, {7, 17}, {2, 3, 5}, {11}, { 2, 61}, {3, 41}, {2, 31}, {5}, {2, 3, 7}, {127}, {2}, {3, 43}, {2, 5, 13}, {131}, {2, 3, 11}, {7, 19}, {2, 67}, {3, 5}, {2, 17}, {137}, {2, 3, 23}, {139}, {2, 5, 7}, {3, 47}, {2, 71}, {11, 13}, {2, 3}, {5, 29}, {2, 73}, {3, 7}, {2, 37}, {149}, {2, 3, 5}, {151}, {2, 19}, {3, 17}, {2, 7, 11}, {5, 31}, {2, 3, 13}, {157}, {2, 79}, {3, 53}, {2, 5}, {7, 23}, {2, 3}, {163}, {2, 41}, {3, 5, 11}, {2, 83}, {167}, {2, 3, 7}, {13}, {2, 5, 17}, {3, 19}, {2, 43}, {173}, {2, 3, 29}, {5, 7}, {2, 11}, {3, 59}, {2, 89}, {179}, {2, 3, 5}, {181}, {2, 7, 13}, { 3, 61}, {2, 23}, {5, 37}, {2, 3, 31}, {11, 17}, {2, 47}, {3, 7}, {2, 5, 19}, {191}, {2, 3}, {193}, {2, 97}, {3, 5, 13}, {2, 7}, {197}, {2, 3, 11}, {199}, {2, 5}}]]], "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Selection of a number close to 10000", "Subsection"], Cell[CellGroupData[{ Cell[BoxData[{ \(Remark : \ we\ will\ see\ in\ the\ following\ section\ \((about\ Partitioning\ \ into\ blocks)\) why\ it\ is\ useful\ to\ have\ a\ number\ slightly\ more\ than\ a\ \ power\ of\ 10. \ \), "\[IndentingNewLine]", \(The\ examples\ here\ are\ kept\ very\ small\ compared\ to\ the\ numbers\ \ \((close\ to\ \ \ 10\^60\ \ )\)\ used\ in\ the\ actual\ application . \ \ \[IndentingNewLine]Here\ is\ how\ \*"\"\<\>" good \*"\"\<\>"\ is\ \(\(programmed\)\(:\)\)\)}], "Subsubsection", CellDingbat->None, FontFamily->"Times New Roman"], Cell[BoxData[ \(Clear[good]\)], "Input"], Cell[BoxData[ \(good[n_] := If[Length[FactorInteger[n]] == 2 && Times @@ First[Transpose[FactorInteger[n]]] == n, True, False]\)], "Input"], Cell["\<\ In the list of all numbers from 9000 to a little over 10000 we \ select the last \"good\" ones by \ \>", "Text"], Cell[BoxData[ RowBox[{ RowBox[{ StyleBox["Select", FontColor->RGBColor[1, 0, 0]], "[", \(Range[9000, 10020], good\), "]"}], ";"}]], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(Take[%, \(-5\)]\)], "Input"], Cell[BoxData[ \({10003, 10006, 10015, 10018, 10019}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(FactorInteger[%] // TableForm\)], "Input"], Cell[BoxData[ InterpretationBox[GridBox[{ {GridBox[{ {"7"}, {"1"} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {"1429"}, {"1"} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]}, {GridBox[{ {"2"}, {"1"} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {"5003"}, {"1"} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]}, {GridBox[{ {"5"}, {"1"} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {"2003"}, {"1"} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]}, {GridBox[{ {"2"}, {"1"} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {"5009"}, {"1"} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]}, {GridBox[{ {"43"}, {"1"} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}], GridBox[{ {"233"}, {"1"} }, RowSpacings->0.25, ColumnSpacings->1, RowAlignments->Baseline, ColumnAlignments->{Left}]} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], TableForm[ {{{7, 1}, {1429, 1}}, {{2, 1}, {5003, 1}}, {{5, 1}, {2003, 1}}, {{2, 1}, {5009, 1}}, {{43, 1}, {233, 1}}}]]], "Output"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Selection of complementary exponents", "Subsection"], Cell["The pair 43 and 233 seem to be a good choice", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(p = 43; q = 233; n = p\ q\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(10019\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(m = \((p - 1)\)\ \((q - 1)\)\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(9744\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(FactorInteger[m] // TableForm\)], "Input"], Cell[BoxData[ TagBox[GridBox[{ {"2", "4"}, {"3", "1"}, {"7", "1"}, {"29", "1"} }, RowSpacings->1, ColumnSpacings->3, RowAlignments->Baseline, ColumnAlignments->{Left}], Function[ BoxForm`e$, TableForm[ BoxForm`e$]]]], "Output"] }, Closed]], Cell["\<\ Look for invertible elements modulo m : these are precisely the \ ones relatively prime with m . \ \>", "Text"], Cell[BoxData[ RowBox[{\(relPrime[k_]\), ":=", RowBox[{ RowBox[{ StyleBox["GCD", FontColor->RGBColor[1, 0, 0]], "[", \(k, m\), "]"}], "==", "1"}]}]], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(\(invertibles = Select[Range[m], relPrime];\)\)], "Input", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell[BoxData[ \(Length[%]\)], "Input"], Cell[BoxData[ \(2688\)], "Output"] }, Closed]], Cell["\<\ If we loopup de full list, we see 509 is a member. Look for the \ inverse of 509: the product has t o be 1 . Its position in the list of invertibles is\ \>", "Text", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ StyleBox["Position", FontColor->RGBColor[1, 0, 0]], "[", \(Map[Mod[509\ #, m] &, invertibles], 1\), "]"}]], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({{1326}}\)], "Output"] }, Closed]], Cell["This number is", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(invertibles[\([1326]\)]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(4805\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[4805\ 509, m]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(1\)], "Output"] }, Closed]], Cell["\<\ Avoid choosing self-invertible elements since it is bad practice to \ make choices that enable guessing the inverse\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ StyleBox["Position", FontColor->RGBColor[1, 0, 0]], "[", \(Mod[\((invertibles)\)\^2, m], 1\), "]"}]], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({{1}, {113}, {129}, {336}, {433}, {449}, {465}, {576}, {769}, {880}, \ {896}, {912}, {1009}, {1216}, {1232}, {1344}, {1345}, {1457}, {1473}, {1680}, \ {1777}, {1793}, {1809}, {1920}, {2113}, {2224}, {2240}, {2256}, {2353}, \ {2560}, {2576}, {2688}}\)], "Output"] }, Closed]], Cell["These are", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(\(Select[Range[m], relPrime]\)[\([Flatten[%]]\)]\)], "Input"], Cell[BoxData[ \({1, 407, 463, 1217, 1567, 1625, 1681, 2087, 2785, 3191, 3247, 3305, 3655, 4409, 4465, 4871, 4873, 5279, 5335, 6089, 6439, 6497, 6553, 6959, 7657, 8063, 8119, 8177, 8527, 9281, 9337, 9743}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Length[%]\)], "Input"], Cell[BoxData[ \(32\)], "Output"] }, Closed]], Cell["Therefore 2785 is a bad choice since", "Text", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[2785\ 2785, m]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(1\)], "Output"] }, Closed]], Cell["We have found all such numbers.", "Text", CellAutoOverwrite->False] }, Closed]], Cell[CellGroupData[{ Cell["Testing powers", "Subsection"], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[100^4805, n]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(6187\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[%^509, n]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(100\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[333^4805, n]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(5721\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[%^509, n]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(333\)], "Output"] }, Closed]], Cell["\<\ Maybe it is better to choose 509 for encoding messages, and its \ inverse 4805 for decoding. Choosing a decoding key in the middle of invertibles discourages running all \ first few thousand powers to crack the code.\ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[2407^509, n]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(42\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[%^4805, n]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(2407\)], "Output"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Partitioning a number in blocks size 4 ( < 10000 )", "Section"], Cell[CellGroupData[{ Cell["Building a program", "Subsection"], Cell[CellGroupData[{ Cell[BoxData[ \(t = 3\^200\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(265613988875874769338781322035779626829233452653394495974574961739092490\ 901302182994384699044001\)], "Output"] }, Closed]], Cell[BoxData[ \(Clear[more]\)], "Input"], Cell[BoxData[ \(more[{l_List, m_Integer}] := \n\t If[m == 0, {l, m}, \n\t\t{Prepend[l, Mod[m, 10000]], \((m - Mod[m, 10000])\)/ 10000}]\)], "Input", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell[BoxData[ \(more[more[{{}, t}]]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({{9904, 4001}, 265613988875874769338781322035779626829233452653394495974574961739092490\ 9013021829943846}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(message = First[Nest[more, {{}, t}, IntegerPart[Log[10000, t]] + 1]]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(General::"spell1" \(\(:\)\(\ \)\) "Possible spelling error: new symbol name \"\!\(message\)\" is similar \ to existing symbol \"\!\(Message\)\"."\)], "Message"], Cell[BoxData[ \({2656, 1398, 8875, 8747, 6933, 8781, 3220, 3577, 9626, 8292, 3345, 2653, 3944, 9597, 4574, 9617, 3909, 2490, 9013, 218, 2994, 3846, 9904, 4001}\)], "Output"] }, Closed]], Cell["Send:", "Text", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[message^509, n]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({7844, 8854, 6490, 9737, 2476, 3708, 3540, 8774, 3748, 4650, 4462, 9687, 396, 7183, 1870, 5638, 438, 8135, 2411, 587, 1097, 3556, 4022, 1279}\)], "Output"] }, Closed]], Cell["Decode:", "Text", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[%^4805, n]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({2656, 1398, 8875, 8747, 6933, 8781, 3220, 3577, 9626, 8292, 3345, 2653, 3944, 9597, 4574, 9617, 3909, 2490, 9013, 218, 2994, 3846, 9904, 4001}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Plus @@ \((10000\^Range[0, Length[%] - 1] . Reverse[%])\)\)], "Input"], Cell[BoxData[ \(265613988875874769338781322035779626829233452653394495974574961739092490\ 901302182994384699044001\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(% == t\)], "Input"], Cell[BoxData[ \(True\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Timing[Mod[message^509, n]]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({0.`\ Second, {7844, 8854, 6490, 9737, 2476, 3708, 3540, 8774, 3748, 4650, 4462, 9687, 396, 7183, 1870, 5638, 438, 8135, 2411, 587, 1097, 3556, 4022, 1279}}\)], "Output"] }, Closed]], Cell["Seems FAST!", "Text"], Cell["\<\ Remark: the \"PowerMod\" command is even faster and useful for \ large powers.\ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["General basis", "Subsection"], Cell["Choose basis smaller than n", "Text", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell[BoxData[ \(basis = 10001\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(10001\)], "Output"] }, Closed]], Cell[BoxData[ \(Clear[more]\)], "Input"], Cell[BoxData[ \(more[{l_List, m_Integer}] := \n\t If[m == 0, {l, m}, \n\t\t{Prepend[l, Mod[m, basis]], \((m - Mod[m, basis])\)/ basis}]\)], "Input", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell[BoxData[ \(message = First[Nest[more, {{}, t}, IntegerPart[Log[basis, t]] + 1]]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({2650, 380, 9567, 4295, 460, 6335, 9737, 55, 215, 3137, 2843, 6032, 7250, 6312, 1983, 9125, 8247, 9250, 5623, 6270, 295, 7370, 2345, 4225}\)], "Output"] }, Closed]], Cell["Send:", "Text", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[%^509, n]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({6429, 6, 7486, 6464, 4871, 5785, 2567, 6742, 7955, 6031, 2351, 5022, 4045, 6956, 1276, 1472, 9235, 2007, 5178, 9587, 480, 4899, 5005, 9605}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[%^4805, n]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({2650, 380, 9567, 4295, 460, 6335, 9737, 55, 215, 3137, 2843, 6032, 7250, 6312, 1983, 9125, 8247, 9250, 5623, 6270, 295, 7370, 2345, 4225}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Plus @@ \((basis\^Range[0, Length[%] - 1] . Reverse[%])\)\)], "Input"], Cell[BoxData[ \(265613988875874769338781322035779626829233452653394495974574961739092490\ 901302182994384699044001\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(% \[Equal] t\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(True\)], "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Different choices", "Subsection", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell[BoxData[ \(basis = 994\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(994\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(message = First[Nest[more, {{}, t}, IntegerPart[Log[basis, t]] + 1]]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({320, 90, 134, 34, 509, 905, 328, 836, 216, 504, 769, 787, 986, 846, 189, 108, 568, 947, 786, 584, 601, 165, 846, 260, 850, 349, 729, 523, 881, 240, 882, 37}\)], "Output"] }, Closed]], Cell["Send:", "Text", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[%^509, n]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({8759, 3862, 2050, 9536, 6069, 3644, 6816, 1621, 8085, 8695, 8012, 6567, 8787, 9093, 40, 4167, 1773, 345, 9924, 6818, 4213, 8993, 9093, 4977, 7070, 4157, 6590, 553, 8260, 411, 598, 265}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[%^4805, n]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({320, 90, 134, 34, 509, 905, 328, 836, 216, 504, 769, 787, 986, 846, 189, 108, 568, 947, 786, 584, 601, 165, 846, 260, 850, 349, 729, 523, 881, 240, 882, 37}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Plus @@ \((basis\^Range[0, Length[%] - 1] . Reverse[%])\)\)], "Input"], Cell[BoxData[ \(265613988875874769338781322035779626829233452653394495974574961739092490\ 901302182994384699044001\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(% \[Equal] t\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(True\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell["If messages are binary , use blocks which are a power of 2 ", \ "Subsubsection", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell[BoxData[ \(basis = 4096\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(4096\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(message = First[Nest[more, {{}, t}, IntegerPart[Log[basis, t]] + 1]]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({31, 3416, 1596, 1003, 70, 2540, 538, 2359, 2678, 3892, 815, 4055, 985, 2020, 1142, 107, 1667, 3791, 1782, 3658, 1966, 549, 3066, 4081, 3754, 3979, 161}\)], "Output"] }, Closed]], Cell["Send:", "Text", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[%^509, n]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({52, 2180, 631, 9569, 323, 4758, 5328, 6199, 5065, 8940, 3924, 5750, 2975, 4385, 2894, 4476, 18, 983, 546, 9230, 8996, 2598, 7255, 9382, 6395, 9520, 8885}\)], "Output"] }, Closed]], Cell["Decode:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Mod[%^4805, n]\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \({31, 3416, 1596, 1003, 70, 2540, 538, 2359, 2678, 3892, 815, 4055, 985, 2020, 1142, 107, 1667, 3791, 1782, 3658, 1966, 549, 3066, 4081, 3754, 3979, 161}\)], "Output"] }, Closed]], Cell["Check:", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Plus @@ \((basis\^Range[0, Length[%] - 1] . Reverse[%])\)\)], "Input"], Cell[BoxData[ \(265613988875874769338781322035779626829233452653394495974574961739092490\ 901302182994384699044001\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(% \[Equal] t\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(True\)], "Output"] }, Closed]] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Conclusion:", "Section"], Cell["\<\ Both sending and receiving messages is handled by computing large \ powers. The number n and the encrypting key (exponent) is made public so that \ senders can send encrypted messages, changing basis occasionally. The receiver knows p, q, and the decripting key (exponent), which is the \ inverse of the encrypting key modulo (p-1) (q-1). To crack a code one needs to know the prime number decompostion of n \ .\ \>", "Text", FontWeight->"Bold"] }, Closed]], Cell[CellGroupData[{ Cell["Exercises", "Section", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell["\<\ Repeat with n somewhat bigger than 100000 and basis a \ power of 2\ \>", "Subsubsection", CellAutoOverwrite->False], Cell[CellGroupData[{ Cell[BoxData[ \(basis = 2^16\)], "Input", CellAutoOverwrite->False], Cell[BoxData[ \(65536\)], "Output"] }, Closed]], Cell["\<\ splitting binary message in 16 bit blocks. Remark: do NOT write the complete multiplaction table . Try to crack the code of your classmates.\ \>", "Text", CellAutoOverwrite->False] }, Closed]], Cell[CellGroupData[{ Cell["Guessing how the PowerMod command works", "Subsubsection"], Cell["Compare", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Timing[Mod[123456789\^238145, 17]]\)], "Input"], Cell[BoxData[ \({5.290000000000001`\ Second, 1}\)], "Output"] }, Closed]], Cell[CellGroupData[{ Cell[BoxData[ \(Timing[PowerMod[123456789, 238145, 17]]\)], "Input"], Cell[BoxData[ \({0.`\ Second, 1}\)], "Output"] }, Closed]], Cell["\<\ Look up in the Help and other documentation which rules apply when \ working with Mod and powers.\ \>", "Text"] }, Closed]] }, Closed]] }, Open ]] }, FrontEndVersion->"4.1 for Macintosh", ScreenRectangle->{{0, 1152}, {0, 746}}, WindowSize->{768, 710}, WindowMargins->{{111, Automatic}, {Automatic, 0}}, Magnification->1 ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1727, 52, 153, 5, 95, "Subtitle"], Cell[1883, 59, 83, 4, 89, "Subsubtitle"], Cell[CellGroupData[{ Cell[1991, 67, 34, 0, 46, "Subsection"], Cell[2028, 69, 617, 12, 104, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[2682, 86, 39, 0, 36, "Section"], Cell[2724, 88, 269, 7, 50, "Text"], Cell[CellGroupData[{ Cell[3018, 99, 42, 0, 46, "Subsection"], Cell[CellGroupData[{ Cell[3085, 103, 200, 6, 27, "Input"], Cell[3288, 111, 284, 10, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[3609, 126, 42, 1, 27, "Input"], Cell[3654, 129, 35, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[3726, 135, 200, 6, 27, "Input"], Cell[3929, 143, 283, 10, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[4249, 158, 90, 2, 27, "Input"], Cell[4342, 162, 261, 9, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[4640, 176, 42, 1, 27, "Input"], Cell[4685, 179, 35, 1, 70, "Output"] }, Closed]], Cell[4735, 183, 182, 5, 32, "Text"], Cell[CellGroupData[{ Cell[4942, 192, 68, 1, 27, "Input"], Cell[5013, 195, 41, 1, 70, "Output"] }, Closed]], Cell[5069, 199, 92, 3, 30, "Text"], Cell[CellGroupData[{ Cell[5186, 206, 77, 1, 27, "Input"], Cell[5266, 209, 36, 1, 70, "Output"] }, Closed]], Cell[5317, 213, 60, 0, 30, "Text"], Cell[CellGroupData[{ Cell[5402, 217, 101, 2, 27, "Input"], Cell[5506, 221, 761, 10, 70, "Output"] }, Closed]], Cell[6282, 234, 140, 3, 30, "Text"], Cell[CellGroupData[{ Cell[6447, 241, 107, 2, 27, "Input"], Cell[6557, 245, 9210, 230, 70, "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[15816, 481, 59, 0, 30, "Subsection"], Cell[CellGroupData[{ Cell[15900, 485, 575, 11, 98, "Subsubsection"], Cell[16478, 498, 44, 1, 27, "Input"], Cell[16525, 501, 170, 4, 59, "Input"], Cell[16698, 507, 122, 3, 30, "Text"], Cell[16823, 512, 177, 5, 27, "Input"], Cell[CellGroupData[{ Cell[17025, 521, 48, 1, 27, "Input"], Cell[17076, 524, 69, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[17182, 530, 62, 1, 27, "Input"], Cell[17247, 533, 2597, 83, 70, "Output"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[19905, 623, 58, 0, 46, "Subsection"], Cell[19966, 625, 61, 0, 30, "Text"], Cell[CellGroupData[{ Cell[20052, 629, 86, 2, 27, "Input"], Cell[20141, 633, 39, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[20217, 639, 89, 2, 24, "Input"], Cell[20309, 643, 38, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[20384, 649, 62, 1, 24, "Input"], Cell[20449, 652, 328, 12, 70, "Output"] }, Closed]], Cell[20792, 667, 126, 3, 27, "Text"], Cell[20921, 672, 235, 7, 27, "Input"], Cell[21159, 681, 106, 2, 27, "Input"], Cell[CellGroupData[{ Cell[21290, 687, 42, 1, 27, "Input"], Cell[21335, 690, 38, 1, 70, "Output"] }, Closed]], Cell[21388, 694, 204, 5, 43, "Text"], Cell[CellGroupData[{ Cell[21617, 703, 192, 5, 27, "Input"], Cell[21812, 710, 42, 1, 70, "Output"] }, Closed]], Cell[21869, 714, 30, 0, 27, "Text"], Cell[CellGroupData[{ Cell[21924, 718, 84, 2, 27, "Input"], Cell[22011, 722, 38, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[22086, 728, 78, 2, 24, "Input"], Cell[22167, 732, 35, 1, 70, "Output"] }, Closed]], Cell[22217, 736, 139, 3, 27, "Text"], Cell[CellGroupData[{ Cell[22381, 743, 186, 5, 31, "Input"], Cell[22570, 750, 282, 4, 70, "Output"] }, Closed]], Cell[22867, 757, 25, 0, 27, "Text"], Cell[CellGroupData[{ Cell[22917, 761, 81, 1, 27, "Input"], Cell[23001, 764, 235, 3, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[23273, 772, 42, 1, 24, "Input"], Cell[23318, 775, 36, 1, 70, "Output"] }, Closed]], Cell[23369, 779, 80, 1, 27, "Text"], Cell[CellGroupData[{ Cell[23474, 784, 79, 2, 27, "Input"], Cell[23556, 788, 35, 1, 70, "Output"] }, Closed]], Cell[23606, 792, 75, 1, 27, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[23718, 798, 36, 0, 30, "Subsection"], Cell[CellGroupData[{ Cell[23779, 802, 77, 2, 27, "Input"], Cell[23859, 806, 38, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[23934, 812, 74, 2, 27, "Input"], Cell[24011, 816, 37, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[24085, 822, 77, 2, 27, "Input"], Cell[24165, 826, 38, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[24240, 832, 74, 2, 27, "Input"], Cell[24317, 836, 37, 1, 70, "Output"] }, Closed]], Cell[24369, 840, 240, 5, 46, "Text"], Cell[CellGroupData[{ Cell[24634, 849, 77, 2, 27, "Input"], Cell[24714, 853, 36, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[24787, 859, 75, 2, 27, "Input"], Cell[24865, 863, 38, 1, 70, "Output"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[24964, 871, 69, 0, 36, "Section"], Cell[CellGroupData[{ Cell[25058, 875, 40, 0, 46, "Subsection"], Cell[CellGroupData[{ Cell[25123, 879, 71, 2, 29, "Input"], Cell[25197, 883, 132, 2, 43, "Output"] }, Closed]], Cell[25344, 888, 44, 1, 27, "Input"], Cell[25391, 891, 209, 5, 59, "Input"], Cell[CellGroupData[{ Cell[25625, 900, 80, 2, 27, "Input"], Cell[25708, 904, 147, 3, 43, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[25892, 912, 136, 3, 27, "Input"], Cell[26031, 917, 187, 3, 35, "Message"], Cell[26221, 922, 191, 3, 43, "Output"] }, Closed]], Cell[26427, 928, 49, 1, 30, "Text"], Cell[CellGroupData[{ Cell[26501, 933, 80, 2, 27, "Input"], Cell[26584, 937, 189, 3, 43, "Output"] }, Closed]], Cell[26788, 943, 51, 1, 30, "Text"], Cell[CellGroupData[{ Cell[26864, 948, 75, 2, 27, "Input"], Cell[26942, 952, 191, 3, 43, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[27170, 960, 90, 1, 31, "Input"], Cell[27263, 963, 132, 2, 43, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[27432, 970, 39, 1, 27, "Input"], Cell[27474, 973, 38, 1, 27, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[27549, 979, 88, 2, 27, "Input"], Cell[27640, 983, 208, 3, 43, "Output"] }, Closed]], Cell[27863, 989, 27, 0, 30, "Text"], Cell[27893, 991, 102, 3, 30, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[28032, 999, 35, 0, 46, "Subsection"], Cell[28070, 1001, 71, 1, 30, "Text"], Cell[CellGroupData[{ Cell[28166, 1006, 74, 2, 27, "Input"], Cell[28243, 1010, 39, 1, 27, "Output"] }, Closed]], Cell[28297, 1014, 44, 1, 27, "Input"], Cell[28344, 1017, 209, 5, 59, "Input"], Cell[CellGroupData[{ Cell[28578, 1026, 136, 3, 27, "Input"], Cell[28717, 1031, 186, 3, 43, "Output"] }, Closed]], Cell[28918, 1037, 49, 1, 30, "Text"], Cell[CellGroupData[{ Cell[28992, 1042, 74, 2, 27, "Input"], Cell[29069, 1046, 188, 3, 43, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[29294, 1054, 75, 2, 27, "Input"], Cell[29372, 1058, 186, 3, 43, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[29595, 1066, 90, 1, 31, "Input"], Cell[29688, 1069, 132, 2, 43, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[29857, 1076, 73, 2, 27, "Input"], Cell[29933, 1080, 38, 1, 27, "Output"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[30020, 1087, 67, 1, 46, "Subsection"], Cell[CellGroupData[{ Cell[30112, 1092, 72, 2, 26, "Input"], Cell[30187, 1096, 37, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[30261, 1102, 136, 3, 26, "Input"], Cell[30400, 1107, 205, 3, 70, "Output"] }, Closed]], Cell[30620, 1113, 49, 1, 31, "Text"], Cell[CellGroupData[{ Cell[30694, 1118, 74, 2, 26, "Input"], Cell[30771, 1122, 233, 3, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[31041, 1130, 75, 2, 26, "Input"], Cell[31119, 1134, 205, 3, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[31361, 1142, 90, 1, 28, "Input"], Cell[31454, 1145, 132, 2, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[31623, 1152, 73, 2, 26, "Input"], Cell[31699, 1156, 38, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[31774, 1162, 115, 2, 41, "Subsubsection"], Cell[CellGroupData[{ Cell[31914, 1168, 73, 2, 26, "Input"], Cell[31990, 1172, 38, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[32065, 1178, 136, 3, 26, "Input"], Cell[32204, 1183, 200, 3, 70, "Output"] }, Closed]], Cell[32419, 1189, 49, 1, 31, "Text"], Cell[CellGroupData[{ Cell[32493, 1194, 74, 2, 26, "Input"], Cell[32570, 1198, 202, 3, 70, "Output"] }, Closed]], Cell[32787, 1204, 23, 0, 31, "Text"], Cell[CellGroupData[{ Cell[32835, 1208, 75, 2, 26, "Input"], Cell[32913, 1212, 200, 3, 70, "Output"] }, Closed]], Cell[33128, 1218, 22, 0, 31, "Text"], Cell[CellGroupData[{ Cell[33175, 1222, 90, 1, 28, "Input"], Cell[33268, 1225, 132, 2, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[33437, 1232, 73, 2, 26, "Input"], Cell[33513, 1236, 38, 1, 70, "Output"] }, Closed]] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[33624, 1245, 30, 0, 36, "Section"], Cell[33657, 1247, 465, 10, 104, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[34159, 1262, 56, 1, 36, "Section"], Cell[CellGroupData[{ Cell[34240, 1267, 137, 4, 42, "Subsubsection"], Cell[CellGroupData[{ Cell[34402, 1275, 73, 2, 27, "Input"], Cell[34478, 1279, 39, 1, 70, "Output"] }, Closed]], Cell[34532, 1283, 194, 5, 62, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[34763, 1293, 64, 0, 28, "Subsubsection"], Cell[34830, 1295, 23, 0, 30, "Text"], Cell[CellGroupData[{ Cell[34878, 1299, 67, 1, 31, "Input"], Cell[34948, 1302, 65, 1, 70, "Output"] }, Closed]], Cell[CellGroupData[{ Cell[35050, 1308, 72, 1, 27, "Input"], Cell[35125, 1311, 50, 1, 70, "Output"] }, Closed]], Cell[35190, 1315, 121, 3, 30, "Text"] }, Closed]] }, Closed]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)