
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
foss_cryptography
is a Python free open source library for Elliptic Curves Cryptography under the MIT License.
The library provides:
The main functions of this library are self-contained, and the library doesn't require any external dependencies to perform its core operations.
Elliptic Curve Operations: The library includes a module ellipticCurves.py
that provides essential operations on elliptic curves, such as point doubling, point addition, and scalar multiplication.
ECDSA Implementation: The ecdsa.py
module implements the ECDSA algorithm with non-deterministic and deterministic generation of k (RFC6979), allowing users to sign and verify messages using a provided library of standard elliptic curves.
Install the library
pip install foss-cryptography
Clone the library from GitHub
git clone https://github.com/stefanogaspari/foss_cryptography.git
Install the library dependencies
pip install -r requirements.txt
Build the library
python setup.py bdist_wheel
Install the library
pip install /path/to/wheelfile.whl
from cryptography.ellipticCurves import EllipticCurve
from cyptography.secp256k1 import p, a, b
# Initialize an elliptic curve
curve = EllipticCurve(p, a, b)
# Point initialization
P = [x1, y1] # x1 and y1: type int
Q = [x2, y2] # x2 and y2: type int
# Point doubling R = 2 * P
R = curve.double(P)
# Point addition, R = P + Q
R = curve.add(P, Q)
# Scalar multiplication, R = n * P
R = curve.scalar_multiply(n, P)
from cryptography.ecdsa import ECDSA
from cyptography.curves.secp256k1 import p, a, b, origin_G, n
# Define the hash function
hash_function = 'sha256'
# Initialize ECDSA secp256k1 instance
ecdsa = ECDSA(m, a, b, origin_G, n, hash_function)
# Sign a message with a secure random k
# k: int
# message: bytes
# private_key: bytes
# signature: Tuple(bytes, bytes) -> r , s
signature = ecdsa.non_deterministic_sign(k, message, private_key)
# Verify a message
# signature: bytes -> r || s
# message: bytes
# public_key: bytes -> public_key_x || public_key_y
# is_verified: bool
is_verified = ecdsa.verify(signature, message, public_key)
from cryptography.ecdsa import ECDSA
from cyptography.curves.secp256k1 import p, a, b, origin_G, n
# Define the hash function
hash_function = 'sha256'
# Initialize ECDSA secp256k1 instance
ecdsa = ECDSA(m, a, b, origin_G, n)
# Sign a message with a deterministic k (as per RFC6979)
# message: bytes
# private_key: bytes
# signature: Tuple(bytes, bytes) -> r , s
signature = ecdsa.deterministic_sign(message, private_key)
# Verify a message
# signature: bytes -> r || s
# message: bytes
# public_key: bytes -> public_key_x || public_key_y
# is_verified: bool
is_verified = ecdsa.verify(signature, message, public_key)
This project is under the MIT License.
FAQs
Elliptic Cryptography and ECDSA
We found that foss-cryptography demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.