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.
@smithy/util-hex-encoding
Advanced tools
Converts binary buffers to and from lowercase hexadecimal encoding
@smithy/util-hex-encoding is a utility package for encoding and decoding hexadecimal strings. It is part of the Smithy framework, which is used for building SDKs and other tools.
Hex Encoding
This feature allows you to convert a buffer or byte array into a hexadecimal string.
const { toHex } = require('@smithy/util-hex-encoding');
const buffer = Buffer.from('hello');
const hexString = toHex(buffer);
console.log(hexString); // Output: 68656c6c6f
Hex Decoding
This feature allows you to convert a hexadecimal string back into a buffer or byte array.
const { fromHex } = require('@smithy/util-hex-encoding');
const hexString = '68656c6c6f';
const buffer = fromHex(hexString);
console.log(buffer.toString()); // Output: hello
The 'buffer' package is a core Node.js module that provides a way of handling binary data. It includes methods for converting buffers to and from hexadecimal strings, similar to @smithy/util-hex-encoding. However, 'buffer' is more comprehensive and includes additional functionalities for working with binary data.
The 'hex2ascii' package provides simple utilities for converting hexadecimal strings to ASCII and vice versa. It is similar to @smithy/util-hex-encoding but focuses specifically on ASCII conversions, making it less versatile for general binary data handling.
The 'crypto-js' package is a widely-used library for cryptographic algorithms. It includes utilities for encoding and decoding hexadecimal strings, among other features. Compared to @smithy/util-hex-encoding, 'crypto-js' offers a broader range of cryptographic functionalities.
FAQs
Converts binary buffers to and from lowercase hexadecimal encoding
We found that @smithy/util-hex-encoding demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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.