Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
A Python package to compute the hash value of an input string using various cryptographic hashing algorithms.
Definition: A hash function is any function that can be used to map data of arbitrary size to fixed-size values (source).
$ pip install hashbase
Check out: examples/hash.py
Import the required hash function(s)
from hashbase import (
MD2,
MD4,
MD5,
SHA1,
SHA224,
SHA256,
SHA384,
SHA512,
SHA512_224,
SHA512_256,
RIPEMD128,
RIPEMD160,
RIPEMD256,
RIPEMD320,
CRC8,
CRC16,
)
Generate the hash of the input string
message: str = "password"
print(f"MD2: {MD2().generate_hash(message)}")
print(f"MD4: {MD4().generate_hash(message)}")
print(f"MD5: {MD5().generate_hash(message)}")
print(f"SHA-1: {SHA1().generate_hash(message)}")
print(f"SHA-224: {SHA224().generate_hash(message)}")
print(f"SHA-256: {SHA256().generate_hash(message)}")
print(f"SHA-384: {SHA384().generate_hash(message)}")
print(f"SHA-512: {SHA512().generate_hash(message)}")
print(f"SHA-512/224: {SHA512_224().generate_hash(message)}")
print(f"SHA-512/256: {SHA512_256().generate_hash(message)}")
print(f"RIPEMD-128: {RIPEMD128().generate_hash(message)}")
print(f"RIPEMD-160: {RIPEMD160().generate_hash(message)}")
print(f"RIPEMD-256: {RIPEMD256().generate_hash(message)}")
print(f"RIPEMD-320: {RIPEMD320().generate_hash(message)}")
print(f"CRC-8: {CRC8().generate_hash(message)}")
print(f"CRC-16: {CRC16().generate_hash(message)}")
The output of the above cell
MD2: f03881a88c6e39135f0ecc60efd609b9
MD4: 8a9d093f14f8701df17732b2bb182c74
MD5: 5f4dcc3b5aa765d61d8327deb882cf99
SHA-1: 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
SHA-224: d63dc919e201d7bc4c825630d2cf25fdc93d4b2f0d46706d29038d01
SHA-256: 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8
SHA-384: a8b64babd0aca91a59bdbb7761b421d4f2bb38280d3a75ba0f21f2bebc45583d446c598660c94ce680c47d19c30783a7
SHA-512: b109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706a8bb980b1d7785e5976ec049b46df5f1326af5a2ea6d103fd07c95385ffab0cacbc86
SHA-512/224: f2356967afbae0c00f7a58d28a126fe034d555397d0d0772d1427c98
SHA-512/256: f3f22d82ccf54a92cfc584d9f1531cbf29b11b513f7f68a20a2fa707f3450220
RIPEMD-128: c9c6d316d6dc4d952a789fd4b8858ed7
RIPEMD-160: 2c08e8f5884750a7b99f6f2f342fc638db25ff31
RIPEMD-256: f94cf96c79103c3ccad10d308c02a1db73b986e2c48962e96ecd305e0b80ef1b
RIPEMD-320: c571d82e535de67ff5f87e417b3d53125f2d83ed7598b89d74483e6c0dfe8d86e88b380249fc8fb4
CRC-8: 0x4f
CRC-16: 0x7e5b
hashbase.MD2
)hashbase.MD4
)hashbase.MD5
)hashbase.SHA1
)hashbase.SHA224
)hashbase.SHA256
)hashbase.SHA512
)hashbase.SHA512_224
)hashbase.SHA512_256
)hashbase.SHA384
)hashbase.RIPEMD128
)hashbase.RIPEMD160
)hashbase.RIPEMD256
)hashbase.RIPEMD320
)hashbase.CRC8
)hashbase.CRC16
)This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A collection of cryptographic hashing algorithms implemented in Python
We found that hashbase 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.