
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
@4bitlabs/codecs
Advanced tools
@4bitlabs/codecs
A collection of decoders (and eventually encoders) for working with Sierra On-line SCI-engine assets.
Name | Decoder | Encoder |
---|---|---|
Huffman | ✅ | |
Lempel–Ziv–Welch | ✅ |
Decoding bytes with Huffman:
import { Huffman } from '@4bitlabs/codecs';
const encodedBytes = Uint8Array.of(/* encoded data */);
const bytes = Huffman.decode(encodedBytes);
Decoding bytes with Lempel-Ziv-Welch:
import { Lzw } from '@4bitlabs/codecs';
const encodedBytes = Uint8Array.of(/* encoded data */);
const bytes = Lzw.decode(encodedBytes);
By default, most-significant bit ordering is used. You can change the encoded byte ordering of the decoder with the options
parameter. To use least-significant bit
ordering:
const bytes = Lzw.decode(encodedBytes, { order: 'lsb' });
The default code-width it uses is 8
, this can also be adjusted. To use a 7-bit code width:
const bytes = Lzw.decode(encodedBytes, { literalWidth: 7 });
Also, an entirely custom LZW dictionaries can be used for decoding:
import { Lzw } from '@4bitlabs/codecs';
const dictionary = [
Lzw.EOF_MARKER,
0x41, // A
0x42, // B
0x43, // C
0x44, // D
];
const bytes = Lzw.decode(encodedBytes, { dictionary });
Longer codings can be encoded in the dictionary by using either an array of numbers of with a Uint8Array
:
import { Lzw, EOF_MARKER } from '@4bitlabs/codecs';
const dictionary = [
Lzw.EOF_MARKER,
Uint8Array.of(0x47, 0x41, 0x54, 0x41), // GATA
Uint8Array.of(0x41, 0x54, 0x54, 0x41), // ATTA
Uint8Array.of(0x43, 0x47, 0x41, 0x54), // CGAT
Uint8Array.of(0x41, 0x43, 0x41, 0x47), // ACAG
];
const bytes = Lzw.decode(encodedBytes, { dictionary });
FAQs
A collection of codecs for working with SCI-engine assets
We found that @4bitlabs/codecs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 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.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.