passphera-core 0.6.0__tar.gz → 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: passphera-core
3
- Version: 0.6.0
3
+ Version: 0.8.0
4
4
  Summary: The core system of passphera project
5
5
  Home-page: https://github.com/passphera/core
6
6
  Author: Fathi Abdelmalek
7
7
  Author-email: abdelmalek.fathi.2001@gmail.com
8
- Classifier: Development Status :: 1 - Planning
8
+ Classifier: Development Status :: 2 - Pre-Alpha
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Classifier: Programming Language :: Python
@@ -13,6 +13,8 @@ class PasswordGenerator:
13
13
  multiplier: int = 3,
14
14
  key: str = "hill",
15
15
  algorithm: str = 'hill',
16
+ prefix: str = 'secret',
17
+ postfix: str = 'secret',
16
18
  characters_replacements: dict = None,
17
19
  ):
18
20
  """
@@ -30,6 +32,8 @@ class PasswordGenerator:
30
32
  self._key: str = key
31
33
  self._algorithm_name: str = algorithm.lower()
32
34
  self._algorithm = self._set_algorithm()
35
+ self._prefix: str = prefix
36
+ self._postfix: str = postfix
33
37
  self._characters_replacements: dict = characters_replacements
34
38
 
35
39
  @property
@@ -127,7 +131,7 @@ class PasswordGenerator:
127
131
  case 'caesar':
128
132
  return CaesarCipher(self._shift)
129
133
  case 'affine':
130
- return AffineCipher(self._multiplier, self._shift)
134
+ return AffineCipher(self._shift, self._multiplier)
131
135
  case 'playfair':
132
136
  return PlayfairCipher(self._key)
133
137
  case 'hill':
@@ -166,7 +170,7 @@ class PasswordGenerator:
166
170
  :return: str: The generated raw password
167
171
  """
168
172
  self._update_algorithm_properties()
169
- return self._algorithm.encrypt(f"secret{text}secret")
173
+ return self._algorithm.encrypt(f"{self._prefix}{text}{self._postfix}")
170
174
 
171
175
  def generate_password(self, text: str) -> str:
172
176
  """
@@ -178,9 +182,9 @@ class PasswordGenerator:
178
182
  password = self.generate_raw_password(text)
179
183
  self._algorithm_name = old_algorithm
180
184
  password = self.generate_raw_password(password)
185
+ for char, replacement in self._characters_replacements.items():
186
+ password = password.replace(char, replacement)
181
187
  for char in password:
182
188
  if char in text:
183
189
  password = password.replace(char, char.upper())
184
- for char, replacement in self._characters_replacements.items():
185
- password = password.replace(char, replacement)
186
190
  return password
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: passphera-core
3
- Version: 0.6.0
3
+ Version: 0.8.0
4
4
  Summary: The core system of passphera project
5
5
  Home-page: https://github.com/passphera/core
6
6
  Author: Fathi Abdelmalek
7
7
  Author-email: abdelmalek.fathi.2001@gmail.com
8
- Classifier: Development Status :: 1 - Planning
8
+ Classifier: Development Status :: 2 - Pre-Alpha
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Classifier: Programming Language :: Python
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setup(
7
7
  name='passphera-core',
8
- version='0.6.0',
8
+ version='0.8.0',
9
9
  author='Fathi Abdelmalek',
10
10
  author_email='abdelmalek.fathi.2001@gmail.com',
11
11
  url='https://github.com/passphera/core',
@@ -14,7 +14,7 @@ setup(
14
14
  long_description_content_type="text/markdown",
15
15
  packages=['passphera_core'],
16
16
  classifiers=[
17
- "Development Status :: 1 - Planning",
17
+ "Development Status :: 2 - Pre-Alpha",
18
18
  "License :: OSI Approved :: MIT License",
19
19
  "Operating System :: OS Independent",
20
20
  "Programming Language :: Python",
File without changes
File without changes