{"_id":"@eliza-dot-aes/ecdsa-aes","_rev":"5-413345f6b42ef3ded75d1b0776ca90a8","name":"@eliza-dot-aes/ecdsa-aes","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@eliza-dot-aes/ecdsa-aes","version":"1.0.0","keywords":["crypto","aes","ecdsa","secp256k1","ethereum","encryption"],"author":{"name":"weimeme"},"license":"Apache-2.0","_id":"@eliza-dot-aes/ecdsa-aes@1.0.0","maintainers":[{"name":"weimeme","email":"weimeme067@gmail.com"}],"homepage":"https://github.com/weimeme/eliza-dot-aes#readme","bugs":{"url":"https://github.com/weimeme/eliza-dot-aes/issues"},"dist":{"shasum":"ab1793e4670f63e7790f89c5419c9f9708f0bbf8","tarball":"https://registry.npmjs.org/@eliza-dot-aes/ecdsa-aes/-/ecdsa-aes-1.0.0.tgz","fileCount":10,"integrity":"sha512-26ysUQvtBPHEBr3m9KKBybvqRVCiOeXyREMKO5GS4P6gghHQyoYJe+rQIlx6pvpvkVnz2ZJdNakLB07Af28eWQ==","signatures":[{"sig":"MEQCIHLRf15nZ4HXEjiyVkuEBcQ1dBg7kaUUNbQOpnI485J3AiA5cNhqrxUs6v5EEm3k5JIRwzknPoAXFbkVT4eUIcp8zA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":24784},"main":"lib/index.js","_from":"file:eliza-dot-aes-ecdsa-aes-1.0.0.tgz","types":"lib/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf lib","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"weimeme","email":"weimeme067@gmail.com"},"_resolved":"/private/var/folders/3m/smd11mdj437cp8hygdkk7d6h0000gn/T/e3bf26febc58eed9ce40c757c96ed3da/eliza-dot-aes-ecdsa-aes-1.0.0.tgz","_integrity":"sha512-26ysUQvtBPHEBr3m9KKBybvqRVCiOeXyREMKO5GS4P6gghHQyoYJe+rQIlx6pvpvkVnz2ZJdNakLB07Af28eWQ==","repository":{"url":"git+https://github.com/weimeme/eliza-dot-aes.git","type":"git"},"_npmVersion":"10.9.3","description":"AES encryption with ECDSA (secp256k1) cryptographic backend","directories":{},"_nodeVersion":"22.18.0","dependencies":{"@noble/curves":"^1.3.0","@eliza-dot-aes/common":"^1.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^5.0.0","vitest":"^1.0.0","typescript":"^5.0.0","@vitest/coverage-v8":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ecdsa-aes_1.0.0_1761467927547_0.8422135572865128","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@eliza-dot-aes/ecdsa-aes","version":"1.0.1","keywords":["crypto","aes","ecdsa","secp256k1","ethereum","encryption"],"author":{"name":"weimeme"},"license":"Apache-2.0","_id":"@eliza-dot-aes/ecdsa-aes@1.0.1","maintainers":[{"name":"weimeme","email":"weimeme067@gmail.com"}],"homepage":"https://github.com/weimeme/eliza-dot-aes#readme","bugs":{"url":"https://github.com/weimeme/eliza-dot-aes/issues"},"dist":{"shasum":"0f5fb6162b20750819335b21a2427823ae554be8","tarball":"https://registry.npmjs.org/@eliza-dot-aes/ecdsa-aes/-/ecdsa-aes-1.0.1.tgz","fileCount":9,"integrity":"sha512-Opx158V6jXgsDkmdAAlh+PC84WLQUShYLPavb3GbouFM8TicEQTW78TKpJq6dx2HivmQDMlKUvJ9XyO8DqMPbw==","signatures":[{"sig":"MEYCIQDQDHiUeuv1TUICiZEovaRedEif6+/CiILYD9oksAHXzAIhAOH3WPFSj2FIyH+rS5SnXeNLDziwNC7wxbhT2oXM1w3b","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25939},"main":"lib/index.js","_from":"file:eliza-dot-aes-ecdsa-aes-1.0.1.tgz","types":"lib/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf lib","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"weimeme","email":"weimeme067@gmail.com"},"_resolved":"/private/var/folders/3m/smd11mdj437cp8hygdkk7d6h0000gn/T/2d7cbb9297466183f6c56b30eb900d2d/eliza-dot-aes-ecdsa-aes-1.0.1.tgz","_integrity":"sha512-Opx158V6jXgsDkmdAAlh+PC84WLQUShYLPavb3GbouFM8TicEQTW78TKpJq6dx2HivmQDMlKUvJ9XyO8DqMPbw==","repository":{"url":"git+https://github.com/weimeme/eliza-dot-aes.git","type":"git"},"_npmVersion":"10.9.3","description":"AES encryption with ECDSA (secp256k1) cryptographic backend","directories":{},"_nodeVersion":"22.18.0","dependencies":{"list":"^2.0.19","@noble/curves":"^1.3.0","@eliza-dot-aes/common":"^1.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^5.0.0","vitest":"^1.0.0","typescript":"^5.0.0","@vitest/coverage-v8":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ecdsa-aes_1.0.1_1761476002233_0.9154142424943792","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@eliza-dot-aes/ecdsa-aes","version":"1.0.2","keywords":["crypto","aes","ecdsa","secp256k1","ethereum","encryption"],"author":{"name":"weimeme"},"license":"Apache-2.0","_id":"@eliza-dot-aes/ecdsa-aes@1.0.2","maintainers":[{"name":"weimeme","email":"weimeme067@gmail.com"}],"homepage":"https://github.com/weimeme/eliza-dot-aes#readme","bugs":{"url":"https://github.com/weimeme/eliza-dot-aes/issues"},"dist":{"shasum":"d96474b79a1eebe5ce51fdcbbd4bc6cb65c1d378","tarball":"https://registry.npmjs.org/@eliza-dot-aes/ecdsa-aes/-/ecdsa-aes-1.0.2.tgz","fileCount":6,"integrity":"sha512-L5cyR5Mq1a+rFLmlY/nuyOn1KkIE2V8aSJFErju5jdV6n1vgRxSWyebDgEsZGLrQ+9gfJhHM52ntlmytDLNfrA==","signatures":[{"sig":"MEUCIQDxoc7jwSuvbeV/js/kNjvOyyi9kfxCkFNjrz7f6RBtHQIgewydz8VuUhAEA17j0JJ4gFkB5/4uzTUwlSRKcl9XpsE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18717},"main":"lib/index.js","_from":"file:eliza-dot-aes-ecdsa-aes-1.0.2.tgz","types":"lib/index.d.ts","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf lib","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"weimeme","email":"weimeme067@gmail.com"},"_resolved":"/private/var/folders/3m/smd11mdj437cp8hygdkk7d6h0000gn/T/aa23a722a90d6af000cb2626c3224d1a/eliza-dot-aes-ecdsa-aes-1.0.2.tgz","_integrity":"sha512-L5cyR5Mq1a+rFLmlY/nuyOn1KkIE2V8aSJFErju5jdV6n1vgRxSWyebDgEsZGLrQ+9gfJhHM52ntlmytDLNfrA==","repository":{"url":"git+https://github.com/weimeme/eliza-dot-aes.git","type":"git"},"_npmVersion":"10.9.3","description":"AES encryption with ECDSA (secp256k1) cryptographic backend","directories":{},"_nodeVersion":"22.18.0","dependencies":{"list":"^2.0.19","@noble/curves":"^1.3.0","@eliza-dot-aes/common":"^1.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^5.0.0","vitest":"^1.0.0","typescript":"^5.0.0","@vitest/coverage-v8":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ecdsa-aes_1.0.2_1761478966011_0.42675317921828304","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@eliza-dot-aes/ecdsa-aes","version":"1.0.3","keywords":["crypto","aes","ecdsa","secp256k1","ethereum","encryption"],"author":{"name":"weimeme"},"license":"Apache-2.0","_id":"@eliza-dot-aes/ecdsa-aes@1.0.3","maintainers":[{"name":"weimeme","email":"weimeme067@gmail.com"}],"homepage":"https://github.com/ChainSupport/eliza-dot-aes#readme","bugs":{"url":"https://github.com/ChainSupport/eliza-dot-aes/issues"},"dist":{"shasum":"3fcf412401d5f6e7e9a237b4f010c5ace0c7ec4e","tarball":"https://registry.npmjs.org/@eliza-dot-aes/ecdsa-aes/-/ecdsa-aes-1.0.3.tgz","fileCount":3,"integrity":"sha512-S+0BVtWwNp625Yd7x7LP5tI7KTtVI5CqQiI+RnkctTpyD6P0LobE6jb0XNwPYigVtF5ZSHfQR0BUg5BPURcqgg==","signatures":[{"sig":"MEUCIBAxIC1DS2XrCrL3BeLdbynoRNdCv3jkMzSFSl0NAFR0AiEAggw7n34KRKyIdcUb9En7BKpOUIUqSKSYpvGdOwekWlI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5833},"main":"lib/index.js","types":"lib/index.d.ts","gitHead":"29bb7db386f2096df83ae3f3006658d2dfe378c2","scripts":{"test":"vitest run","build":"tsc","clean":"rimraf lib","test:watch":"vitest","test:coverage":"vitest run --coverage","prepublishOnly":"pnpm run clean && pnpm run build"},"_npmUser":{"name":"weimeme","email":"weimeme067@gmail.com"},"repository":{"url":"git+https://github.com/ChainSupport/eliza-dot-aes.git","type":"git"},"_npmVersion":"10.9.3","description":"AES encryption with ECDSA (secp256k1) cryptographic backend","directories":{},"_nodeVersion":"22.18.0","dependencies":{"list":"^2.0.19","@noble/curves":"^1.3.0","@eliza-dot-aes/common":"^1.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^5.0.0","vitest":"^1.0.0","typescript":"^5.0.0","@vitest/coverage-v8":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/ecdsa-aes_1.0.3_1762505849557_0.7152993294345937","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@eliza-dot-aes/ecdsa-aes","version":"1.0.4","description":"AES encryption with ECDSA (secp256k1) cryptographic backend","main":"lib/index.js","types":"lib/index.d.ts","scripts":{"build":"tsc","clean":"rimraf lib","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","prepublishOnly":"pnpm run clean && pnpm run build"},"publishConfig":{"access":"public"},"keywords":["crypto","aes","ecdsa","secp256k1","ethereum","encryption"],"author":{"name":"weimeme"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/ChainSupport/eliza-dot-aes.git"},"dependencies":{"@eliza-dot-aes/common":"^1.0.3","@noble/curves":"^1.3.0","list":"^2.0.19"},"devDependencies":{"@vitest/coverage-v8":"^1.0.0","rimraf":"^5.0.0","typescript":"^5.0.0","vitest":"^1.0.0"},"_id":"@eliza-dot-aes/ecdsa-aes@1.0.4","gitHead":"22540da4fb1ad6f90ad9293f7a1289e813653efb","bugs":{"url":"https://github.com/ChainSupport/eliza-dot-aes/issues"},"homepage":"https://github.com/ChainSupport/eliza-dot-aes#readme","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-O/7lEMa2Brf1CI5Hsr2MRik/7tcKh+8U5z/INrzLXWRhHcUZUl1byEZ4kZZhOkk8CF051ROrGqAfQy7qaRekLA==","shasum":"29ad650f88e51ac445798fe7cfc998260ae12445","tarball":"https://registry.npmjs.org/@eliza-dot-aes/ecdsa-aes/-/ecdsa-aes-1.0.4.tgz","fileCount":7,"unpackedSize":9086,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDCw4+WX4dyaBrMRtV/iRAfecGswCZlC+mXwiY8HQFDvAIgLiILtWYI++Zlvhvjy3bLV/LqyuU/lL/YxYxcqFCzT3k="}]},"_npmUser":{"name":"weimeme","email":"weimeme067@gmail.com"},"directories":{},"maintainers":[{"name":"weimeme","email":"weimeme067@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ecdsa-aes_1.0.4_1762509629934_0.12164802734671465"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-26T08:38:47.468Z","modified":"2025-11-07T10:00:30.319Z","1.0.0":"2025-10-26T08:38:47.734Z","1.0.1":"2025-10-26T10:53:22.444Z","1.0.2":"2025-10-26T11:42:46.217Z","1.0.3":"2025-11-07T08:57:29.749Z","1.0.4":"2025-11-07T10:00:30.123Z"},"bugs":{"url":"https://github.com/ChainSupport/eliza-dot-aes/issues"},"author":{"name":"weimeme"},"license":"Apache-2.0","homepage":"https://github.com/ChainSupport/eliza-dot-aes#readme","keywords":["crypto","aes","ecdsa","secp256k1","ethereum","encryption"],"repository":{"type":"git","url":"git+https://github.com/ChainSupport/eliza-dot-aes.git"},"description":"AES encryption with ECDSA (secp256k1) cryptographic backend","maintainers":[{"name":"weimeme","email":"weimeme067@gmail.com"}],"readme":"# @eliza-dot-aes/ecdsa-aes\n\nAES encryption implementation using secp256k1 ECDSA for key exchange.\n\n## Features\n\n- secp256k1 ECDSA key generation and exchange\n- AES-CBC encryption with HMAC-SHA512\n- Secure message padding and random prefix generation\n- TypeScript support with full type definitions\n- Compatible with Ethereum private keys\n\n## Installation\n\n```bash\npnpm add @eliza-dot-aes/ecdsa-aes\n```\n\n## Usage\n\nHere's a complete example showing how to encrypt and decrypt messages between two parties:\n\n```typescript\nimport { ECDSAAES } from '@eliza-dot-aes/ecdsa-aes';\n\nasync function main() {\n    // Initialize Alice and Bob with their private keys\n    // Note: These can be Ethereum private keys\n    const alice = await ECDSAAES.build(\n        \"0x9d61b19deffd5020afb5b1a7877f2e1e0a4f5c5e0a4f5c5e0a4f5c5e0a4f5c5e\"\n    );\n    const bob = await ECDSAAES.build(\n        \"0x9d61b19deffd5020afb5b1a7877f2e1e0a4f5c5e0a4f5c5e0a4f5c5e0a4f5c5d\"\n    );\n\n    // Wait for initialization (key generation)\n    // await new Promise(resolve => setTimeout(resolve, 100));\n\n    // Alice encrypts a message for Bob\n    const message = \"Hello Bob! This is a secret message from Alice.\";\n    const encryptedMessage = await alice.encryptMessage(message, bob.publicKey);\n    console.log(\"Encrypted:\", encryptedMessage);\n\n    // Bob decrypts Alice's message\n    const decryptedMessage = await bob.decryptMessage(encryptedMessage);\n    console.log(\"Decrypted:\", decryptedMessage);\n\n    // Bob sends a reply to Alice\n    const reply = \"Hi Alice! Got your message, here's my secret reply.\";\n    const encryptedReply = await bob.encryptMessage(reply, alice.publicKey);\n    console.log(\"Encrypted Reply:\", encryptedReply);\n\n    // Alice decrypts Bob's reply\n    const decryptedReply = await alice.decryptMessage(encryptedReply);\n    console.log(\"Decrypted Reply:\", decryptedReply);\n}\n\nmain().catch(console.error);\n```\n\n## API\n\n### ECDSAAES\n\nMain class for handling encrypted message operations.\n\n#### Constructor\n\n```typescript\nconstructor(seedOrprivateKey: string)\n```\n\n- `seedOrprivateKey`: Hexadecimal string of private key (can be an Ethereum private key)\n\n#### Methods\n\n```typescript\n// Encrypt a message\nasync encryptMessage(message: string, toPublicKey: Uint8Array): Promise<string>\n\n// Decrypt a message\nasync decryptMessage(message: string): Promise<string>\n```\n\n## Technical Details\n\n1. Key Generation:\n   - Uses secp256k1 curve (same as Ethereum)\n   - Compatible with existing Ethereum private keys\n   - Generates uncompressed public keys (65 bytes)\n\n2. Key Exchange:\n   - ECDH (Elliptic Curve Diffie-Hellman) on secp256k1\n   - Uses the noble/curves implementation for secure key operations\n   - Shared secret generation through ECDH\n\n## Security Features\n\n- Uses secp256k1 ECDH for secure key exchange\n- AES-256-CBC for symmetric encryption\n- HMAC-SHA512 for message authentication\n- Random padding for message length obfuscation\n- Secure key derivation from shared secrets\n- Compatible with Ethereum's cryptographic standards\n\n## Ethereum Compatibility\n\nThis package uses the same elliptic curve (secp256k1) as Ethereum, which means:\n- You can use your Ethereum private keys\n- Compatible with Ethereum key generation tools\n- Follows the same security standards as Ethereum\n\n## License\n\nApache License 2.0\n","readmeFilename":"README.md"}