passphera-core 0.6.0__py3-none-any.whl → 0.8.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
@@ -0,0 +1,7 @@
1
+ passphera_core/__init__.py,sha256=ND2D_sTQk5mroNRsKm03PXhx0HNf0740hOtZ4_U98OQ,119
2
+ passphera_core/exceptions.py,sha256=PPZhy05QMVnN3mm6EGj-RgWanMaF3E6aKN4lcpNOJY8,158
3
+ passphera_core/generator.py,sha256=-lUrZLrNv1cqGBXzP5iQSixZ1WPIEiTCmVk_bpIi0Ow,6640
4
+ passphera_core-0.8.0.dist-info/METADATA,sha256=xD1N4F88-CJI1dScEVxotEezn7sW52yabghbAuXts8c,629
5
+ passphera_core-0.8.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
+ passphera_core-0.8.0.dist-info/top_level.txt,sha256=aDUX2iWGOyfzyf6XakLWTbgeWqNrypMHO074Qratyds,15
7
+ passphera_core-0.8.0.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- passphera_core/__init__.py,sha256=ND2D_sTQk5mroNRsKm03PXhx0HNf0740hOtZ4_U98OQ,119
2
- passphera_core/exceptions.py,sha256=PPZhy05QMVnN3mm6EGj-RgWanMaF3E6aKN4lcpNOJY8,158
3
- passphera_core/generator.py,sha256=s0Uc4S3SCT97xwQ0Gcw4hogGFIzTG5W0QX6Hs01iXII,6478
4
- passphera_core-0.6.0.dist-info/METADATA,sha256=e_eLSaPhPv2kwOHyPQOyLS7RADfmTQ5ni-VBLpoJ1sU,628
5
- passphera_core-0.6.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
- passphera_core-0.6.0.dist-info/top_level.txt,sha256=aDUX2iWGOyfzyf6XakLWTbgeWqNrypMHO074Qratyds,15
7
- passphera_core-0.6.0.dist-info/RECORD,,