-
Notifications
You must be signed in to change notification settings - Fork 0
/
magic_const.py
82 lines (65 loc) · 2.21 KB
/
magic_const.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# encoding: utf-8
from enum import Enum
import logging
LOGGING_CONFIG = {'level': logging.INFO,
'format': '%(asctime)s -- %(name)s \t %(levelname)s \t %(message)s',
'filename': "logs.log",
"filemode": "a",
'datefmt': '%Y/%m/%d %H:%M:%S'
}
APP_ID = 'f82dd3ae4b2946a6a58b5bcca099bdc0'
APP_SECRET = '71a0be967089402a817b372a857de2ca'
DATETIME_FORMAT = "%Y-%m-%d, %H:%M:%S"
YADISK_PREFIX = "disk:/"
LOCAL_FILE_SYSTEM_NAME = "Local file system"
class KeyType(Enum):
"""
Enumaration class with encryption key types
"""
new_symbols = "New key as symbols"
new_binary = "New key for binary file"
new_media = "New key for media"
existing_symbols = "Existing symbols"
existing_binary = "Existing binary file"
existing_media = "Existing media"
LOCAL_FILE_SYSTEM_LABELS = {
"message_label": '''Choose encryption mode for uploading your file to the cloud:''',
"algorithm_label": "Encryption algorithm:",
"key_type_label": "Encryption key:",
"load_button": "Upload file",
"key_type": [KeyType.new_symbols, KeyType.new_binary, KeyType.new_media,
KeyType.existing_symbols, KeyType.existing_binary, KeyType.existing_media]
}
YADISK_FILE_SYSTEM_LABELS = {
"message_label": '''Choose decryption mode for downloading the file from the cloud''',
"algorithm_label": "Decryption algorithm:",
"key_type_label": "Dencryption key:",
"load_button": "Download file",
"key_type": [KeyType.existing_symbols, KeyType.existing_binary, KeyType.existing_media]
}
class SecurityAlgorithm(Enum):
"""
Enumaration class with encryption algorithms
"""
none = "None"
aes = "AES"
camellia = "Camellia"
chacha20 = "ChaCha20"
triple_des = "Triple DES"
cast5 = "CAST5"
seed = "SEED"
KEY_LENGTH = {
SecurityAlgorithm.aes: 32,
SecurityAlgorithm.camellia: 32,
SecurityAlgorithm.chacha20: 32,
SecurityAlgorithm.triple_des: 24,
SecurityAlgorithm.cast5: 16,
SecurityAlgorithm.seed: 16
}
class MediaType(Enum):
"""
Enumeration for media type
"""
f5steganography = "f5-steganography"
fractals = "fractals"
dct = "DCT"