From dca93292671fcb6279bfeb89915d5b5cba10c48d Mon Sep 17 00:00:00 2001 From: Nemunaire Date: Sun, 1 Feb 2015 22:12:04 +0100 Subject: [PATCH] New function to get weakness level of cipher --- eyespot/ciphers.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/eyespot/ciphers.py b/eyespot/ciphers.py index 34c592e..709f00e 100644 --- a/eyespot/ciphers.py +++ b/eyespot/ciphers.py @@ -48,3 +48,17 @@ def test(host, cipher): except ConnectionResetError: pass return False + + +def weakness_level(cipher): + wl = [ + "aNULL:eNULL", + "EXPORT", + "LOW", + "MEDIUM", + "HIGH" + ] + for i in range(len(wl)): + if cipher in get(wl[i]): + return i + 1 + return 0