Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
ethereumjs-tx-keyvault
Advanced tools
npm install ethereumjs-tx-keyvault
const txExt = require("ethereumjs-tx-keyvault")
const KeyVault = require("azure-keyvault")
const EthereumTx = require("ethereumjs-tx")
const AuthenticationContext = require("adal-node").AuthenticationContext;
const clientId = "<to-be-filled>";
const clientSecret = "<to-be-filled>";
const vaultUri = "<to-be-filled>";
// Setup key vault client and credentials
const authenticator = function (challenge, callback) {
const context = new AuthenticationContext(challenge.authorization);
return context.acquireTokenWithClientCredentials(challenge.resource, clientId, clientSecret, function (err, tokenResponse) {
if (err) throw err
const authorizationValue = tokenResponse.tokenType + ' ' + tokenResponse.accessToken
return callback(null, authorizationValue)
})
}
const credentials = new KeyVault.KeyVaultCredentials(authenticator)
const client = new KeyVault.KeyVaultClient(credentials);
// Create a sample transaction
const txParams = {
nonce: '0x00',
gasPrice: '0x09184e72a000',
gasLimit: '0x2710',
to: '0x0000000000000000000000000000000000000000',
value: '0x00',
data: '0x7f7465737432000000000000000000000000000000000000000000000000000000600057',
// EIP 155 chainId - mainnet: 1, ropsten: 3
chainId: 3
}
const tx = new EthereumTx(txParams)
// Sign the transaction and log verification results
txExt.sign(tx, client, vaultUri, "alice", "")
.then(signature => {
Object.assign(tx, signature)
console.log("Signature verification: " + tx.verifySignature())
// Print transaction hash. Can be sent directly to geth using 'sendRawTransaction'
const txHash = "0x" + Buffer.from(tx.serialize()).toString("hex")
console.log("Transaction hash: " + txHash)
})
Check out the samples in F# for .NET standard
FAQs
Azure Key Vault extensions for ethereumjs-tx
We found that ethereumjs-tx-keyvault demonstrated a not healthy version release cadence and project activity because the last version was released 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 uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.