123456789101112131415161718192021 |
- 'use strict'
- // import ecc from 'eosjs-ecc'
- // or
- const ecc = require('eosjs-ecc')
- // 公钥 EOS7Ncm9F6jq25HrTgnJ9hNo5QtdMuPRcPv8QvbmnHVJEnZHFwV7E
- // 秘钥 5K48UvhALZVd7hrq4CzrNL3GCvTAZ7s1dnMs9rLjbot8XNm9B1P
- // 密文 SIG_K1_KWp84G79nTuw4C11BXVoydCh6q9tFGP5y4UuCgqLB5WNA1p7MF3fJ6W155ggCLWjrxYwntym1kch3yAE9DxRsKzyG1XxJu
- // pk, $msg, $encoded_msg
- let data = process.argv[2];
- let pubkey = process.argv[3];
- let sign = process.argv[4];
- if (!data || !pubkey || !sign) {
- console.error('param is not valid.');
- return;
- }
- let flag = ecc.verify(sign, data, pubkey);
- console.log(flag);
|