|
|
|
#!/usr/bin/python3.4
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
# Copyright © 2015 Matthieu DUVAL, Rudy DUCHE
|
|
|
|
|
|
|
|
# This file is part of RizzleHash.
|
|
|
|
|
|
|
|
# RizzleHash is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
# RizzleHash is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with RizzleHash. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
|
|
|
|
from enum import Enum
|
|
|
|
|
|
|
|
|
|
|
|
class APPLICATION_CONSTANTS():
|
|
|
|
NAME = "RizzleHash"
|
|
|
|
VERSION = "0.7 - rc1"
|
|
|
|
YEAR = "2015"
|
|
|
|
AUTHORS = "Matthieu DUVAL, Rudy DUCHE"
|
|
|
|
|
|
|
|
class LAN_CONSTANTS():
|
|
|
|
class MESSAGE_KEY(Enum):
|
|
|
|
NB_CORE_CLIENT = "nbCoreClient" #peramètre passé dans la requette doit etre suivit du nombre de coeur aloué pour le calcul
|
|
|
|
NB_CORE_TOTAL = "nbCoreTotal"
|
|
|
|
INDEX_CORE_MIN = "indexCoreMin"
|
|
|
|
CRYPTED_PASSWORD = "cryptedPassword"
|
|
|
|
ENCRYPTION_KEY = "encryptionKey"
|
|
|
|
HASH_METHOD = "hashMethode"
|
|
|
|
PASSWORD_MAX_LENGTH = "passwordMaxLength"
|
|
|
|
MESSAGE_TYPE = "type"
|
|
|
|
RETURN_STATE = "returnState"
|
|
|
|
NB_WORDS = "nbWords"
|
|
|
|
PROCESS_TIME = "processTime"
|
|
|
|
WORD = "word"
|
|
|
|
LOCAL_THREAD_NAME = "threadName"
|
|
|
|
|
|
|
|
class MESSAGE_VALUE(Enum) :
|
|
|
|
TYPE_INFO = "info"
|
|
|
|
TYPE_CONFIG = "config"
|
|
|
|
TYPE_ERROR = "error"
|
|
|
|
TYPE_RESULT = "result"
|
|
|
|
TYPE_DEFAULT = "default"
|
|
|
|
STATE_OK = "OK"
|
|
|
|
STATE_KO = "KO"
|
|
|
|
|
|
|
|
class MESSAGE_SPECIAL_CHAR(Enum) :
|
|
|
|
SEPARATOR = ','
|
|
|
|
ASIGNATOR = ':'
|
|
|
|
SAME_VALUE_SEPRATOR = ';'
|
|
|
|
|
|
|
|
class PROCESS_CONSTANTS():
|
|
|
|
class MESSAGE_RETURN_TYPE(Enum):
|
|
|
|
PERFS = 1
|
|
|
|
RETURN = 0
|
|
|
|
|
|
|
|
class PARAMS_CONSTANTS():
|
|
|
|
class LONG_PARAMS(Enum):
|
|
|
|
VERBOSE = "--verbose"
|
|
|
|
HELP = "--help"
|
|
|
|
MODE = "--mode"
|
|
|
|
HASH = "--hash"
|
|
|
|
ENCRYPTION_KEY = "--key"
|
|
|
|
PORT = "--port"
|
|
|
|
SERVER_IP = "--ip"
|
|
|
|
ROLE = "--role"
|
|
|
|
SECRET_PARAM = "--cd"
|
|
|
|
CORE = "--core"
|
|
|
|
MAX_LENGTH = "--length"
|
|
|
|
|
|
|
|
class SHORT_PARAMS(Enum):
|
|
|
|
VERBOSE = "-v"
|
|
|
|
HELP = "-h"
|
|
|
|
MODE = "-m"
|
|
|
|
ENCRYPTION_KEY = "-k"
|
|
|
|
PORT = "-p"
|
|
|
|
SERVER_IP = "-s"
|
|
|
|
ROLE = "-r"
|
|
|
|
CORE = "-c"
|
|
|
|
MAX_LENGTH = "-l"
|
|
|
|
|
|
|
|
class PARAMS_VALUE(Enum):
|
|
|
|
MODE_LOCAL = "local"
|
|
|
|
MODE_LAN = "lan"
|
|
|
|
ROLE_CLIENT = "client"
|
|
|
|
ROLE_SERVER = "server"
|
|
|
|
|
|
|
|
class ANSWER_STATES():
|
|
|
|
class MESSAGE_STATE(Enum):
|
|
|
|
STATE_OK = "OK"
|
|
|
|
STATE_KO = "KO"
|
|
|
|
|
|
|
|
class HASH_METHODS():
|
|
|
|
class HASH_METHOD(Enum):
|
|
|
|
HASH_MD5 = "md5"
|
|
|
|
HASH_SHA1 = "sha1"
|
|
|
|
HASH_SHA224 = "sha224"
|
|
|
|
HASH_SHA256 = "sha256"
|
|
|
|
HASH_SHA384 = "sha384"
|
|
|
|
HASH_SHA512 = "sha512"
|
|
|
|
HASH_NONE = "None"
|