![Malicious npm Package Typosquats react-login-page to Deploy Keylogger](https://cdn.sanity.io/images/cgdhsj6q/production/007b21d9cf9e03ae0bb3f577d1bd59b9d715645a-1024x1024.webp?w=400&fit=max&auto=format)
Research
Security News
Malicious npm Package Typosquats react-login-page to Deploy Keylogger
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
encodr
Advanced tools
Readme
Encoding/Decoding to/from CBOR/MsgPack/JSON for Node.js and Browser.
This is a small JavaScript abstraction layer for Node.js and the Browser to encode/decode JavaScript values to/from the binary object serialization formats Concise Binary Object Representation (CBOR, RFC7049), MessagePack (MsgPack) and UTF8-encoded JavaScript Object Notation (JSON, RFC4627). The actual encoding/decoding is performed by underyling libraries. This package is just a convenient abstraction layer to ensure the correct library and consistent data types are used.
$ npm install encodr
import Encodr from "encodr"
const CBOR = new Encodr("cbor")
const MSGPACK = new Encodr("msgpack")
const JSON = new Encodr("json")
let data = {
foo: "bar",
baz: 42,
baz: [ 1.0, "quux", true ],
quux: {}
}
data = CBOR.encode(data)
data = CBOR.decode(data)
data = MSGPACK.encode(data)
data = MSGPACK.decode(data)
data = JSON.encode(data)
data = JSON.decode(data)
type BLOB = Buffer | Uint8Array
The BLOB
data type depends on the execution environment:
In Node.js it is Buffer
, in the Browsers it is Uint8Array
.
new Encodr(format: string = "cbor"): Encodr
Create a new Encodr instance for a particular encoding
format. The supported formats are cbor
, msgpack
, json
and jsons
. The default is cbor
.
Encodr::encode(data: any): BLOB
Encode a JavaScript value to the serialization format.
Encodr::decode(data: BLOB): any
Decode a JavaScript value from the serialization format.
The following regular serialization formats are supported:
cbor: Concise Binary Object Representation (CBOR, RFC7049):
This is a very compact, efficient and IETF-standardized serialization format.
msgpack: MessagePack (MsgPack):
This is a very compact, efficient and battle-tested serialization format.
json: UTF-8-based binary-encoded JavaScript Object Notation (JSON, RFC4627):
This is a less compact, less efficient but IETF-standardized serialization format.
For convenience and application development reasons, there is also an additional special serialization format:
jsons: UTF-16 string-encoded JavaScript Object Notation (JSON, RFC4627):
This is a less compact, less efficient but IETF-standardized serialization format.
This format variant is JSON encoded into a regular UTF-16 character
string (instead of the UTF-8 byte array as it is the case for json
)
and hence the API BLOB
type here becomes String
as a special case.
This format exists for development purposes only, where one wants to
easily switch the encoding to a human-readable string representation.
For instance, when transferring the data over WebSockets via
WebSocket-Framed, the
resulting WebSocket frame will be human-readable in the Browser's
debugger.
Copyright (c) 2017 Ralf S. Engelschall (http://engelschall.com/)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Unknown package
We found that encodr 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 researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
Security News
The JavaScript community has launched the e18e initiative to improve ecosystem performance by cleaning up dependency trees, speeding up critical parts of the ecosystem, and documenting lighter alternatives to established tools.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.