
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@particle/device-control-crypto
Advanced tools
Elliptic Curve J-PAKE and AES CCM for Node.js and browsers
Elliptic Curve J-PAKE and AES CCM for Node.js and browsers.
npm install @particle/device-control-crypto --save
A class implementing the CCM mode of operation for a block cipher.
Kind: global class
Promise.<Uint8Array>
Promise.<Uint8Array>
Constructor.
Param | Type | Default | Description |
---|---|---|---|
options | Object | Options. | |
options.encrypt | EncryptFunction | Encryption function. | |
options.nonceLength | Number | Nonce length in bytes. The value must be in the range [7, 13]. | |
[options.tagLength] | Number | 16 | Length of the authentication tag in bytes: 4, 6, 8, 10, 12, 14 or 16. |
Promise.<Uint8Array>
Encrypt a message.
Kind: instance method of Ccm
Returns: Promise.<Uint8Array>
- Encrypted data. The authentication tag is appended to the encrypted data.
Param | Type | Description |
---|---|---|
data | Uint8Array | Data to encrypt. |
nonce | Uint8Array | Nonce. |
[addData] | Uint8Array | Additional authenticated data. |
Promise.<Uint8Array>
Decrypt a message.
Kind: instance method of Ccm
Returns: Promise.<Uint8Array>
- Decrypted data.
Throws:
Param | Type | Description |
---|---|---|
data | Uint8Array | Data to decrypt. The authentication tag must be appended to the encrypted data. |
nonce | Uint8Array | Nonce. |
[addData] | Uint8Array | Additional authenticated data. |
A class implementing the EC J-PAKE protocol as defined by the Thread specification.
Kind: global class
Promise.<Uint8Array>
Number
Promise.<Uint8Array>
Number
Promise.<Uint8Array>
Promise.<Uint8Array>
Generate a message for the first round of the protocol.
Kind: instance method of EcJpake
Returns: Promise.<Uint8Array>
- Message data.
Number
Read a message generated by the peer for the first round of the protocol.
Kind: instance method of EcJpake
Returns: Number
- Number of bytes read.
Param | Type | Description |
---|---|---|
buf | Uint8Array | Message data. |
Promise.<Uint8Array>
Generate a message for the second round of the protocol.
Kind: instance method of EcJpake
Returns: Promise.<Uint8Array>
- Message data.
Number
Read a message generated by the peer for the second round of the protocol.
Kind: instance method of EcJpake
Returns: Number
- Number of bytes read.
Param | Type | Description |
---|---|---|
buf | Uint8Array | Message data. |
Promise.<Uint8Array>
Derive the shared secret.
Kind: instance method of EcJpake
Returns: Promise.<Uint8Array>
- Shared secret.
EncryptFunction
Create an AES-128 cipher operating in ECB mode.
Kind: global function
Returns: EncryptFunction
- Encryption function.
Param | Type | Description |
---|---|---|
key | Uint8Array | Encryption key. The key must be 16 bytes long. |
Promise.<Uint8Array>
Generate cryptographically strong random data.
Kind: global function
Returns: Promise.<Uint8Array>
- Random data.
Param | Type | Description |
---|---|---|
size | Number | Number of bytes to generate. |
Promise.<Uint8Array>
Encrypt a single block of data.
Kind: global typedef
Returns: Promise.<Uint8Array>
- Ciphertext block.
Param | Type | Description |
---|---|---|
block | Uint8Array | Plaintext block. The block must be 16 bytes long. |
Promise.<Uint8Array>
Constructor.
Kind: global typedef
Returns: Promise.<Uint8Array>
- Random bytes.
Param | Type | Default | Description |
---|---|---|---|
size | Number | Number of random bytes to generate. | |
options | Object | Options. | |
options.role | String | Role of this peer: client or server . | |
options.secret | String | Uint8Array | Pre-shared secret. | |
[options.randomBytes] | RandomFunction | getRandomBytes | Cryptographically strong random generator function. |
[options.curve] | String | p256 | Curve name. |
[options.clientId] | String | Uint8Array | client | Client identity. |
[options.serverId] | String | Uint8Array | server | Server identity. |
NOTE: Unfortunately, docs have a nasty habit of falling out of date. When in doubt, check usage in tests
FAQs
Elliptic Curve J-PAKE and AES CCM for Node.js and browsers
The npm package @particle/device-control-crypto receives a total of 9 weekly downloads. As such, @particle/device-control-crypto popularity was classified as not popular.
We found that @particle/device-control-crypto demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 29 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.