https://jimmylab.wordpress.com/2018/12/05/ssh-docker-container/ CMD ["/usr/sbin/sshd", “-D”] https://hub.docker.com/r/rastasheep/ubuntu-sshd/

繼續閱讀

Very Important! {"107年工作":{"zhangqi":[{"name":"王大明1"},{"name":"孫小明1"}],"chaojiangeren":[{"name":"nnn1","addr":"aaa1"},{"name":"nnn2","addr":"aaa2"}]},"108年法會":{"zhangqi":[{"name":"王大明1"},{"name":"孫小明1"}]}} zhangqi : [ …. ] chaojiangeren: [ …. ] zhangqi : [ {….}, {….} ] chaojiangeren: [ {….}, {….} ] Can’t have \' or \" If have this, json.decode can’t List List=> ListList=> List List<ItemName> zhangqi = List<ItemName>(); zhangqi.add(new ItemName(name:"王大明1")); zhangqi.add(new ItemName(name:"孫小明1")); List<ItemNameAddr> chaojiangeren = List<ItemNameAddr>(); chaojiangeren.add(new ItemNameAddr(name:"nnn1", addr:"aaa1")); chaojiangeren.add(new ItemNameAddr(name:"nnn2", addr:"aaa2")); class ItemName { String name; ItemName({ this.name }) ; ItemName.fromJson(Map<String, dynamic> json) : name = json['name']; Map toJson() => {"name": name }; //給json.

繼續閱讀

https://medium.com/@antonassocareer/web3-secp256k1-%E7%B0%BD%E7%AB%A0%E8%88%87solidity%E9%A9%97%E7%AB%A0-26ded518cfdc phone vs secp256k1 vs ethereumjs-util 那代表 phone 產生的是符合ethereum的格式 但因為 signed的長度不符合標準的 secp256k1 ,所以只能用ethereumjs-util的工具,從fromRpcSig 匯入處理,取得 s r v ,後就能進行處理了! Elliptic 和 secp256k1 各別需要不同的方式,請閱code const secp256k1 = require('secp256k1') const ejsu = require('ethereumjs-util') Web3 = require("web3") var web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546'); // phone // private key // address 0xAD44A8ea9A9Bb5eF66F041BB921A687331729eB4 // Message Signature Has 0xa05ac71b16172777f683edbc48e9709cffd713a82630232d7c98e0f0df5201d60329658dba83b53fed49307e03d9663c0d2e4476c8b7925c2ed02cc7f881f5271b // Message Hello // public key 034e17dc4aef81e0ce6d16686be5e194274795375fc5525f1cdc46fe0b4643d5d6 console.log("\n----- phone -----\n") var buf_Signed = Buffer.from(web3.utils.hexToBytes("0xa05ac71b16172777f683edbc48e9709cffd713a82630232d7c98e0f0df5201d60329658dba83b53fed49307e03d9663c0d2e4476c8b7925c2ed02cc7f881f5271b")) var buf_pubkey = Buffer.

繼續閱讀

Sure ethereum signature is 65, but secp256k1 is 64 RangeError: signature length is invalid Web3 = require("web3") var web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546'); const secp256k1 = require('secp256k1') // or require('secp256k1/elliptic') // if you want to use pure js implementation in node //ethereum test https://github.com/ethereum/go-ethereum/blob/461291882edce0ac4a28f64c4e8725b7f57cbeae/crypto/signature_test.go msg = web3.utils.hexToBytes("0xd301ce462d3e639518f482c7f03821fec1e602018630ce621e1e7851c12343a6") signature = web3.utils.hexToBytes("0x638a54215d80a6713c8d523a6adc4e6e73652d859103a36b700851cb0e61b66b8ebfc1a610c57d732ec6e0a8f06a9a7a28df5051ece514702ff9cdff0b11f454") pubkey = web3.utils.hexToBytes("0x03ca634cae0d49acb401d8a4c6b6fe8c55b70d115bf400769cc1400f3258cd3138") console.log(secp256k1.verify(msg, signature, pubKey))

繼續閱讀

呼叫web3的部份,都需要使用ethereum geth,這部份有點麻煩 Call web3 must use ethereum, this mean need to run ganache or geth. No ok. jsrsasign is offline to compute ECDSA 相關的是 https://kjur.github.io/jsrsasign/sample/sample-ecdsa.html ===== https://medium.com/@angellopozo/ethereum-signing-and-validating-13a2d7cb0ee3 https://dzone.com/articles/signing-and-verifying-ethereum-signatures public address 只是 verify後拿來驗證是否相同 另一句話 verify後會產生public address,主要是拿sign後的值產生 r s v ,然後再用 合約的功能 ecrecover 處理 public address only for after verify product check Other way to explain is After verify get public address. Take signatures to make r s v, then use r s v with contract ecrecover().

繼續閱讀

作者的圖片

Sue boy

Sueboy Can support You

CIO

Taiwan