puantum 1.0.0.0__cp312-cp312-win_amd64.whl

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.
@@ -0,0 +1,363 @@
1
+ # IMPORT
2
+ import typing as _typing
3
+ import enum as _enum
4
+
5
+ # MAIN
6
+ class Algorithm:
7
+ class BIKE(_enum.Enum):
8
+ BIKEL1 = ...
9
+ BIKEL3 = ...
10
+ BIKEL5 = ...
11
+ #
12
+ class CLASSICMCELIECE(_enum.Enum):
13
+ CLASSICMCELIECE348864 = ...
14
+ CLASSICMCELIECE348864F = ...
15
+ CLASSICMCELIECE460896 = ...
16
+ CLASSICMCELIECE460896F = ...
17
+ CLASSICMCELIECE6688128 = ...
18
+ CLASSICMCELIECE6688128F = ...
19
+ CLASSICMCELIECE6960119 = ...
20
+ CLASSICMCELIECE6960119F = ...
21
+ CLASSICMCELIECE8192128 = ...
22
+ CLASSICMCELIECE8192128F = ...
23
+ #
24
+ class HQC(_enum.Enum):
25
+ HQC128 = ...
26
+ HQC192 = ...
27
+ HQC256 = ...
28
+ #
29
+ class KYBER(_enum.Enum):
30
+ KYBER512 = ...
31
+ KYBER768 = ...
32
+ KYBER1024 = ...
33
+ #
34
+ class MLKEM(_enum.Enum):
35
+ MLKEM512 = ...
36
+ MLKEM768 = ...
37
+ MLKEM1024 = ...
38
+ #
39
+ class NTRUPRIME(_enum.Enum):
40
+ NTRUPRIME = ...
41
+ #
42
+ class FRODOKEM(_enum.Enum):
43
+ FRODOKEM640AES = ...
44
+ FRODOKEM640SHAKE = ...
45
+ FRODOKEM976AES = ...
46
+ FRODOKEM976SHAKE = ...
47
+ FRODOKEM1344AES = ...
48
+ FRODOKEM1344SHAKE = ...
49
+
50
+
51
+
52
+ class PublicKey:
53
+ def __init__(self, publickey: bytes) -> None:
54
+ ...
55
+ #
56
+ def encapsulate(self) -> tuple[_typing.Any, _typing.Any]:
57
+ ...
58
+
59
+
60
+
61
+ class BIKEPublicKey(PublicKey):
62
+ def __init__(self, name: Algorithm.BIKE, publickey: bytes) -> None:
63
+ ...
64
+ #
65
+ def encapsulate(self) -> tuple[bytes, bytes]:
66
+ ...
67
+
68
+
69
+
70
+ class CLASSICMCELIECEPublicKey(PublicKey):
71
+ def __init__(self, name: Algorithm.CLASSICMCELIECE, publickey: bytes) -> None:
72
+ ...
73
+ #
74
+ def encapsulate(self) -> tuple[bytes, bytes]:
75
+ ...
76
+
77
+
78
+
79
+ class HQCPublicKey(PublicKey):
80
+ def __init__(self, name: Algorithm.HQC, publickey: bytes) -> None:
81
+ ...
82
+ #
83
+ def encapsulate(self) -> tuple[bytes, bytes]:
84
+ ...
85
+
86
+
87
+
88
+ class KYBERPublicKey(PublicKey):
89
+ def __init__(self, name: Algorithm.KYBER, publickey: bytes) -> None:
90
+ ...
91
+ #
92
+ def encapsulate(self) -> tuple[bytes, bytes]:
93
+ ...
94
+
95
+
96
+
97
+ class MLKEMPublicKey(PublicKey):
98
+ def __init__(self, name: Algorithm.MLKEM, publickey: bytes) -> None:
99
+ ...
100
+
101
+ def encapsulate(self) -> tuple[bytes, bytes]:
102
+ ...
103
+
104
+
105
+
106
+ class NTRUPRIMEPublicKey(PublicKey):
107
+ def __init__(self, name: Algorithm.NTRUPRIME, publickey: bytes) -> None:
108
+ ...
109
+ #
110
+ def encapsulate(self) -> tuple[bytes, bytes]:
111
+ ...
112
+
113
+
114
+
115
+ class FRODOKEMPublicKey(PublicKey):
116
+ def __init__(self, name: Algorithm.FRODOKEM, publickey: bytes) -> None:
117
+ ...
118
+ #
119
+ def encapsulate(self) -> tuple[bytes, bytes]:
120
+ ...
121
+
122
+
123
+
124
+ class SecretKey:
125
+ def __init__(self, secretkey: bytes) -> None:
126
+ ...
127
+ #
128
+ def decapsulate(self, ciphertext: _typing.Any) -> _typing.Any:
129
+ ...
130
+
131
+
132
+
133
+ class BIKESecretKey(SecretKey):
134
+ def __init__(self, name: Algorithm.BIKE, secretkey: bytes) -> None:
135
+ ...
136
+ #
137
+ def decapsulate(self, ciphertext: bytes) -> bytes:
138
+ ...
139
+
140
+
141
+
142
+ class CLASSICMCELIECESecretKey(SecretKey):
143
+ def __init__(self, name: Algorithm.CLASSICMCELIECE, secretkey: bytes) -> None:
144
+ ...
145
+ #
146
+ def decapsulate(self, ciphertext: bytes) -> bytes:
147
+ ...
148
+
149
+
150
+
151
+ class HQCSecretKey(SecretKey):
152
+ def __init__(self, name: Algorithm.HQC, secretkey: bytes) -> None:
153
+ ...
154
+ #
155
+ def decapsulate(self, ciphertext: bytes) -> bytes:
156
+ ...
157
+
158
+
159
+
160
+ class KYBERSecretKey(SecretKey):
161
+ def __init__(self, name: Algorithm.KYBER, secretkey: bytes) -> None:
162
+ ...
163
+ #
164
+ def decapsulate(self, ciphertext: bytes) -> bytes:
165
+ ...
166
+
167
+
168
+
169
+ class MLKEMSecretKey(SecretKey):
170
+ def __init__(self, name: Algorithm.MLKEM, secretkey: bytes) -> None:
171
+ ...
172
+ #
173
+ def decapsulate(self, ciphertext: bytes) -> bytes:
174
+ ...
175
+
176
+
177
+
178
+ class NTRUPRIMESecretKey(SecretKey):
179
+ def __init__(self, name: Algorithm.NTRUPRIME, secretkey: bytes) -> None:
180
+ ...
181
+ #
182
+ def decapsulate(self, ciphertext: bytes) -> bytes:
183
+ ...
184
+
185
+
186
+
187
+ class FRODOKEMSecretKey(SecretKey):
188
+ def __init__(self, name: Algorithm.FRODOKEM, secretkey: bytes) -> None:
189
+ ...
190
+ #
191
+ def decapsulate(self, ciphertext: bytes) -> bytes:
192
+ ...
193
+
194
+
195
+
196
+ @_typing.overload
197
+ def KeyPair(
198
+ name: Algorithm,
199
+ *,
200
+ secretkey: bytes,
201
+ publickey: bytes
202
+ ) -> tuple[SecretKey, PublicKey]:
203
+ ...
204
+ @_typing.overload
205
+ def KeyPair(name: Algorithm, *, secretkey: bytes) -> SecretKey:
206
+ ...
207
+ @_typing.overload
208
+ def KeyPair(name: Algorithm, *, publickey: bytes) -> PublicKey:
209
+ ...
210
+ @_typing.overload
211
+ def KeyPair(name: Algorithm) -> tuple[SecretKey, PublicKey]:
212
+ ...
213
+
214
+
215
+
216
+ @_typing.overload
217
+ def KeyPair(
218
+ name: Algorithm.BIKE,
219
+ *,
220
+ secretkey: bytes,
221
+ publickey: bytes
222
+ ) -> tuple[BIKESecretKey, BIKEPublicKey]:
223
+ ...
224
+ @_typing.overload
225
+ def KeyPair(name: Algorithm.BIKE, *, secretkey: bytes) -> BIKESecretKey:
226
+ ...
227
+ @_typing.overload
228
+ def KeyPair(name: Algorithm.BIKE, *, publickey: bytes) -> BIKEPublicKey:
229
+ ...
230
+ @_typing.overload
231
+ def KeyPair(name: Algorithm.BIKE) -> tuple[BIKESecretKey, BIKEPublicKey]:
232
+ ...
233
+
234
+
235
+
236
+ @_typing.overload
237
+ def KeyPair(
238
+ name: Algorithm.CLASSICMCELIECE,
239
+ *,
240
+ secretkey: bytes,
241
+ publickey: bytes
242
+ ) -> tuple[CLASSICMCELIECESecretKey, CLASSICMCELIECEPublicKey]:
243
+ ...
244
+ @_typing.overload
245
+ def KeyPair(name: Algorithm.CLASSICMCELIECE, *, secretkey: bytes) -> CLASSICMCELIECESecretKey:
246
+ ...
247
+ @_typing.overload
248
+ def KeyPair(name: Algorithm.CLASSICMCELIECE, *, publickey: bytes) -> CLASSICMCELIECEPublicKey:
249
+ ...
250
+ @_typing.overload
251
+ def KeyPair(name: Algorithm.CLASSICMCELIECE) -> tuple[CLASSICMCELIECESecretKey, CLASSICMCELIECEPublicKey]:
252
+ ...
253
+
254
+
255
+
256
+ @_typing.overload
257
+ def KeyPair(
258
+ name: Algorithm.HQC,
259
+ *,
260
+ secretkey: bytes,
261
+ publickey: bytes
262
+ ) -> tuple[HQCSecretKey, HQCPublicKey]:
263
+ ...
264
+ @_typing.overload
265
+ def KeyPair(name: Algorithm.HQC, *, secretkey: bytes) -> HQCSecretKey:
266
+ ...
267
+ @_typing.overload
268
+ def KeyPair(name: Algorithm.HQC, *, publickey: bytes) -> HQCPublicKey:
269
+ ...
270
+ @_typing.overload
271
+ def KeyPair(name: Algorithm.HQC) -> tuple[HQCSecretKey, HQCPublicKey]:
272
+ ...
273
+
274
+
275
+
276
+ @_typing.overload
277
+ def KeyPair(
278
+ name: Algorithm.KYBER,
279
+ *,
280
+ secretkey: bytes,
281
+ publickey: bytes
282
+ ) -> tuple[KYBERSecretKey, KYBERPublicKey]:
283
+ ...
284
+ @_typing.overload
285
+ def KeyPair(name: Algorithm.KYBER, *, secretkey: bytes) -> KYBERSecretKey:
286
+ ...
287
+ @_typing.overload
288
+ def KeyPair(name: Algorithm.KYBER, *, publickey: bytes) -> KYBERPublicKey:
289
+ ...
290
+ @_typing.overload
291
+ def KeyPair(name: Algorithm.KYBER) -> tuple[KYBERSecretKey, KYBERPublicKey]:
292
+ ...
293
+
294
+
295
+
296
+ @_typing.overload
297
+ def KeyPair(
298
+ name: Algorithm.MLKEM,
299
+ *,
300
+ secretkey: bytes,
301
+ publickey: bytes
302
+ ) -> tuple[MLKEMSecretKey, MLKEMPublicKey]:
303
+ ...
304
+ @_typing.overload
305
+ def KeyPair(name: Algorithm.MLKEM, *, secretkey: bytes) -> MLKEMSecretKey:
306
+ ...
307
+ @_typing.overload
308
+ def KeyPair(name: Algorithm.MLKEM, *, publickey: bytes) -> MLKEMPublicKey:
309
+ ...
310
+ @_typing.overload
311
+ def KeyPair(name: Algorithm.MLKEM) -> tuple[MLKEMSecretKey, MLKEMPublicKey]:
312
+ ...
313
+
314
+
315
+
316
+ @_typing.overload
317
+ def KeyPair(
318
+ name: Algorithm.NTRUPRIME,
319
+ *,
320
+ secretkey: bytes,
321
+ publickey: bytes
322
+ ) -> tuple[NTRUPRIMESecretKey, NTRUPRIMEPublicKey]:
323
+ ...
324
+ @_typing.overload
325
+ def KeyPair(name: Algorithm.NTRUPRIME, *, secretkey: bytes) -> NTRUPRIMESecretKey:
326
+ ...
327
+ @_typing.overload
328
+ def KeyPair(name: Algorithm.NTRUPRIME, *, publickey: bytes) -> NTRUPRIMEPublicKey:
329
+ ...
330
+ @_typing.overload
331
+ def KeyPair(name: Algorithm.NTRUPRIME) -> tuple[NTRUPRIMESecretKey, NTRUPRIMEPublicKey]:
332
+ ...
333
+
334
+
335
+
336
+ @_typing.overload
337
+ def KeyPair(
338
+ name: Algorithm.FRODOKEM,
339
+ *,
340
+ secretkey: bytes,
341
+ publickey: bytes
342
+ ) -> tuple[FRODOKEMSecretKey, FRODOKEMPublicKey]:
343
+ ...
344
+ @_typing.overload
345
+ def KeyPair(name: Algorithm.FRODOKEM, *, secretkey: bytes) -> FRODOKEMSecretKey:
346
+ ...
347
+ @_typing.overload
348
+ def KeyPair(name: Algorithm.FRODOKEM, *, publickey: bytes) -> FRODOKEMPublicKey:
349
+ ...
350
+ @_typing.overload
351
+ def KeyPair(name: Algorithm.FRODOKEM) -> tuple[FRODOKEMSecretKey, FRODOKEMPublicKey]:
352
+ ...
353
+
354
+
355
+
356
+ Algorithms = Algorithm.BIKE | Algorithm.CLASSICMCELIECE | Algorithm.HQC | Algorithm.KYBER | Algorithm.MLKEM | Algorithm.NTRUPRIME | Algorithm.FRODOKEM
357
+ def KeyPair(
358
+ name: Algorithm | Algorithms,
359
+ *,
360
+ secretkey: bytes | None = ...,
361
+ publickey: bytes | None = ...
362
+ ) -> tuple[SecretKey, PublicKey] | SecretKey | PublicKey:
363
+ ...
@@ -0,0 +1,100 @@
1
+ Metadata-Version: 2.4
2
+ Name: puantum
3
+ Version: 1.0.0.0
4
+ Classifier: Programming Language :: Python :: 3
5
+ Classifier: Programming Language :: Rust
6
+ Classifier: Operating System :: OS Independent
7
+ Classifier: License :: Public Domain
8
+ Classifier: License :: OSI Approved :: The Unlicense (Unlicense)
9
+ License-File: license.md
10
+ Summary: Python Cryptography
11
+ Keywords: python,cryptography,quantum,security
12
+ Author-email: Anonymous <217687495+1xfakebit@users.noreply.github.com>
13
+ License: Unlicense
14
+ Description-Content-Type: text/markdown
15
+ Project-URL: source, https://github.com/1xfakebit/puantum
16
+ Project-URL: x, https://x.com/1xfakebit
17
+
18
+ # 🔐 Python Cryptography
19
+
20
+ A blazing-fast cryptography library for Python, built on Rust.
21
+
22
+ Pryptography supports an extensive set of **post-quantum** digital signature algorithms (DSA) and key encapsulation mechanisms (KEM).
23
+
24
+ ---
25
+ ## ⚡ Features
26
+ - ✅ Dozens of NIST PQC candidates
27
+ - 🦀 Rust core for speed and safety
28
+ - 📦 Easy installation via [`pip`](https://pip.pypa.io)
29
+ ---
30
+
31
+ ### 🧬 Supported Algorithms
32
+
33
+ ### 🛡️ KEM
34
+ - #### Bike
35
+ - #### ClassicMcEliece
36
+ - #### Hqc
37
+ - #### Kyber
38
+ - #### MLKEM
39
+ - #### NtruPrime
40
+ - #### FrodoKem
41
+
42
+ ### ✍️ DSA
43
+ - #### Cross
44
+ - #### Dilithium
45
+ - #### Falcon
46
+ - #### Mayo
47
+ - #### MLDSA
48
+ - #### Sphincs
49
+ - #### Uov
50
+
51
+ ### ❔ Examples
52
+
53
+ #### DSA Example
54
+ ```python
55
+ # IMPORT
56
+ from puantum.quantum.dsa import Algorithm, KeyPair
57
+
58
+ # MAIN
59
+ alicesk, alicepk = KeyPair(Algorithm.MLDSA.MLDSA87)
60
+ message = "Hello".encode()
61
+
62
+ signature = alicesk.sign(message=message)
63
+ valid = alicepk.verify(signature=signature, message=message)
64
+
65
+ assert valid, "Signature verification failed!"
66
+
67
+ print(f"Message: [{message.decode()}]")
68
+ print(f"Signature: [{signature.hex()[:len(message)]}]")
69
+ ```
70
+
71
+ #### KEM Example
72
+ ```python
73
+ # IMPORT
74
+ from puantum.quantum.kem import Algorithm, KeyPair
75
+
76
+ # MAIN
77
+ alicesk, alicepk = KeyPair(Algorithm.MLKEM.MLKEM1024)
78
+ _bobsk, _bobpk = KeyPair(Algorithm.MLKEM.MLKEM1024)
79
+
80
+ bobss, bobct = alicepk.encapsulate()
81
+ alicess = alicesk.decapsulate(bobct)
82
+
83
+ assert alicess == bobss, "Shared secrets do not match!"
84
+
85
+ print(f"Alice's Shared Secret: [{alicess.hex()}]")
86
+ print(f"Bob's Shared Secret: [{bobss.hex()}]")
87
+ ```
88
+
89
+ ### 📦 Install
90
+ ```shell
91
+ pip install puantum
92
+ ```
93
+
94
+ #### or from source:
95
+ ```shell
96
+ make python
97
+ ```
98
+
99
+ ### 🥳 Enjoy!
100
+
@@ -0,0 +1,19 @@
1
+ puantum-1.0.0.0.dist-info/METADATA,sha256=q3VdyJLvwHUNSwtAs8qTPp3nZb8-V6sUZ2RkGAncX10,2354
2
+ puantum-1.0.0.0.dist-info/WHEEL,sha256=0ua6B-UmXPKizyn4Mhcu6S66EB8t6wxm_Wsw5H1bZYs,96
3
+ puantum-1.0.0.0.dist-info/licenses/license.md,sha256=8Bl77UGlO95Tuu1FjTzqAPr-UU_A11XBQdPct1-E3qE,1236
4
+ puantum/__init__.py,sha256=9j0M-9H-qBo0ZnKNErqoFm9XBcAQ24eRuDUO4wG5xMQ,9
5
+ puantum/__init__.pyi,sha256=9j0M-9H-qBo0ZnKNErqoFm9XBcAQ24eRuDUO4wG5xMQ,9
6
+ puantum/__internal__.cp312-win_amd64.pyd,sha256=WebVzTKO3yMkhmOKijTctkiLMsRiXtwi831twqJ-9cM,4337152
7
+ puantum/classic/__init__.py,sha256=svuqeUOLFJf9lFbShW61AG8v0QWI99p85AL-eSJSmOQ,37
8
+ puantum/classic/__init__.pyi,sha256=9j0M-9H-qBo0ZnKNErqoFm9XBcAQ24eRuDUO4wG5xMQ,9
9
+ puantum/quantum/__init__.py,sha256=9j0M-9H-qBo0ZnKNErqoFm9XBcAQ24eRuDUO4wG5xMQ,9
10
+ puantum/quantum/__init__.pyi,sha256=9j0M-9H-qBo0ZnKNErqoFm9XBcAQ24eRuDUO4wG5xMQ,9
11
+ puantum/quantum/dsa/__init__.py,sha256=Q6ZDFKrq1_lBklrOd_vrxY7siuGiB953btLrdRgQcfY,132
12
+ puantum/quantum/dsa/__init__.pyi,sha256=Q6ZDFKrq1_lBklrOd_vrxY7siuGiB953btLrdRgQcfY,132
13
+ puantum/quantum/dsa/__internal__.py,sha256=is6_LseTxVzMVNF05C1FTy1yLrCs6miEA5FrkHTJeOQ,20083
14
+ puantum/quantum/dsa/__internal__.pyi,sha256=kFQFJJ_KW_oORZH_-LlFa8rEcLTUwFfh5hxYgaCkfng,9170
15
+ puantum/quantum/kem/__init__.py,sha256=S0J8oJ1U6SBPgEGzKW5e8RvEiCwumu-7uOu8F2K_yrA,132
16
+ puantum/quantum/kem/__init__.pyi,sha256=S0J8oJ1U6SBPgEGzKW5e8RvEiCwumu-7uOu8F2K_yrA,132
17
+ puantum/quantum/kem/__internal__.py,sha256=E3i2eKHLzryd9jePhoRIZSKYzwiycDvrKdrsznGyRuM,19670
18
+ puantum/quantum/kem/__internal__.pyi,sha256=D0SAtUTMGFq7Q_Ef6e-N8ItJ0taiHovaG9W1C0NmqGE,8797
19
+ puantum-1.0.0.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: maturin (1.9.0)
3
+ Root-Is-Purelib: false
4
+ Tag: cp312-cp312-win_amd64
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <https://unlicense.org/>