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.
obj-encrypt is an encryption library based on the AES-256 algorithm. It uses Python objects as the basic unit, which can convert objects into binary ciphertext and support decryption. Objects encrypted with obj-encrypt support TCP communication, database storage, and more.
obj-encrypt is an encryption library based on the 'AES-256-GCM' algorithm. It uses Python objects as the basic unit and it can convert objects into binary 'ciphertext' and support decryption. Objects encrypted with obj-encrypt support TCP communication, database storage, and more.
Recommended Environment: Python 3+
Linux and macOS:
python3 -m venv venv # Create a virtual environment.
. venv/bin/activate # Activate the virtual environment.
Windows:
python -m venv venv # Create a virtual environment.
venv\Scripts\activate # Activate the virtual environment.
pip install --upgrade pip
pip install obj-encrypt
from obj_encrypt import Secret
def main():
# Initialize the secret instance, the key is an AES-256 key, and the maximum size cannot exceed 32 strings.
secret = Secret(key='0123456789')
# build the data dictionary
data = {
'author': 'Cyberbolt',
'personal_website': 'https://www.cyberlight.xyz/',
'time': '2022-02-10'
}
ciphertext = secret.encrypt(data) # Convert the object to binary ciphertext and get the ciphertext.
print(ciphertext, ' ', type(ciphertext))
plaintext = secret.decrypt(ciphertext) # Decrypt ciphertext as object.
print(plaintext)
if __name__ == '__main__':
main()
Output
b'U2FsdGVkX18IANYgINODlF8BjkxI3AaKJ/+10Iexgh65qyEKFY21HK5LSjiTuy37arjYAuIQQls+amqCdEdVdy0V1E6xECJXOFBb0kfIzQuxOimOaFFVvtq4IntjJNdCHLiTwuExVfwAW7CjqaD554B71IoT0o9xqrFch3N0vtq+UP0uXyMmMCsvu8zY7vrCuw9qM+kOW2VWsC2c2ePDnofvakchgDW9bGF8fTC3prE+TPksoJ4l6ERCjjRid54gP6+HmzB+TwOVSGaj+4VIdm1g7qv591tBU1U6Lxm83Hk=' <class 'bytes'>
{'author': 'Cyberbolt', 'personal_website': 'https://www.cyberlight.xyz/', 'time': '2022-02-10'}
You can encrypt your own objects in addition to Python dictionaries, and the encrypted binary can be stored in a database or used for TCP communication.
If this module was helpful to you, I hope to receive your GitHub Star! Thank you so much!
FAQs
obj-encrypt is an encryption library based on the AES-256 algorithm. It uses Python objects as the basic unit, which can convert objects into binary ciphertext and support decryption. Objects encrypted with obj-encrypt support TCP communication, database storage, and more.
We found that obj-encrypt 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.