Gathering detailed insights and metrics for eosjs-ecc-priveos
Gathering detailed insights and metrics for eosjs-ecc-priveos
Gathering detailed insights and metrics for eosjs-ecc-priveos
Gathering detailed insights and metrics for eosjs-ecc-priveos
npm install eosjs-ecc-priveos
Typescript
Module System
Node Version
NPM Version
62.2
Supply Chain
97.7
Quality
73.4
Maintenance
100
Vulnerability
99.3
License
JavaScript (96.09%)
Shell (3.91%)
Total Downloads
3,441
Last Day
1
Last Week
2
Last Month
3
Last Year
203
288 Stars
131 Commits
120 Forks
53 Watching
22 Branches
10 Contributors
Latest Version
4.0.8
Package Id
eosjs-ecc-priveos@4.0.8
Unpacked Size
969.28 kB
Size
265.56 kB
File Count
21
NPM Version
6.7.0
Node Version
11.14.0
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
100%
2
Compared to previous week
Last month
-87%
3
Compared to previous month
Last year
-65.7%
203
Compared to previous year
Private Key, Public Key, Signature, AES, Encryption / Decryption
1import ecc from 'eosjs-ecc-priveos' 2// or 3const ecc = require('eosjs-ecc-priveos')
npm install eosjs-ecc
1<html> 2<head> 3 <meta charset="utf-8"> 4 <!-- 5 sha512-cL+IQQaQ586s9DrXfGtDheRpj5iDKh2M+xlpfwbhNjRIp4BGQ1fkM/vB4Ta8mc+f51YBW9sJiPcyMDIreJe6gQ== lib/eosjs-ecc.js 6 sha512-dYFDmK/d9r3/NCp6toLtfkwOjSMRBaEzaGAx1tfRItC0nsI0hVLERk05iNBQR7uDNI7ludYhcBI4vUiFHdjsTQ== lib/eosjs-ecc.min.js 7 sha512-eq1SCoSe38uR1UVuQMwR73VgY8qKTBDc87n2nIiC5WLhn1o2y1U6c5wY8lrigVX7INM8fM0PxDlMX5WvpghKig== lib/eosjs-ecc.min.js.map 8 --> 9 <script src="https://cdn.jsdelivr.net/npm/eosjs-ecc@4.0.4/lib/eosjs-ecc.min.js" 10 integrity="sha512-dYFDmK/d9r3/NCp6toLtfkwOjSMRBaEzaGAx1tfRItC0nsI0hVLERk05iNBQR7uDNI7ludYhcBI4vUiFHdjsTQ==" 11 crossorigin="anonymous"></script> 12 13</head> 14<body> 15 See console object: eosjs_ecc 16</body> 17</html>
Type: string
EOSKey..
Type: string
Initialize by running some self-checking code. This should take a second to gather additional CPU entropy used during private key generation.
Initialization happens once even if called multiple times.
Returns Promise
Does not pause to gather CPU entropy.
Returns Promise<PrivateKey> test key
cpuEntropyBits
number gather additional entropy
from a CPU mining algorithm. This will already happen once by
default. (optional, default 0
)1ecc.randomKey().then(privateKey => { 2console.log('Private Key:\t', privateKey) // wif 3console.log('Public Key:\t', ecc.privateToPublic(privateKey)) // EOSkey... 4})
seed
string any length string. This is private. The same
seed produces the same private key every time. At least 128 random
bits should be used to produce a good private key.1ecc.seedPrivate('secret') === wif
Returns wif
1ecc.privateToPublic(wif) === pubkey
Returns pubkey
1ecc.isValidPublic(pubkey) === true
Returns boolean valid
wif
wif1ecc.isValidPrivate(wif) === true
Returns boolean valid
Create a signature using data or a hash.
data
(string | Buffer)privateKey
(wif | PrivateKey)encoding
String data encoding (if string) (optional, default 'utf8'
)1ecc.sign('I am alive', wif)
Returns string string signature
dataSha256
(String | Buffer) sha256 hash 32 byte buffer or stringprivateKey
(wif | PrivateKey)encoding
String dataSha256 encoding (if string) (optional, default 'hex'
)Returns string string signature
Verify signed data.
signature
(string | Buffer) buffer or hex stringdata
(string | Buffer)pubkey
(pubkey | PublicKey)encoding
(optional, default 'utf8'
)hashData
boolean sha256 hash data before verify (optional, default true
)1ecc.verify(signature, 'I am alive', pubkey) === true
Returns boolean
Recover the public key used to create the signature.
signature
(String | Buffer) (EOSbase58sig.., Hex, Buffer)data
(String | Buffer) full dataencoding
String data encoding (if data is a string) (optional, default 'utf8'
)1ecc.recover(signature, 'I am alive') === pubkey
Returns pubkey
signature
(String | Buffer) (EOSbase58sig.., Hex, Buffer)dataSha256
(String | Buffer) sha256 hash 32 byte buffer or hex stringencoding
String dataSha256 encoding (if dataSha256 is a string) (optional, default 'hex'
)Returns PublicKey
data
(string | Buffer) always binary, you may need Buffer.from(data, 'hex')resultEncoding
(optional, default 'hex'
)encoding
string result encoding 'hex', 'binary' or 'base64' (optional, default 'hex'
)1ecc.sha256('hashme') === '02208b..'
1ecc.sha256(Buffer.from('02208b', 'hex')) === '29a23..'
Returns (string | Buffer) Buffer when encoding is null, or string
1let {PrivateKey, PublicKey, Signature, Aes, key_utils, config} = require('eosjs-ecc')
2
3// Create a new random private key
4let privateWif
5PrivateKey.randomKey().then(privateKey => privateWif = privateKey.toWif())
6
7// Convert to a public key
8pubkey = PrivateKey.fromString(privateWif).toPublic().toString()
1git clone https://github.com/EOSIO/eosjs-ecc.git 2cd eosjs-ecc 3npm install 4npm run build_browser 5# builds: ./dist/eosjs-ecc.js 6# Verify release hash
1<script src=eosjs-ecc.js></script>
1var ecc = eosjs_ecc 2 3ecc.randomKey().then(privateWif => { 4 var pubkey = ecc.privateToPublic(privateWif) 5 console.log(pubkey) 6})
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 8/14 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
60 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More