def mobinfosec(): os.system('clear') print("Alice-Bob notation of MobInfoSec") print("1. SP.A\t->\tMU.A\t:\tTsp.a, SP.A") print("2. MU.A\t->\tMU.B\t:\tTsp.a, SP.A") print("3. MU.B\t->\tSP.B\t:\tTsp.a, SP.A") print( "4. SP.B\t->\tMU.B\t:\t{{Tsp.a, -Ksp.a, h(Tsp.b,Tsp.a,SP.A)}-Ksp.b}+Ksp.a" ) print( "5. MU.B\t->\tMU.A\t:\t{{Tsp.a, -Ksp.a, h(Tsp.b,Tsp.a,SP.A)}-Ksp.b}+Ksp.a" ) print( "6. MU.A\t->\tSP.A\t:\t{{Tsp.a, -Ksp.a, h(Tsp.b,Tsp.a,SP.A)}-Ksp.b}+Ksp.a" ) print() print("Versions of an attack") print("1) Man in the Middle 1") print("2) Man in the Middle 2") print("3) Man in the Middle 3") print("4) Man in the Middle 4") manInTheMiddleVersion = checkInts(1, 4) D1, D2, D3 = check3Delays() L1, L2, L3, L4 = check4Lifetimes() print("All the parameters have been chosen!") print("Press ENTER to verify") input() os.system('clear') return manInTheMiddleVersion, D1, D2, D3, L1, L2, L3, L4
def wooLamPi3(): os.system('clear') print("Alice-Bob notation of Timed version of Woo and Lam Pi 3 Protocol") print("1. A\t->\tB\t:\tA") print("2. B\t->\tA\t:\tTb") print("3. A\t->\tB\t:\t{A, Tb}Kas") print("4. B\t->\tS\t:\t{A, {Tb}Kas}Kbs") print("5. S\t->\tB\t:\t{A, Tb}Kbs") print() print("Versions of an attack") print("1) Man in the Middle 1") print("2) Man in the Middle 2") manInTheMiddleVersion = checkInts(1, 2) if manInTheMiddleVersion == 1: print("Man in the Middle 1") print("An attack exists if:") print("L1 >= D2 + 2 * D3 + 1") print("L2 >= 0") elif manInTheMiddleVersion == 2: print("Man in the Middle 2") print("An attack exists if:") print("L1 >= 0") print("L2 >= D2 + 2 * D3 + 1") D1, D2, D3 = check3Delays() L1, L2 = check2Lifetimes() print("All the parameters have been chosen!") print("Press ENTER to verify") input() os.system('clear') return manInTheMiddleVersion, D1, D2, D3, L1, L2
def nspktLowe(): os.system('clear') print( "Alice-Bob notation Timed version of the Lowe's modification of Needham Schroeder Public Key Protocol" ) print("1. A\t->\tB\t:\t{Ta ,A}Kb") print("2. B\t->\tA\t:\t{Ta, Tb, B}Ka") print("3. A\t->\tB\t:\t{Tb}Kb") print() print("Versions of an attack") print("1) Man in the Middle 1") print("2) Man in the Middle 2") manInTheMiddleVersion = checkInts(1, 2) if manInTheMiddleVersion == 1: print("Man in the Middle 1") print("An attack exists if:") print("L1 >= 3 * D2 + 1") print("L2 >= D1 + 2 * D2 + 1") elif manInTheMiddleVersion == 2: print("Man in the Middle 2") print("An attack exists if:") print("L1 >= D1 + 2 * D2 + 1") print("L2 >= 3 * D2 + 1") D1, D2, D3 = check3Delays() L1, L2 = check2Lifetimes() print("All the parameters have been chosen!") print("Press ENTER to verify") input() os.system('clear') return manInTheMiddleVersion, D1, D2, D3, L1, L2
def andrewLowe(): os.system('clear') print("Alice-Bob notation of Andrew Protocol") print("1. A\t->\tB\t:\tA, {Ta}Kab") print("2. B\t->\tA\t:\t{Ta, Tb}Kab") print("3. A\t->\tB\t:\t{Tb}Kab") print("4. B\t->\tA\t:\t{K'ab, T'b, Ta}Kab") print() print("Versions of an attack") print("1) Man in the Middle 1") print("2) Man in the Middle 2") manInTheMiddleVersion = checkInts(1, 2) if manInTheMiddleVersion == 1: print("Man in the Middle 1") print("An attack exists if:") print("For D2 <= D3:") print("L1 >= D2 + D3 + 1") print("L2 >= D2 + D3 + 1") print() print("For D2 > D3:") print("L1 >= 2 * D2 + 1") print("L2 >= D2 + D3 + 1") elif manInTheMiddleVersion == 2: print("Man in the Middle 2") print("An attack exists if:") print("For D2 <= D3:") print("L1 >= D2 + D3 + 1") print("L2 >= D2 + D3 + 1") print() print("For D2 > D3:") print("L1 >= D2 + D3 + 1") print("L2 >= 2 * D2 + 1") D1, D2, D3 = check3Delays() L1, L2 = check2Lifetimes() print("All the parameters have been chosen!") print("Press ENTER to verify") input() os.system('clear') return manInTheMiddleVersion, D1, D2, D3, L1, L2
def wmftLowe(): os.system('clear') print( "Alice-Bob notation of Timed version of Lowe's modification of Wide Mouth Frog Protocol" ) print("1. A\t->\tS\t:\tA, {Ta, B, Kab}Kas") print("2. S\t->\tB\t:\t{Ts, A, Kab}Kbs") print("3. B\t->\tA\t:\t{Tb}Kab") print("2. A\t->\tB\t:\t{Tb}Kab") print() print("An attack does not exist") print("Versions of an attack") print("1) Man in the Middle 1") print("2) Man in the Middle 2") manInTheMiddleVersion = checkInts(1, 2) D1, D2, D3 = check3Delays() L1, L2, L3 = check3Lifetimes() print("All the parameters have been chosen!") print("Press ENTER to verify") input() os.system('clear') return manInTheMiddleVersion, D1, D2, D3, L1, L2, L3