Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A common source code library for SDC services that use JWE. Apps wishing to use this should add the sdc_cryptography dependency to their requirements.txt and install with pip.
pip install pipenv
make build
pipenv run make test
pipenv run make sdist
These commands will generate a requirements file that pip can use. It doesn't have to be created this way but this is the easiest way.
pip install pipenv
pipenv lock -r --dev > requirements.txt
pip install -r requirements.txt
make test
make sdist
Need to generate a keys.yml file first. Note, this requires a file system to store the file. Then it needs to be loaded, and a key store generated.
generate_keys.py <key_folder_location>
After this has been configured, encrypting and decrypting can be done as in the example below.
secrets_from_file = yaml.safe_load("keys.yml")
validate_required_secrets(secrets_from_file, EXPECTED_SECRETS, KEY_PURPOSE_SUBMISSION)
key_store = KeyStore(secrets_from_file)
# Encrypt JSON (Purpose has a single encryption key in the key store)
from sdc.crypto.encrypter import encrypt
encrypted_json = encrypt(json, key_store, key_purpose)
# Encrypt JSON with encryption service (Purpose has multiple encryption keys in the key store each tagged with a service)
from sdc.crypto.encrypter import encrypt
encrypted_json = encrypt(json, key_store, key_purpose, encryption_for_service="some-service")
# Decrypt UTF8 jwe token
from sdc.crypto.decrypter import decrypt
data_bytes = data.decode('UTF8')
decrypted_json = decrypt(data_bytes, key_store, key_purpose)
This repo is available from PyPi at sdc-cryptography
The package is published automatically to PyPi when a tag is created in Github. The configuration for this is in the .travis.yml file.
FAQs
A shared library for SDC services that use JWT with JWE
We found that sdc-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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.