bcp1 0.1__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.
bcp1-0.1/MANIFEST.in ADDED
@@ -0,0 +1 @@
1
+ include bcp1/data.txt
bcp1-0.1/PKG-INFO ADDED
@@ -0,0 +1,3 @@
1
+ Metadata-Version: 2.4
2
+ Name: bcp1
3
+ Version: 0.1
bcp1-0.1/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # bcp1
2
+
3
+ Version: 0.1
4
+
5
+ This package was created using the PyPI Package Generator.
@@ -0,0 +1,2 @@
1
+ from importlib.resources import files
2
+ print(files("bcp1").joinpath("data.txt").read_text())
bcp1-0.1/bcp1/data.txt ADDED
@@ -0,0 +1,46 @@
1
+ from cryptography.hazmat.primitives.asymmetric import rsa, padding
2
+ from cryptography.hazmat.primitives import hashes, serialization
3
+
4
+ # Generate keys
5
+ private_key = rsa.generate_private_key(
6
+ public_exponent=65537,
7
+ key_size=2048
8
+ )
9
+
10
+ public_key = private_key.public_key()
11
+
12
+ # Message
13
+ message = b"Hello, this is a digital message."
14
+
15
+ # Sign the message
16
+ signature = private_key.sign(
17
+ message,
18
+ padding.PKCS1v15(),
19
+ hashes.SHA256()
20
+ )
21
+
22
+ print("Signature created successfully.")
23
+
24
+ # Verify the signature
25
+ try:
26
+ public_key.verify(
27
+ signature,
28
+ message,
29
+ padding.PKCS1v15(),
30
+ hashes.SHA256()
31
+ )
32
+
33
+ print("Signature Verified Successfully.")
34
+
35
+ except:
36
+ print("Signature verification failed.")
37
+
38
+
39
+ # Convert public key into PEM format
40
+ public_pem = public_key.public_bytes(
41
+ encoding=serialization.Encoding.PEM,
42
+ format=serialization.PublicFormat.SubjectPublicKeyInfo
43
+ )
44
+
45
+ print("\nPublic key:")
46
+ print(public_pem.decode())
@@ -0,0 +1,3 @@
1
+ Metadata-Version: 2.4
2
+ Name: bcp1
3
+ Version: 0.1
@@ -0,0 +1,10 @@
1
+ MANIFEST.in
2
+ README.md
3
+ pyproject.toml
4
+ setup.py
5
+ bcp1/__init__.py
6
+ bcp1/data.txt
7
+ bcp1.egg-info/PKG-INFO
8
+ bcp1.egg-info/SOURCES.txt
9
+ bcp1.egg-info/dependency_links.txt
10
+ bcp1.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ bcp1
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools", "wheel"]
3
+ build-backend = "setuptools.build_meta"
bcp1-0.1/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
bcp1-0.1/setup.py ADDED
@@ -0,0 +1,9 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="bcp1",
5
+ version="0.1",
6
+ packages=find_packages(),
7
+ include_package_data=True,
8
+ package_data={"bcp1": ["data.txt"]},
9
+ )