Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@aws-sdk/hash-blob-browser
Advanced tools
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/hash-blob-browser/latest.svg)](https://www.npmjs.com/package/@aws-sdk/hash-blob-browser) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/hash-blob-browser.svg)](https://www.npmjs.com/package/@
@aws-sdk/hash-blob-browser is a package from the AWS SDK for JavaScript that provides utilities for computing cryptographic hashes of Blob objects in a browser environment. This is particularly useful for tasks such as data integrity checks, digital signatures, and other cryptographic operations.
Compute SHA-256 Hash
This feature allows you to compute the SHA-256 hash of a Blob object. The code sample demonstrates how to create a new Sha256 instance, update it with the Blob data, and then compute the digest.
const { Sha256 } = require('@aws-sdk/hash-blob-browser');
async function computeSHA256(blob) {
const hash = new Sha256();
hash.update(blob);
const digest = await hash.digest();
return digest;
}
// Usage example
const blob = new Blob(['Hello, world!']);
computeSHA256(blob).then(digest => console.log(digest));
Compute MD5 Hash
This feature allows you to compute the MD5 hash of a Blob object. The code sample demonstrates how to create a new Md5 instance, update it with the Blob data, and then compute the digest.
const { Md5 } = require('@aws-sdk/hash-blob-browser');
async function computeMD5(blob) {
const hash = new Md5();
hash.update(blob);
const digest = await hash.digest();
return digest;
}
// Usage example
const blob = new Blob(['Hello, world!']);
computeMD5(blob).then(digest => console.log(digest));
crypto-js is a widely-used library that provides a variety of cryptographic algorithms for JavaScript, including MD5, SHA-1, SHA-256, and more. Unlike @aws-sdk/hash-blob-browser, crypto-js is not specifically designed for Blob objects but can be used for general-purpose cryptographic operations.
js-sha256 is a lightweight library that provides a simple API for computing SHA-256 hashes in JavaScript. It is smaller and more focused than @aws-sdk/hash-blob-browser, making it a good choice for projects that only require SHA-256 hashing.
spark-md5 is a fast and efficient library for computing MD5 hashes in JavaScript. It is optimized for large files and can process data in chunks, making it a good alternative to @aws-sdk/hash-blob-browser for MD5 hashing.
3.374.0 (2023-07-20)
FAQs
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/hash-blob-browser/latest.svg)](https://www.npmjs.com/package/@aws-sdk/hash-blob-browser) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/hash-blob-browser.svg)](https://www.npmjs.com/package/@
We found that @aws-sdk/hash-blob-browser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.