passphera-core 0.3.4__tar.gz → 0.4.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {passphera-core-0.3.4 → passphera-core-0.4.0}/PKG-INFO +2 -2
- {passphera-core-0.3.4 → passphera-core-0.4.0}/README.md +1 -1
- passphera-core-0.4.0/passphera_core/__init__.py +2 -0
- {passphera-core-0.3.4 → passphera-core-0.4.0}/passphera_core/exceptions.py +1 -1
- {passphera-core-0.3.4 → passphera-core-0.4.0}/passphera_core/generator.py +13 -35
- {passphera-core-0.3.4 → passphera-core-0.4.0}/passphera_core.egg-info/PKG-INFO +2 -2
- {passphera-core-0.3.4 → passphera-core-0.4.0}/setup.py +1 -1
- passphera-core-0.3.4/passphera_core/__init__.py +0 -2
- {passphera-core-0.3.4 → passphera-core-0.4.0}/passphera_core.egg-info/SOURCES.txt +0 -0
- {passphera-core-0.3.4 → passphera-core-0.4.0}/passphera_core.egg-info/dependency_links.txt +0 -0
- {passphera-core-0.3.4 → passphera-core-0.4.0}/passphera_core.egg-info/top_level.txt +0 -0
- {passphera-core-0.3.4 → passphera-core-0.4.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: passphera-core
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.4.0
|
4
4
|
Summary: The core system of passphera project
|
5
5
|
Home-page: https://github.com/passphera/core
|
6
6
|
Author: Fathi Abdelmalek
|
@@ -14,6 +14,6 @@ Classifier: Topic :: Security
|
|
14
14
|
Classifier: Topic :: Security :: Cryptography
|
15
15
|
Description-Content-Type: text/markdown
|
16
16
|
|
17
|
-
# passphera-
|
17
|
+
# passphera-core
|
18
18
|
|
19
19
|
The core system of passphera project
|
@@ -12,24 +12,21 @@ class PasswordGenerator:
|
|
12
12
|
text: str = None,
|
13
13
|
shift: int = 3,
|
14
14
|
multiplier: int = 3,
|
15
|
-
|
16
|
-
|
17
|
-
algorithm: str = 'playfair'
|
15
|
+
key: str = "hill",
|
16
|
+
algorithm: str = 'hill'
|
18
17
|
):
|
19
18
|
"""
|
20
19
|
:param text: plain text to be ciphered
|
21
20
|
:param shift: number of characters to shift each character (default 3)
|
22
21
|
:param multiplier: number of characters to shift each character (default 3)
|
23
|
-
:param
|
24
|
-
:param key_iter: cipher key matrix (default (9, 4, 5, 7))
|
22
|
+
:param key: cipher key string (default "secret")
|
25
23
|
:param algorithm: main cipher algorithm name (default 'playfair')
|
26
24
|
"""
|
27
25
|
self._chars_replacements: dict = {}
|
28
26
|
self._text: str = text
|
29
27
|
self._shift: int = shift
|
30
28
|
self._multiplier: int = multiplier
|
31
|
-
self.
|
32
|
-
self._key_iter: iter = key_iter
|
29
|
+
self._key: str = key
|
33
30
|
self._algorithm_name: str = algorithm.lower()
|
34
31
|
self._algorithm = self._set_algorithm()
|
35
32
|
if text:
|
@@ -96,42 +93,23 @@ class PasswordGenerator:
|
|
96
93
|
self._multiplier = multiplier
|
97
94
|
|
98
95
|
@property
|
99
|
-
def
|
96
|
+
def key(self) -> str:
|
100
97
|
"""
|
101
98
|
Returns the key string for the cipher algorithm
|
102
99
|
Eg: ```key_str = pg.key_str```
|
103
100
|
:return: str: The key string for the cipher algorithm
|
104
101
|
"""
|
105
|
-
return self.
|
102
|
+
return self._key
|
106
103
|
|
107
|
-
@
|
108
|
-
def
|
104
|
+
@key.setter
|
105
|
+
def key(self, key: str) -> None:
|
109
106
|
"""
|
110
107
|
Sets the key string for the cipher algorithm
|
111
|
-
Eg: ```pg.
|
112
|
-
:param
|
108
|
+
Eg: ```pg.key = 'secret key'```
|
109
|
+
:param key: The key string for the cipher algorithm
|
113
110
|
:return:
|
114
111
|
"""
|
115
|
-
self.
|
116
|
-
|
117
|
-
@property
|
118
|
-
def key_iter(self) -> iter:
|
119
|
-
"""
|
120
|
-
Returns the key matrix for the cipher algorithm
|
121
|
-
Eg: ```key_iter = pg.key_iter```
|
122
|
-
:return: iter: The key matrix for the cipher algorithm
|
123
|
-
"""
|
124
|
-
return self._key_iter
|
125
|
-
|
126
|
-
@key_iter.setter
|
127
|
-
def key_iter(self, key_iter: iter) -> None:
|
128
|
-
"""
|
129
|
-
Sets the key matrix for the cipher algorithm
|
130
|
-
Eg: ```pg.key_iter = (9, 5, 2, 4)```
|
131
|
-
:param key_iter: The key matrix for the cipher algorithm
|
132
|
-
:return:
|
133
|
-
"""
|
134
|
-
self._key_iter = key_iter
|
112
|
+
self._key = key
|
135
113
|
|
136
114
|
@property
|
137
115
|
def algorithm(self) -> str:
|
@@ -173,9 +151,9 @@ class PasswordGenerator:
|
|
173
151
|
case 'affine':
|
174
152
|
return AffineCipher(self._multiplier, self._shift)
|
175
153
|
case 'playfair':
|
176
|
-
return PlayfairCipher(self.
|
154
|
+
return PlayfairCipher(self._key)
|
177
155
|
case 'hill':
|
178
|
-
return HillCipher(self.
|
156
|
+
return HillCipher(self._key)
|
179
157
|
case _:
|
180
158
|
raise InvalidAlgorithmException(self._algorithm_name)
|
181
159
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: passphera-core
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.4.0
|
4
4
|
Summary: The core system of passphera project
|
5
5
|
Home-page: https://github.com/passphera/core
|
6
6
|
Author: Fathi Abdelmalek
|
@@ -14,6 +14,6 @@ Classifier: Topic :: Security
|
|
14
14
|
Classifier: Topic :: Security :: Cryptography
|
15
15
|
Description-Content-Type: text/markdown
|
16
16
|
|
17
|
-
# passphera-
|
17
|
+
# passphera-core
|
18
18
|
|
19
19
|
The core system of passphera project
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|