
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
onion-tools
Advanced tools
A set of tools dedicated to onion domains manipulation. Readme file is a pure overview, each exported method is documented better within its comments.
Get it via NPM:
npm i onion-tools
You can generate random domains, or deterministically from a predefined seed.
// Generate random domain.
const randomDomainObj = await generateV3OnionDomain()
// Generate domain from seed.
const domainFromSeedObj = await generateV3OnionDomain('some seed')
/**
* outputs: {
* expandedPrivateKey: Buffer,
* publicKey: Buffer,
* domain: string,
* }
*/
console.log(randomDomainObj)
By default the generated public/private keys pair cannot be imported by Tor onion service hosting. If you wish that sanitization pass another boolean parameter to the function. After that you will be able to write the keys to files and import them to onion hosting successfully.
// Generate random domain with keys pair sanitized for hosting import.
const { domain, expandedPrivateKey, publicKey } = await generateV3OnionDomain(undefined, true)
writeFileSync('./hs_ed25519_secret_key', expandedPrivateKey)
writeFileSync('./hs_ed25519_public_key', publicKey)
writeFileSync('./hostname', domain)
You can verify if a domain is valid or not based on it's syntax and checksum. Both methods return booleans.
const domain = 'ciadotgov4sjwlzihbbgxnqg3xiyrg7so2r2o3lt5wz5ypk4sxyjstad.onion'
// Verify domain syntax.
isValidV3OnionDomainSyntax(domain)
// Verify domain syntax + checksum.
isValidV3OnionDomain(domain)
You can extract known components of a domain from it, such as public key, checksum and domain version.
const domain = 'ciadotgov4sjwlzihbbgxnqg3xiyrg7so2r2o3lt5wz5ypk4sxyjstad.onion'
const resultObj = extractV3Parts(domain)
/**
* Outputs: {
* publicKey: Buffer,
* checksum: Buffer,
* version: Buffer,
* }
*/
console.log(resultObj)
You can test the features of this package by installing its dev dependencies and running the command:
npm run test
If you wish to contribute, PRs against main branch are welcomed but all previous tests must pass.
FAQs
A set of tools dedicated for onion domains manipulation.
We found that onion-tools 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.