Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@niq/ripple-keypairs
Advanced tools
An implementation of ripple keypairs & wallet generation using elliptic which supports rfc6979 and eddsa deterministic signatures.
> require('ripple-keypairs').generateAccountKeys()
{ seed: 'sh9g1aeTESY5W4ZvNmHDKJCurrCqJ',
publicKey: '034C48914136FCF21CB5B25C2227ADD08D622A5E74ACCEC456E2E51241DA7E165B',
id: 'rLd8vAKQXYCyZajqXHY5LzR7fLEoTGno5k' }
> require('ripple-keypairs').accountKeysFromSeed('sEd7t79mzn2dwy3vvpvRmaaLbLhvme6');
{ seed: 'sEd7t79mzn2dwy3vvpvRmaaLbLhvme6',
publicKey: 'ED5F5AC8B98974A3CA843326D9B88CEBD0560177B973EE0B149F782CFAA06DC66A',
id: 'r9LqNeG6qHxjeUocjvVki2XR35weJ9mZgQ' }
> require('ripple-keypairs').generateNodeKeys();
{ seed: 'ssC7Y9LMKhuzFMVueaj2fnTuGLftA',
publicKey: 'n9MU2RsULUayZnWeLssjbMzVRPeVUUMgiPYTwe8eMgpdGDWp5t8C' }
> require('ripple-keypairs').nodeKeysFromSeed('ssC7Y9LMKhuzFMVueaj2fnTuGLftA');
{ seed: 'ssC7Y9LMKhuzFMVueaj2fnTuGLftA',
publicKey: 'n9MU2RsULUayZnWeLssjbMzVRPeVUUMgiPYTwe8eMgpdGDWp5t8C' }
> var deriveNodeOwnerAccountID = require('ripple-keypairs').deriveNodeOwnerAccountID;
> deriveNodeOwnerAccountID('n9MXXueo837zYH36DvMc13BwHcqtfAWNJY5czWVbp7uYTj7x17TH')
'rhcfR9Cg98qCxHpCcPBmMonbDBXo84wyTn'
see examples/sign-transaction.js
var Transaction = require('ripple-lib').Transaction;
var keyPairFromSeed = require('../').keyPairFromSeed;
var SIGNING_PREFIX = [0x53, 0x54, 0x58, 0x00];
function prettyJSON(obj) {
return JSON.stringify(obj, undefined, 2);
}
function signingData(tx) {
return SIGNING_PREFIX.concat(tx.serialize().buffer);
}
function signTxJson(seed, json) {
var keyPair = keyPairFromSeed(seed);
var tx = Transaction.from_json(json);
var tx_json = tx.tx_json;
tx_json.SigningPubKey = keyPair.publicHex();
tx_json.TxnSignature = keyPair.signHex(signingData(tx));
var serialized = tx.serialize();
var id = tx.hash('HASH_TX_ID', /* Uint256: */ false , /* pre: */ serialized);
return {
hash: id,
tx_blob: serialized.to_hex(),
tx_json: tx_json
};
}
var seed = 'sEd7t79mzn2dwy3vvpvRmaaLbLhvme6';
var tx_json = {
Account: 'r9LqNeG6qHxjeUocjvVki2XR35weJ9mZgQ',
Amount: '1000',
Destination: 'rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh',
Fee: '10',
Flags: 2147483648,
Sequence: 1,
TransactionType: 'Payment',
};
console.log(prettyJSON(signTxJson(seed, tx_json)));
{
"hash": "1B6B9652F95D826C9D9C3FD30F208130433CBC7C48C10F6EC2CC5E4A85D167FF",
"tx_blob": "120000228000000024000000016140000000000003E868400000000000000A7321ED5F5AC8B98974A3CA843326D9B88CEBD0560177B973EE0B149F782CFAA06DC66A74407D0825105229923B261C716F225181E5A66A34C9480446ABE64818A673954CC34D42946CD82172814F037976AE3800BDE983624A45FCDBED4A548C4650BF900D81145B812C9D57731E27A2DA8B1830195F88EF32A3B68314B5F762798A53D543A014CAF8B297CFF8F2F937E8",
"tx_json": {
"Account": "r9LqNeG6qHxjeUocjvVki2XR35weJ9mZgQ",
"Amount": "1000",
"Destination": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh",
"Fee": "10",
"Flags": 2147483648,
"Sequence": 1,
"TransactionType": "Payment",
"SigningPubKey": "ED5F5AC8B98974A3CA843326D9B88CEBD0560177B973EE0B149F782CFAA06DC66A",
"TxnSignature": "7D0825105229923B261C716F225181E5A66A34C9480446ABE64818A673954CC34D42946CD82172814F037976AE3800BDE983624A45FCDBED4A548C4650BF900D"
}
}
FAQs
ripple key pairs
We found that @niq/ripple-keypairs 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.