(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.0' 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[ 44804, 1333]*) (*NotebookOutlinePosition[ 45435, 1355]*) (* CellTagsIndexPosition[ 45391, 1351]*) (*WindowFrame->Normal*) Notebook[{ Cell[BoxData[ \(Off[General::spell, General::spell1]\)], "Input"], Cell[CellGroupData[{ Cell["DES Key Schedule", "Title"], Cell[CellGroupData[{ Cell["The Code", "Section"], Cell[CellGroupData[{ Cell["E-box", "Subsection"], Cell[BoxData[ \(\(Expansion::"\" = "\";\)\)], "Input"], Cell[BoxData[ \(Expansion[x_Integer] := Expansion[IntegerDigits[x, 2, 32]]\)], "Input"], Cell[BoxData[ \(Expansion[bits_?VectorQ] := Module[{len}, len = Length[bits]; If[32 != len, Message[Expansion::"\", 32, len], bits[\([{32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17, 16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1}]\)]]]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["S-boxes", "Subsection"], Cell[BoxData[ \(\(s1 = {{14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7}, {0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8}, {4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0}, {15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13}};\)\)], "Input"], Cell[BoxData[ \(\(s2 = {{15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10}, {3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5}, {0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15}, {13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9}};\)\)], "Input"], Cell[BoxData[ \(\(s3 = {{10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8}, {13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1}, {13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7}, {1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12}};\)\)], "Input"], Cell[BoxData[ \(\(s4 = {{7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15}, {13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9}, {10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4}, {3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14}};\)\)], "Input"], Cell[BoxData[ \(\(s5 = {{2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9}, {14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6}, {4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14}, {11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3}};\)\)], "Input"], Cell[BoxData[ \(\(s6 = {{12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11}, {10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8}, {9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6}, {4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13}};\)\)], "Input"], Cell[BoxData[ \(\(s7 = {{4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1}, {13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6}, {1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2}, {6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12}};\)\)], "Input"], Cell[BoxData[ \(\(s8 = {{13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7}, {1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2}, {7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8}, {2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11}};\)\)], "Input"], Cell[BoxData[ \(SBox[s_?MatrixQ, z_?VectorQ] := Module[{row, column}, row = 1 + FromDigits[Drop[z, {2, 5}], 2]; column = 1 + FromDigits[Take[z, {2, 5}], 2]; s[\([row, column]\)]]\)], "Input"], Cell[BoxData[ \(ApplySBoxes[z_?MatrixQ] := Module[{tmp}, tmp = Transpose[{{s1, s2, s3, s4, s5, s6, s7, s8}, z}]; tmp = Apply[SBox, tmp, {1}]; Map[IntegerDigits[#, 2, 4] &, tmp]]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["P-box", "Subsection"], Cell[BoxData[ \(\(FP::"\" = "\";\)\)], "Input"], Cell[BoxData[ \(FP[c_Integer] := FP[IntegerDigits[c, 2, 32]]\)], "Input"], Cell[BoxData[ \(FP[bits_?VectorQ] := Module[{len}, len = Length[bits]; If[32 != len, Message[FP::"\", 32, len], bits[\([{16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10, 2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25}]\)]]]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["DES Function", "Subsection"], Cell[BoxData[ \(\(f::"\" = "\";\)\)], "Input"], Cell[BoxData[ \(\(f::"\" = "\";\)\)], "Input"], Cell[BoxData[ \(f[x_Integer, y_Integer] := f[IntegerDigits[x, 2, 32], IntegerDigits[y, 2, 48]]\)], "Input"], Cell[BoxData[ \(f[xbits_?VectorQ, y_Integer] := f[xbits, IntegerDigits[y, 2, 48]]\)], "Input"], Cell[BoxData[ \(f[x_Integer, ybits_?VectorQ] := f[IntegerDigits[x, 2, 32], ybits]\)], "Input"], Cell[BoxData[ \(f[xbits_?VectorQ, ybits_?VectorQ] := Module[{tmp, len}, len = Length[xbits]; If[32 != len, Message[f::"\", 32, len]; Return[]]; len = Length[ybits]; If[48 != len, Message[f::"\", 48, len]; Return[]]; tmp = Mod[Expansion[xbits] + ybits, 2]; tmp = Partition[tmp, 6]; tmp = ApplySBoxes[tmp]; FP[Flatten[tmp]]]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Key Schedule", "Subsection"], Cell[BoxData[ \(\(PC1::"\" = "\";\)\)], "Input"], Cell[BoxData[ \(PC1[bits_?VectorQ] := Module[{len}, len = Length[bits]; If[64 != len, Message[PC1::"\", 64, len], bits[\([{57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4}]\)]]]\)], "Input"], Cell[BoxData[ \(PC1[k_Integer] := PC1[IntegerDigits[k, 2, 64]]\)], "Input"], Cell[BoxData[ \(\(PC2::"\" = "\";\)\)], "Input"], Cell[BoxData[ \(PC2[bits_?VectorQ] := Module[{len}, len = Length[bits]; If[56 != len, Message[PC2::"\", 56, len], bits[\([{14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32}]\)]]]\)], "Input"], Cell[BoxData[ \(PC2[k_Integer] := PC2[IntegerDigits[k, 2, 56]]\)], "Input"], Cell[BoxData[ \(\(KeyShift::"\" = "\";\)\)], "Input"], Cell[BoxData[ \(KeyShift[key_?VectorQ, round_Integer, opts___Rule] := Module[{left, right, len}, len = Length[key]; If[56 != len, Message[KeyShift::"\", 56, len]; Return[]]; left = Take[key, 28]; right = Take[key, \(-28\)]; If[MemberQ[{1, 2, 9, 16}, round], Join[RotateLeft[left], RotateLeft[right]], Join[RotateLeft[left, 2], RotateLeft[right, 2]]]]\)], "Input"], Cell[BoxData[ \(KeyShift[key_Integer, round_Integer] := KeyShift[IntegerDigits[key, 2, 56], round]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Initial Permutation", "Subsection"], Cell[BoxData[ \(\(IP::"\" = "\";\)\)], "Input"], Cell[BoxData[ \(\(IPInv::"\" = "\";\)\)], "Input"], Cell[BoxData[ \(IP[x_Integer] := IP[IntegerDigits[x, 2, 64]]\)], "Input"], Cell[BoxData[ \(IP[bits_?VectorQ] := Module[{len}, len = Length[bits]; If[64 != len, Message[IP::"\", 64, len], bits[\([{58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4, 62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8, 57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3, 61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7}]\)]]]\)], "Input"], Cell[BoxData[ \(IPInv[x_Integer] := IPInv[IntegerDigits[x, 2, 64]]\)], "Input"], Cell[BoxData[ \(IPInv[bits_?VectorQ] := Module[{len}, len = Length[bits]; If[64 != len, Message[IPInv::"\", 64, len], bits[\([{40, 8, 48, 16, 56, 24, 64, 32, 39, 7, 47, 15, 55, 23, 63, 31, 38, 6, 46, 14, 54, 22, 62, 30, 37, 5, 45, 13, 53, 21, 61, 29, 36, 4, 44, 12, 52, 20, 60, 28, 35, 3, 43, 11, 51, 19, 59, 27, 34, 2, 42, 10, 50, 18, 58, 26, 33, 1, 41, 9, 49, 17, 57, 25}]\)]]]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Rounds", "Subsection"], Cell[BoxData[ \(\(DESRound::"\" = "\";\)\)], "Input"], Cell[BoxData[ \(\(DESRound::"\" = "\";\)\)], "Input"], Cell[BoxData[ \(DESRound[bits_?VectorQ, key_?VectorQ] := Module[{len, left, right}, len = Length[bits]; If[64 != len, Message[DESRound::"\", 64, len]; Return[]]; len = Length[key]; If[48 != len, Message[DESRound::"\", 48, len]; Return[]]; left = Take[bits, 32]; right = Take[bits, \(-32\)]; Join[right, Mod[left + f[right, key], 2]]]\)], "Input"], Cell[BoxData[ \(DESRound[x_Integer, key_?VectorQ] := DESRound[IntegerDigits[x, 2, 64], key]\)], "Input"], Cell[BoxData[ \(DESRound[bits_?VectorQ, key_Integer] := DESRound[bits, IntegerDigits[key, 2, 48]]\)], "Input"], Cell[BoxData[ \(DESRound[x_Integer, key_Integer] := DESRound[IntegerDigits[x, 2, 64], IntegerDigits[key, 2, 48]]\)], "Input"], Cell[BoxData[ \(\(DESEncrypt::"\" = "\";\)\)], "Input"], Cell[BoxData[ \(\(DESEncrypt::"\" = "\";\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(Options[DESEncrypt] = {Verbose \[Rule] False, Base \[Rule] 16}\)], "Input"], Cell[BoxData[ \({Verbose \[Rule] False, Base \[Rule] 16}\)], "Output"] }, Open ]], Cell[BoxData[ \(DESEncrypt[plaintext_?VectorQ, key_?VectorQ, opts___Rule] := Module[{len, verbosity, pt, keyn, base}, len = Length[plaintext]; If[64 != len, Message[DESEncrypt::"\", 64, len]; Return[]]; len = Length[key]; If[64 != len, Message[DESEncrypt::"\", 64, len]; Return[]]; verbosity = \(Verbose /. {opts}\) /. Options[DESEncrypt]; base = \(Base /. {opts}\) /. Options[DESEncrypt]; pt = IP[plaintext]; keyn = PC1[key]; If[verbosity, Print["\", BaseForm[FromDigits[plaintext, 2], base], "\<, Initial Permutation: \>", BaseForm[FromDigits[pt, 2], base]]]; Do[keyn = KeyShift[keyn, j]; pt = DESRound[pt, PC2[keyn]]; If[verbosity, Print["\", j, "\<.\nkey = \>", BaseForm[FromDigits[PC2[keyn], 2], base], "\<, bit string = \>", BaseForm[FromDigits[pt, 2], base]]], {j, 1, 16, 1}]; pt = Join[Take[pt, \(-32\)], Take[pt, 32]]; IPInv[pt]]\)], "Input"], Cell[BoxData[ \(DESEncrypt[plaintext_Integer, key_?VectorQ, opts___Rule] := DESEncrypt[IntegerDigits[plaintext, 2, 64], key, opts]\)], "Input"], Cell[BoxData[ \(DESEncrypt[plaintext_?VectorQ, key_Integer, opts___Rule] := DESEncrypt[plaintext, IntegerDigits[key, 2, 64], opts]\)], "Input"], Cell[BoxData[ \(DESEncrypt[plaintext_Integer, key_Integer, opts___Rule] := DESEncrypt[IntegerDigits[plaintext, 2, 64], IntegerDigits[key, 2, 64], opts]\)], "Input"], Cell[BoxData[ \(\(DESDecrypt::"\" = "\";\)\)], "Input"], Cell[BoxData[ \(\(DESDecrypt::"\" = "\";\)\)], "Input"], Cell[BoxData[ \(DESDecrypt[ciphertext_?VectorQ, key_?VectorQ, opts___Rule] := Module[{len, verbosity, pt, keyc, keys, base}, len = Length[ciphertext]; If[64 != len, Message[DESDecrypt::"\", 64, len]; Return[]]; len = Length[key]; If[64 != len, Message[DESDecrypt::"\", 64, len]; Return[]]; verbosity = \(Verbose /. {opts}\) /. Options[DESEncrypt]; base = \(Base /. {opts}\) /. Options[DESEncrypt]; pt = IP[ciphertext]; keys = {}; keyc = PC1[key]; Do[keyc = KeyShift[keyc, j]; keys = Prepend[keys, PC2[keyc]], {j, 1, 16, 1}]; Do[pt = DESRound[pt, keys[\([j]\)]]; If[verbosity, Print["\", j, "\<.\nkey = \>", BaseForm[FromDigits[keys[\([j]\)], 2], base], "\<, bit string = \>", BaseForm[FromDigits[pt, 2], base]]], {j, 1, 16, 1}]; pt = Join[Take[pt, \(-32\)], Take[pt, 32]]; IPInv[pt]]\)], "Input"], Cell[BoxData[ \(DESDecrypt[plaintext_Integer, key_?VectorQ, opts___Rule] := DESDecrypt[IntegerDigits[plaintext, 2, 64], key, opts]\)], "Input"], Cell[BoxData[ \(DESDecrypt[plaintext_?VectorQ, key_Integer, opts___Rule] := DESDecrypt[plaintext, IntegerDigits[key, 2, 64], opts]\)], "Input"], Cell[BoxData[ \(DESDecrypt[plaintext_Integer, key_Integer, opts___Rule] := DESDecrypt[IntegerDigits[plaintext, 2, 64], IntegerDigits[key, 2, 64], opts]\)], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Example 1", "Section"], Cell[CellGroupData[{ Cell[BoxData[ \(k = 16^^0101010101010101\)], "Input"], Cell[BoxData[ \(72340172838076673\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(BaseForm[k, 16]\)], "Input"], Cell[BoxData[ TagBox[ InterpretationBox[\("101010101010101"\_"16"\), 72340172838076673, Editable->False], (BaseForm[ #, 16]&)]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(BaseForm[k, 2]\)], "Input"], Cell[BoxData[ TagBox[ InterpretationBox[\(\ "100000001000000010000000100000001000000010000000100000001"\_"2"\), 72340172838076673, Editable->False], (BaseForm[ #, 2]&)]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Module[{key}, key = PC1[k]; Do[key = KeyShift[key, j]; Print["\", j, "\<: \>", BaseForm[FromDigits[PC2[key], 2], 16]], {j, 1, 16, 1}]]\)], "Input"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "1", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 1, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "2", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 2, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "3", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 3, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "4", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 4, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "5", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 5, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "6", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 6, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "7", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 7, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "8", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 8, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "9", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 9, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "10", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 10, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "11", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 11, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "12", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 12, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "13", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 13, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "14", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 14, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "15", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 15, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "16", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("0"\_"16"\), 0, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 16, ": ", BaseForm[ 0, 16]], Editable->False]], "Print"] }, Open ]], Cell[BoxData[ \(Clear[k]\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Example 2", "Section"], Cell[CellGroupData[{ Cell[BoxData[ \(k = 16^^0123456789ABCDEF\)], "Input"], Cell[BoxData[ \(81985529216486895\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(BaseForm[k, 16]\)], "Input"], Cell[BoxData[ TagBox[ InterpretationBox[\("123456789abcdef"\_"16"\), 81985529216486895, Editable->False], (BaseForm[ #, 16]&)]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(BaseForm[k, 2]\)], "Input"], Cell[BoxData[ TagBox[ InterpretationBox[\(\ "100100011010001010110011110001001101010111100110111101111"\_"2"\), 81985529216486895, Editable->False], (BaseForm[ #, 2]&)]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Module[{key}, key = PC1[k]; Do[key = KeyShift[key, j]; Print["\", j, "\<: \>", BaseForm[FromDigits[PC2[key], 2], 16]], {j, 1, 16, 1}]]\)], "Input"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "1", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("b02679b49a5"\_"16"\), 12104956070309, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 1, ": ", BaseForm[ 12104956070309, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "2", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("69a659256a26"\_"16"\), 116163181111846, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 2, ": ", BaseForm[ 116163181111846, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "3", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("45d48ab428d2"\_"16"\), 76779162446034, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 3, ": ", BaseForm[ 76779162446034, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "4", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("7289d2a58257"\_"16"\), 125936270148183, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 4, ": ", BaseForm[ 125936270148183, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "5", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("3ce80317a6c2"\_"16"\), 66967181960898, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 5, ": ", BaseForm[ 66967181960898, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "6", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("23251e3c8545"\_"16"\), 38642328044869, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 6, ": ", BaseForm[ 38642328044869, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "7", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("6c04950ae4c6"\_"16"\), 118766936188102, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 7, ": ", BaseForm[ 118766936188102, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "8", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("5788386ce581"\_"16"\), 96242573829505, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 8, ": ", BaseForm[ 96242573829505, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "9", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("c0c9e926b839"\_"16"\), 211973432588345, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 9, ": ", BaseForm[ 211973432588345, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "10", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("91e307631d72"\_"16"\), 160404267539826, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 10, ": ", BaseForm[ 160404267539826, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "11", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("211f830d893a"\_"16"\), 36419226405178, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 11, ": ", BaseForm[ 36419226405178, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "12", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("7130e5455c54"\_"16"\), 124454818896980, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 12, ": ", BaseForm[ 124454818896980, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "13", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("91c4d04980fc"\_"16"\), 160274494095612, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 13, ": ", BaseForm[ 160274494095612, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "14", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("5443b681dc8d"\_"16"\), 92649801505933, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 14, ": ", BaseForm[ 92649801505933, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "15", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("b691050a16b5"\_"16"\), 200733971060405, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 15, ": ", BaseForm[ 200733971060405, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "16", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("ca3d03b87032"\_"16"\), 222363404234802, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 16, ": ", BaseForm[ 222363404234802, 16]], Editable->False]], "Print"] }, Open ]], Cell[BoxData[ \(Clear[k]\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Example 3", "Section"], Cell["\<\ What happens to the key schedule if we complement the input \ key?\ \>", "Text"], Cell[BoxData[ \(\(k = 16^^0123456789ABCDEF;\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(BaseForm[k, 2]\)], "Input"], Cell[BoxData[ TagBox[ InterpretationBox[\(\ "100100011010001010110011110001001101010111100110111101111"\_"2"\), 81985529216486895, Editable->False], (BaseForm[ #, 2]&)]], "Output"] }, Open ]], Cell[BoxData[ \(\(kc = FromDigits[1 - IntegerDigits[k, 2], 2];\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(BaseForm[kc, 2]\)], "Input"], Cell[BoxData[ TagBox[ InterpretationBox[\(\ "11011100101110101001100001110110010101000011001000010000"\_"2"\), 62129658859368976, Editable->False], (BaseForm[ #, 2]&)]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Module[{key, keyc}, key = PC1[k]; keyc = PC1[kc]; Do[key = KeyShift[key, j]; keyc = KeyShift[keyc, j]; Print["\", j, "\<: \>", BaseForm[FromDigits[PC2[key], 2], 16], \ "\<, \>", BaseForm[FromDigits[PC2[keyc], 2], 16]], {j, 1, 16, 1}]]\)], "Input"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "1", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("b02679b49a5"\_"16"\), 12104956070309, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("f4758860365a"\_"16"\), 268785636357722, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 1, ": ", BaseForm[ 12104956070309, 16], ", ", BaseForm[ 268785636357722, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "2", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("69a659256a26"\_"16"\), 116163181111846, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("1619a6da9541"\_"16"\), 24299429336385, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 2, ": ", BaseForm[ 116163181111846, 16], ", ", BaseForm[ 24299429336385, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "3", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("45d48ab428d2"\_"16"\), 76779162446034, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("ba28710ac72c"\_"16"\), 204682857989932, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 3, ": ", BaseForm[ 76779162446034, 16], ", ", BaseForm[ 204682857989932, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "4", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("7289d2a58257"\_"16"\), 125936270148183, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("8d662c587d80"\_"16"\), 155469970177408, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 4, ": ", BaseForm[ 125936270148183, 16], ", ", BaseForm[ 155469970177408, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "5", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("3ce80317a6c2"\_"16"\), 66967181960898, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("c2179ce84039"\_"16"\), 213406672502841, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 5, ": ", BaseForm[ 66967181960898, 16], ", ", BaseForm[ 213406672502841, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "6", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("23251e3c8545"\_"16"\), 38642328044869, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("5c9a61c37a0a"\_"16"\), 101818134919690, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 6, ": ", BaseForm[ 38642328044869, 16], ", ", BaseForm[ 101818134919690, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "7", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("6c04950ae4c6"\_"16"\), 118766936188102, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("83f86ab41338"\_"16"\), 145102965314360, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 7, ": ", BaseForm[ 118766936188102, 16], ", ", BaseForm[ 145102965314360, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "8", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("5788386ce581"\_"16"\), 96242573829505, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("a867c6911a66"\_"16"\), 185163666496102, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 8, ": ", BaseForm[ 96242573829505, 16], ", ", BaseForm[ 185163666496102, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "9", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("c0c9e926b839"\_"16"\), 211973432588345, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("3716164943c4"\_"16"\), 60568002708420, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 9, ": ", BaseForm[ 211973432588345, 16], ", ", BaseForm[ 60568002708420, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "10", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("91e307631d72"\_"16"\), 160404267539826, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("6e18e090e08d"\_"16"\), 121053125861517, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 10, ": ", BaseForm[ 160404267539826, 16], ", ", BaseForm[ 121053125861517, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "11", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("211f830d893a"\_"16"\), 36419226405178, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("9ae07ce21685"\_"16"\), 170288958543493, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 11, ": ", BaseForm[ 36419226405178, 16], ", ", BaseForm[ 170288958543493, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "12", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("7130e5455c54"\_"16"\), 124454818896980, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("8c471a9a23ab"\_"16"\), 154237016875947, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 12, ": ", BaseForm[ 124454818896980, 16], ", ", BaseForm[ 154237016875947, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "13", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("91c4d04980fc"\_"16"\), 160274494095612, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("661b2d365b01"\_"16"\), 112266908687105, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 13, ": ", BaseForm[ 160274494095612, 16], ", ", BaseForm[ 112266908687105, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "14", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("5443b681dc8d"\_"16"\), 92649801505933, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("8bb841522172"\_"16"\), 153623486144882, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 14, ": ", BaseForm[ 92649801505933, 16], ", ", BaseForm[ 153623486144882, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "15", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("b691050a16b5"\_"16"\), 200733971060405, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("96efae5a908"\_"16"\), 10372260407560, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 15, ": ", BaseForm[ 200733971060405, 16], ", ", BaseForm[ 10372260407560, 16]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Key \"\>", "\[InvisibleSpace]", "16", "\[InvisibleSpace]", "\<\": \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("ca3d03b87032"\_"16"\), 222363404234802, Editable->False], (BaseForm[ #, 16]&)], "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox[\("25c29c0786c9"\_"16"\), 41517771622089, Editable->False], (BaseForm[ #, 16]&)]}], SequenceForm[ "Key ", 16, ": ", BaseForm[ 222363404234802, 16], ", ", BaseForm[ 41517771622089, 16]], Editable->False]], "Print"] }, Open ]], Cell["\<\ Hence we see that if the input key is bitwise complemented then \ every key in the key schedule is also bitwise complemented.\ \>", "Text"] }, Open ]] }, Open ]] }, FrontEndVersion->"5.0 for X", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowSize->{520, 600}, WindowMargins->{{150, Automatic}, {Automatic, 52}} ] (******************************************************************* 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[1754, 51, 69, 1, 27, "Input"], Cell[CellGroupData[{ Cell[1848, 56, 33, 0, 96, "Title"], Cell[CellGroupData[{ Cell[1906, 60, 27, 0, 72, "Section"], Cell[CellGroupData[{ Cell[1958, 64, 27, 0, 38, "Subsection"], Cell[1988, 66, 181, 3, 75, "Input"], Cell[2172, 71, 91, 1, 43, "Input"], Cell[2266, 74, 425, 7, 123, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[2728, 86, 29, 0, 30, "Subsection"], Cell[2760, 88, 306, 4, 75, "Input"], Cell[3069, 94, 306, 4, 75, "Input"], Cell[3378, 100, 306, 4, 75, "Input"], Cell[3687, 106, 306, 4, 75, "Input"], Cell[3996, 112, 306, 4, 75, "Input"], Cell[4305, 118, 306, 4, 75, "Input"], Cell[4614, 124, 306, 4, 75, "Input"], Cell[4923, 130, 306, 4, 75, "Input"], Cell[5232, 136, 220, 4, 91, "Input"], Cell[5455, 142, 219, 4, 91, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[5711, 151, 27, 0, 30, "Subsection"], Cell[5741, 153, 165, 2, 75, "Input"], Cell[5909, 157, 77, 1, 27, "Input"], Cell[5989, 160, 335, 6, 107, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[6361, 171, 34, 0, 30, "Subsection"], Cell[6398, 173, 187, 3, 75, "Input"], Cell[6588, 178, 188, 3, 75, "Input"], Cell[6779, 183, 118, 2, 43, "Input"], Cell[6900, 187, 105, 2, 43, "Input"], Cell[7008, 191, 105, 2, 43, "Input"], Cell[7116, 195, 417, 7, 139, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[7570, 207, 34, 0, 30, "Subsection"], Cell[7607, 209, 142, 2, 59, "Input"], Cell[7752, 213, 452, 7, 139, "Input"], Cell[8207, 222, 79, 1, 27, "Input"], Cell[8289, 225, 142, 2, 59, "Input"], Cell[8434, 229, 419, 7, 123, "Input"], Cell[8856, 238, 79, 1, 27, "Input"], Cell[8938, 241, 152, 2, 59, "Input"], Cell[9093, 245, 435, 7, 139, "Input"], Cell[9531, 254, 122, 2, 43, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[9690, 261, 41, 0, 30, "Subsection"], Cell[9734, 263, 140, 2, 59, "Input"], Cell[9877, 267, 146, 2, 59, "Input"], Cell[10026, 271, 77, 1, 27, "Input"], Cell[10106, 274, 497, 8, 155, "Input"], Cell[10606, 284, 83, 1, 27, "Input"], Cell[10692, 287, 503, 8, 155, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[11232, 300, 28, 0, 30, "Subsection"], Cell[11263, 302, 166, 2, 59, "Input"], Cell[11432, 306, 152, 2, 59, "Input"], Cell[11587, 310, 426, 7, 139, "Input"], Cell[12016, 319, 115, 2, 43, "Input"], Cell[12134, 323, 121, 2, 43, "Input"], Cell[12258, 327, 136, 2, 59, "Input"], Cell[12397, 331, 156, 2, 59, "Input"], Cell[12556, 335, 193, 3, 75, "Input"], Cell[CellGroupData[{ Cell[12774, 342, 104, 2, 27, "Input"], Cell[12881, 346, 74, 1, 70, "Output"] }, Open ]], Cell[12970, 350, 1142, 21, 379, "Input"], Cell[14115, 373, 154, 2, 59, "Input"], Cell[14272, 377, 154, 2, 59, "Input"], Cell[14429, 381, 184, 3, 75, "Input"], Cell[14616, 386, 156, 2, 59, "Input"], Cell[14775, 390, 195, 3, 75, "Input"], Cell[14973, 395, 1041, 19, 331, "Input"], Cell[16017, 416, 154, 2, 59, "Input"], Cell[16174, 420, 154, 2, 59, "Input"], Cell[16331, 424, 184, 3, 75, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[16564, 433, 28, 0, 42, "Section"], Cell[CellGroupData[{ Cell[16617, 437, 57, 1, 27, "Input"], Cell[16677, 440, 51, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[16765, 446, 48, 1, 27, "Input"], Cell[16816, 449, 170, 5, 40, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[17023, 459, 47, 1, 27, "Input"], Cell[17073, 462, 212, 6, 56, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[17322, 473, 201, 4, 91, "Input"], Cell[17526, 479, 395, 11, 23, "Print"], Cell[17924, 492, 395, 11, 23, "Print"], Cell[18322, 505, 395, 11, 23, "Print"], Cell[18720, 518, 395, 11, 23, "Print"], Cell[19118, 531, 395, 11, 23, "Print"], Cell[19516, 544, 395, 11, 23, "Print"], Cell[19914, 557, 395, 11, 23, "Print"], Cell[20312, 570, 395, 11, 23, "Print"], Cell[20710, 583, 395, 11, 23, "Print"], Cell[21108, 596, 397, 11, 23, "Print"], Cell[21508, 609, 397, 11, 23, "Print"], Cell[21908, 622, 397, 11, 23, "Print"], Cell[22308, 635, 397, 11, 23, "Print"], Cell[22708, 648, 397, 11, 23, "Print"], Cell[23108, 661, 397, 11, 23, "Print"], Cell[23508, 674, 397, 11, 23, "Print"] }, Open ]], Cell[23920, 688, 41, 1, 27, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[23998, 694, 28, 0, 72, "Section"], Cell[CellGroupData[{ Cell[24051, 698, 57, 1, 27, "Input"], Cell[24111, 701, 51, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[24199, 707, 48, 1, 27, "Input"], Cell[24250, 710, 170, 5, 40, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[24457, 720, 47, 1, 27, "Input"], Cell[24507, 723, 212, 6, 56, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[24756, 734, 201, 4, 91, "Input"], Cell[24960, 740, 431, 11, 23, "Print"], Cell[25394, 753, 434, 11, 23, "Print"], Cell[25831, 766, 432, 11, 23, "Print"], Cell[26266, 779, 434, 11, 23, "Print"], Cell[26703, 792, 432, 11, 23, "Print"], Cell[27138, 805, 432, 11, 23, "Print"], Cell[27573, 818, 434, 11, 23, "Print"], Cell[28010, 831, 432, 11, 23, "Print"], Cell[28445, 844, 434, 11, 23, "Print"], Cell[28882, 857, 436, 11, 23, "Print"], Cell[29321, 870, 434, 11, 23, "Print"], Cell[29758, 883, 436, 11, 23, "Print"], Cell[30197, 896, 436, 11, 23, "Print"], Cell[30636, 909, 434, 11, 23, "Print"], Cell[31073, 922, 436, 11, 23, "Print"], Cell[31512, 935, 436, 11, 23, "Print"] }, Open ]], Cell[31963, 949, 41, 1, 27, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[32041, 955, 28, 0, 72, "Section"], Cell[32072, 957, 90, 3, 32, "Text"], Cell[32165, 962, 62, 1, 27, "Input"], Cell[CellGroupData[{ Cell[32252, 967, 47, 1, 27, "Input"], Cell[32302, 970, 212, 6, 56, "Output"] }, Open ]], Cell[32529, 979, 81, 1, 27, "Input"], Cell[CellGroupData[{ Cell[32635, 984, 48, 1, 27, "Input"], Cell[32686, 987, 211, 6, 56, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[32934, 998, 312, 5, 107, "Input"], Cell[33249, 1005, 705, 18, 23, "Print"], Cell[33957, 1025, 706, 18, 23, "Print"], Cell[34666, 1045, 706, 18, 23, "Print"], Cell[35375, 1065, 708, 18, 23, "Print"], Cell[36086, 1085, 706, 18, 23, "Print"], Cell[36795, 1105, 706, 18, 23, "Print"], Cell[37504, 1125, 708, 18, 23, "Print"], Cell[38215, 1145, 706, 18, 23, "Print"], Cell[38924, 1165, 706, 18, 23, "Print"], Cell[39633, 1185, 710, 18, 23, "Print"], Cell[40346, 1205, 708, 18, 23, "Print"], Cell[41057, 1225, 710, 18, 23, "Print"], Cell[41770, 1245, 710, 18, 23, "Print"], Cell[42483, 1265, 708, 18, 23, "Print"], Cell[43194, 1285, 707, 18, 23, "Print"], Cell[43904, 1305, 708, 18, 23, "Print"] }, Open ]], Cell[44627, 1326, 149, 3, 50, "Text"] }, Open ]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)