Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/pubkey/eth-crypto

Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity
https://github.com/pubkey/eth-crypto

blockchain cipher dapp encryption eth ethereum ethereum-identity privatekey publickey sign sign-data signature signtransaction smart-contracts solidity transaction truffle tutorial web3 web3js

Last synced: about 2 months ago
JSON representation

Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity

Lists

README

        





follow on Twitter

# 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](./tutorials/creating-transactions.md)**

In this tutorial we will create an ethereum-identity and use it so send transactions to the blockchain.

- **[Sign and validate data with solidity](./tutorials/signed-data.md)**

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](./tutorials/encrypted-message.md)**

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

```bash
npm install eth-crypto --save
```

```javascript
// es6
import EthCrypto from 'eth-crypto';

// node
const EthCrypto = require('eth-crypto');
```

## API

- [createIdentity()](https://github.com/pubkey/eth-crypto#createidentity)
- [publicKeyByPrivateKey()](https://github.com/pubkey/eth-crypto#publickeybyprivatekey)
- [publicKey.toAddress()](https://github.com/pubkey/eth-crypto#publickeytoaddress)
- [publicKey.compress()](https://github.com/pubkey/eth-crypto#publickeycompress)
- [publicKey.decompress()](https://github.com/pubkey/eth-crypto#publickeydecompress)
- [sign()](https://github.com/pubkey/eth-crypto#sign)
- [recover()](https://github.com/pubkey/eth-crypto#recover)
- [recoverPublicKey()](https://github.com/pubkey/eth-crypto#recoverpublickey)
- [encryptWithPublicKey()](https://github.com/pubkey/eth-crypto#encryptwithpublickey)
- [decryptWithPrivateKey()](https://github.com/pubkey/eth-crypto#decryptwithprivatekey)
- [cipher.stringify()](https://github.com/pubkey/eth-crypto#cipherstringify)
- [cipher.parse()](https://github.com/pubkey/eth-crypto#cipherparse)
- [signTransaction()](https://github.com/pubkey/eth-crypto#signtransaction)
- [txDataByCompiled()](https://github.com/pubkey/eth-crypto#txdatabycompiled)
- [calculateContractAddress()](https://github.com/pubkey/eth-crypto#calculatecontractaddress)
- [hex.compress() hex.decompress()](https://github.com/pubkey/eth-crypto#hex-compressdecompress)

# [READ THE FULL DOCUMENTATION ON GITHUB](https://github.com/pubkey/eth-crypto)