autdolore
v1.3.0
Published
Cryptographic functions for ethereum and how to use them with web3 and solidity
Downloads
24
Maintainers
Readme
eth-crypto
Cryptographic javascript-functions for ethereum and tutorials on how to use them together with web3js and solidity.
Tutorials
Creating Keys and use them for ethereum-transactions
In this tutorial we will create an ethereum-identity and use it so send transactions to the blockchain.
Sign and validate data with solidity
In this tutorial we will sign data in javascript and validate the signature inside of a smart-contract.
Sending encrypted and signed data to other identites
In this tutorial we will use the ethereum-identites and asymmetric cryptography to send an encrypted and signed message from Alice to Bob.
Functions
Install
npm install eth-crypto --save
// es6
import EthCrypto from 'eth-crypto';
// node
const EthCrypto = require('eth-crypto');
API
- createIdentity()
- publicKeyByPrivateKey()
- publicKey.toAddress()
- publicKey.compress()
- publicKey.decompress()
- sign()
- recover()
- recoverPublicKey()
- encryptWithPublicKey()
- decryptWithPrivateKey()
- cipher.stringify()
- cipher.parse()
- signTransaction()
- txDataByCompiled()
- calculateContractAddress()
- hex.compress() hex.decompress()