Skip to main content
46 votes
Accepted

How to encrypt a message with the public-key of an Ethereum address

thx @Edmunx Edgar, i tried to use ECIES, but it failed to install because of a subdepencency. I now used the bitcore-lib together with bitcore-ecies. This works like expected. EDIT: I created a npm-...
pubkey's user avatar
  • 1,157
20 votes
Accepted

What the difference between Bitcoin and Ethereum private/public keys and address?

Yes and no. No - a Bitcoin address cannot be directly used in Ethereum, and vice versa. Yes - underneath, a bitcoin private key is essentially a random 256-bit number (in a certain range, see ...
Linmao Song's user avatar
  • 2,357
16 votes
Accepted

Ethereum wallet v3 format

It's a block cipher that uses a cryptographic hash function that encrypts or decrypts your private key of your Ethereum account. This is done after you generate a private key to encrypt the private ...
tayvano's user avatar
  • 16k
14 votes
Accepted

How to generate a keystore (UTC) file from the raw private key?

geth-compatible keystore file can be created in Node using ethereumjs-wallet library: > var Wallet = require('ethereumjs-wallet'); > var key = Buffer.from('...
max taldykin's user avatar
  • 2,966
13 votes

What the difference between Bitcoin and Ethereum private/public keys and address?

Just to add to the very good accepted answer: Coin | Address size | Address encoding | Address creation ---------+---------------------+------------------+------------------ Bitcoin | ...
Richard Horrocks's user avatar
12 votes

How to encrypt a message with the public-key of an Ethereum address

Assuming you have the public key of the person you want to send a message to (if they've already signed a transaction you can recover it from the signature) it should be possible to encrypt and ...
Edmund Edgar's user avatar
  • 16.9k
10 votes

Can smart contracts compute on encrypted data?

The short answer is no. There's a term for computing on encrypted data: homomorphic encryption. This is currently not usable for regular applications. If it were possible it would have huge positive ...
Physes's user avatar
  • 1,298
10 votes
Accepted

Current methods to send encrypted messages from contracts

You can't make an Ethereum contract start with plaintext and meaningfully encrypt a message, because all contract execution has to be verifiable by all the nodes in the network, so as you say ...
Edmund Edgar's user avatar
  • 16.9k
9 votes

Encrypted data in the block chain

Since the smart contract is replicated on all the nodes across the network, will every one be able to see all the contents of the smart contract? Short answer: yes. If the contract does the ...
Jamie Hale's user avatar
  • 1,005
9 votes
Accepted

Encrypting/Decrypting data on IPFS using Ethereum Public/Private key?

You'll need to the encrypt the data before storing on IPFS. But its not efficient to use ECIES encryption (which uses Ethrereum keys) on large data as its slow and Metamask will often hang. A good ...
pbsh's user avatar
  • 2,471
7 votes
Accepted

What algorithm is used to encrypt a private key?

The key is encrypted with 128-bit AES in Counter (CTR) mode.
CBobRobison's user avatar
  • 1,245
7 votes

What underlying protocols are used to send packets between nodes, and how are messages encrypted?

Ethereum uses DevP2P, which is a general protocol of discovery and connection of nodes, with an ethereum subprotocol defined on top of it (as opposed to the subprotocol of swarm, whisper, etc). You ...
Herman Junge's user avatar
  • 2,381
7 votes

Ethereum ecrecover signature verification and encryption

What exactly do v, r, and s stand for? r is the R.x value of the signature's R point. s is the signature proof for R.x v is a recovery parameter used to ease the signature verification. v is not ...
q9f's user avatar
  • 33k
7 votes
Accepted

Does Ethereum offer encrypted peer to peer communication applications?

Check out the Use Cases section in the Ethereum Whisper protocol at https://github.com/ethereum/wiki/wiki/Whisper-Overview : shh.post({ "topic": t, "payload": p }); No signature, no encryption: ...
BokkyPooBah's user avatar
  • 40.3k
7 votes

Unknown Keystore / Encrypted Wallet Format

I think this is a Bitgo privatekey backup format. I've created already a bitcoin account with Bitcold i've got after backuping my key a similar file: {"iv":"0fSuBvpAJG36OEGHC59VEg==","v":1,"iter":...
Badr Bellaj's user avatar
  • 18.8k
6 votes
Accepted

Make data from smartcontracts / events only visible for certain address/users

You cannot prevent anyone with access to the blockchain from reading state and executing code in any way they wish. You can encrypt data, but that doesn't prevent people from seeing it, just ...
Nick Johnson's user avatar
  • 8,174
6 votes
Accepted

"SSO-style" Login into app with web3.eth.accounts[0]

The knowledge of a public key (such as Ethereum addresses) should never be used as method of authentication. Public keys are meant to be shared, for instance to receive a payment in a cryptocurrency. ...
atfornes's user avatar
  • 225
6 votes
Accepted

What's a recommended way to pass secret in Solidity?

In the case where it is acceptable to perform the encryption and decryption off-chain, follow these four steps: Off-chain, use an encryption library to encrypt the message using the recipient's ...
pyggie's user avatar
  • 558
6 votes
Accepted

Decrypt message on-chain

You may use the following simple function to encrypt/decrypt arbitrary data on-chain: function encryptDecrypt (bytes memory data, bytes memory key) public pure returns (bytes memory result) { // ...
Mikhail Vladimirov's user avatar
5 votes
Accepted

If two keystore files have the same password, can it be figured out?

No. Passwords cannot be derived from transactions. Passwords encrypt your private keys. Two different keystore files have 2 different private keys and their encryption by the same password results in ...
user4069's user avatar
5 votes

Encrypted data in the block chain

When using public key cryptography (asymmetric cryptography) you have to differentiate between signing and encrypting. A signature is a proof of the data being signed by the owner of a certain public ...
atfornes's user avatar
  • 225
5 votes

Are communications encrypted?

No, they cannot trace your IP from the data stored in ethereum network. Your wallet, if it is Mist, it is actually writing the transaction data to your wn private Ethereum node and then only ...
niksmac's user avatar
  • 9,683
5 votes
Accepted

Using Ethereum for data encryption

You can extract an address and public key from a signature - see ecrecover. There are several approaches you could take to do what you want to accomplish. One would be to store public keys in a ...
dbryson's user avatar
  • 6,393
5 votes
Accepted

What is "a public key under ECIES", and how to get it?

ECIES is the Elliptic Curve Integrated Encryption Scheme. You should not wrap your head around the terminology too much, this is basically the crypto behind all Ethereum keypairs. To generate a new ...
q9f's user avatar
  • 33k
5 votes

How to use mnemonic to recovery my ethereum wallet

For Bip44 wallets Web3j will use the derivation path m/44/60'/0'/0. The more commonly used path is m/44/60'/0'/0/0 (with an extra /0). The following code will derive the correct address given a valid ...
Ismael's user avatar
  • 30.5k
5 votes
Accepted

Is it possible to have multiple private keys for a single public address?

An address is simply the last 20 bytes of the keccak256 hash of the public key. For ecdsa algorithms (and RSA), each private key has exactly one public key. However, when this public key is hashed ...
Raghav Sood's user avatar
  • 4,060
4 votes

Are communications encrypted?

The network is public, messages across it aren't encrypted and your ISP can see the transactions you're sending. Edit: I'm wrong, see @dbryson's comment.
Edmund Edgar's user avatar
  • 16.9k
4 votes
Accepted

Unlinkability between transactions to a smart contract

The short answer is no, this is not currently possible. There are technologies that would allow anonymous transactions, such as zkSNARKs, ring signatures, and homomorphic encryption, many of which ...
Tjaden Hess's user avatar
  • 37.2k
4 votes

Why is Ethereum's key generation so much faster than GPG's?

By default, GPG generates a 2048-bit RSA key. This requires generating a very large random number that has structural requirements to make it a valid RSA private key. So not any random number will do. ...
David Schwartz's user avatar
4 votes

Cryptography in a smart contract

Note that no matter if you are using an internal or external call, in order to decrypt something on-chain, you have to give the miners the private key, which is obviously not so private anymore. That ...
Sergei Tikhomirov's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible