ECC-Messaging-Scheme-Package
A system that encrypts and decrypts data packets with the elliptic curve cryptography (ECC) for others to utilize and download.
Where to download:
typescript/javascript
https://www.npmjs.com/package/ecc-messaging-scheme-package
Python
https://pypi.org/project/ecc-messaging-scheme-package/
Classes
We have one main class, ECCM class, which combines our ECC class and our Encrypt/Decrypt, and curve initialization(initializePublicEnv) functions.
The ECC Class:
- Responsible for generating/loading private key
- Get current users public key from cookies or create a new one and save
- Gets shared key using diffie hellman when given another users public key
- Clear cookies containing private key for current instance.
Encrypt/Decrypt:
- Given a key and text it encrypts/decrypts text using AES
initializePublicEnv function:
- Inizalites a point and an ecc curve: secp256k1
Examples:
#Key exchange
C = initialize_public_env()
a_ecc_instance = ECC_Instance(C,'a')
a_ecc_instance.get_public_key()
b_ecc_instance = ECC_Instance(C,'b')
b_ecc_instance.get_public_key()
a_ecc_instance.generate_shared_key(b_ecc_instance.get_public_key())
b_ecc_instance.generate_shared_key(a_ecc_instance.get_public_key())
assert(a_ecc_instance.get_shared_key() == b_ecc_instance.get_shared_key())
#Share messages
key_b = a_ecc_instance.get_shared_key().x.to_bytes(24, byteorder='big')
plaintext = "test 12312 "
ciphertext,nonce = encrypt(key_b,plaintext)
plaintext_out = decrypt(key_b,ciphertext,nonce)
assert(plaintext==plaintext_out)
Disclaimer
Use at Your Own Risk.
Metadata
Release files for ecc-messaging-scheme-package 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ecc-messaging-scheme-package-1.0.2.tar.gz | 2.3 kB | Details |
Release files / ecc-messaging-scheme-package-1.0.2.tar.gz
| Download URL | ecc-messaging-scheme-package-1.0.2.tar.gz |
|---|---|
| Size | 2.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2ce9b54cf342c03852d2fc1a2d8a7c8940c7406805bd707a2f75a62fb0a2a68e
|
|
BLAKE2b-256 checksum How to use checksums |
abf825a95878a2f52ff72f09f66e2f78174cc0dc80e285485da3b89059b1f6d2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.5
|