Questions tagged [cryptography]

Discipline or techniques employed in protecting integrity or secrecy of electronic messages by converting them into unreadable (cipher text) form.

Filter by
Sorted by
Tagged with
108
votes
2answers
71k views

How are ethereum addresses generated?

What criteria does a valid ethereum address need to fulfil? Is it just a random number in hexadecimal? Or does it need to be derived in a specific way, according to some cryptographic algorithm? What ...
85
votes
2answers
49k views

Which cryptographic hash function does Ethereum use?

Many sources refer to the use of the "SHA3" cryptographic hash function within Ethereum, but the Ethereum project began before the SHA3 standard was finalised, and there was some confusion/controversy ...
34
votes
3answers
15k views

Get public key of any ethereum account

Can I somehow get the public key of an ethereum account knowing just the corresponding ethereum address (e.g. 0x54dbb737eac5007103e729e9ab7ce64a6850a310)?
34
votes
2answers
3k views

What's a precompiled contract and how are they different from native opcodes?

The Yellow Paper states: These are four so-called ‘precompiled’ contracts, meant as a preliminary piece of architecture that may later become native extensions. The four contracts in addresses ...
28
votes
6answers
15k views

ecrecover from Geth and web3.eth.sign

I have tried to use ecrecover() to verify the signature of a message. I have looked at lots of references here and elsewhere, like: https://lab-blog.ey.com/2016/12/19/ecrecover/ How does one ...
27
votes
2answers
9k views

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

I am writing some code in nodejs/browser. I have successfully created ethereum-addresses with the secp256k1-library. I was also able to sign and verify messages. Now I want to encrypt/decrypt a ...
27
votes
5answers
8k views

How can I sign a piece of data with the private key of an Ethereum address?

I would like to use the key pair of one of my Ethereum accounts to sign a piece of data. How can this be done?
24
votes
3answers
3k views

Is Ethereum secure against an attack by quantum computers?

Does Ethereum implement Post-quantum cryptography? Or will the network break once a malicious actor gains control of an effective quantum computer?
23
votes
1answer
4k views

When can BLOCKHASH be safely used for a random number? When would it be unsafe?

I've seen more complicated ways for a contract to generate a random number. But the Ethereum Yellow Paper itself suggests a "trivial solution" using the BLOCKHASH opcode (see below, bold is mine). ...
23
votes
1answer
11k views

What does v, r, s in eth_getTransactionByHash mean?

In Ethereum JSON-RPC I found the return is: Returns Object - A transaction object, or null when no transaction was found: hash: DATA, 32 Bytes - hash of the transaction. nonce: QUANTITY - the number ...
22
votes
1answer
8k views

How can I verify a cryptographic signature that was produced by an Ethereum address key pair

If I have a cryptographic signature from an Ethereum address key pair, how can I verify that signature?
20
votes
3answers
4k views

How does Oraclize handle the TLSnotary secret?

Oraclize claims to offer a provably honest secure retrieval of a webpage by taking advantage of TLSnotary (a service that allows an auditor to verify if a specific web page was accurately retrieved) ...
18
votes
2answers
6k views

Why aren't Solidity sha3 hashes not matching what other sha3 libraries produce?

Solidity has a function named sha3 and I tested it with an empty string input. It is not matching what other sha3 libraries produce. I see contracts written by others using the same sha3 function ...
18
votes
3answers
4k views

Account uniqueness guaranteed?

When we create an account in the Ethereum main network, how does the protocol guarantee the unique address of an account? Since even if we are not connected to the network we can create an account, is ...
17
votes
1answer
629 views

Out of Gas invoking precompiled contracts on private blockchains

Why do precompiled contracts lead to Out of Gas on private blockchains? Some tidbits are provided in the Solidity docs but can it be explained more? It might be that you run into Out-of-Gas for ...
15
votes
3answers
1k views

What are effective and secure ways of shuffling a deck of cards in a contract?

We want to write a card game in Ethereum. What are effective and secure ways of shuffling a deck of cards in a contract, and dealing them to players? It needs to be done in a way so that no one can ...
15
votes
2answers
4k views

Is it safe to reuse Ether addresses?

I believe it's viewed as unsafe in Bitcoin because of the way transactions are signed. Is this also true for Ether addresses?
14
votes
1answer
2k views

Getting the wrong address back from ecrecover

When I sign a string using the following code I get back a different address to the one I signed with. The address returned is different for different strings. const util = require('ethereumjs-util') ...
13
votes
8answers
707 views

Would it be profitable enough to do a Master's degree in blockchain technologies (focused on ethereum above all)?

The end of my university studies is getting closer and closer. I'm sure I want to do a Masters degree, but I have some doubts. About a month ago my university released a Masters degree completely on ...
13
votes
1answer
633 views

Does Ethereum Suffer From Transaction Malleability?

Does Ethereum in its current form (Homestead, specifically Geth v1.3.6) have transaction malleability issues similar to Bitcoin? If so, is there a standard method for deriving a normalized hash for ...
12
votes
1answer
4k views

arguments of the sha256 function in Solidity

In Solidity, I find that the sha256 function can be used like this a = sha256(uint b, string c, bool d, ......) (the arguments can be a combination of different types, and the other types can also be ...
11
votes
1answer
6k views

How can I verify a signature with the web3 javascript API?

Using the javascript web3 API I can create a signature like this: > web3.eth.sign(eth.coinbase, "0xdeadbeef") "...
11
votes
2answers
1k views

Secure paper wallet creation for ETH using JS

I am about to start the process of transferring my ETH to paper wallets for safe keeping. Currently the funds are stored on an online exchange. History shows that this is a very bad idea. It is not ...
11
votes
1answer
719 views

Ethereum signature verification not matching

What I want to achieve is sign a message and then verify the signature whether verified by same address or not. Contract to Invoke ecrecover method to verify the address contract MyAuth { ...
10
votes
2answers
770 views

What are zkSNARKs? How do they work?

From my brief exposure to the concept, zkSNARKs seems to be a form of zero-knowledge cryptography. What can zkSNARKs bring to the table for Ethereum? I have looked at projects like this but still ...
10
votes
3answers
995 views

Can ZKSnarks be implemented on the Ethereum ecosystem?

Since Zcash seems to have it's ZKSnarks implementation finished (or almost at least). And versions of JPMorgan's Quorum had appeared with ZKsnarks implementations included see: https://www.coindesk....
9
votes
1answer
431 views

Are there any plans to switch Ethereum's primary hash algorithm from Keccak-256 to SHA3?

The Ethereum project was started before the SHA3 standard was finalised, and currently uses an earlier version of Keccak-256 which does not precisely match the FIPS-202 standard for SHA. Are there ...
8
votes
1answer
1k views

Why are Ethereum addresses hashes of public keys?

I understand how Ethereum addresses are generated. This thread has a great explanation: How are ethereum addresses generated? However, what this explanation is missing is why a hash is used. There ...
8
votes
1answer
4k views

Getting an address from ethereumjs-utils ecrecover

I am trying to sign a string using web3.eth.sign() and then get the public key I signed with from the signature. To do this I am using ecrecover() from ethereumjs-utils, which returns a buffer. When I ...
8
votes
4answers
1k views

How can I verify a secp256r1 signature using solidity

Sorry if you find these questions are basic, but I am new to encryption. As far as I know, Solidity have ecrecover function for this purpose, but it use secp256k1 signature. which I am intend to use ...
7
votes
2answers
557 views

How does the system enforce correct execution of smart contracts?

If I understand correctly, the smart contracts are run by the miners. What incentive do the miners have to execute the smart contracts correctly? What stops a malicious miner from changing the result, ...
7
votes
2answers
697 views

Store encrypted private keys on-chain

How secure is it to store encrypted private keys on chain ? Are the assets in the example below easer to brute-force than the master-key that encrypts them ? contract MyPrivateKeys { struct ...
6
votes
4answers
2k views

Proving the Existence of Logs to the Blockchain

To preface this: I'm not entirely sure this question makes any sense. Just a thought I had that I wanted to check the feasibility of. I'm pretty sure it is possible to use a Merkle proof to show that ...
6
votes
1answer
259 views

Any understandable cryptography book/article/lecture to introduce to signatures, hashes, ECDSA etc..? [closed]

It's a long time I'm searching for cryptography lectures related to ethereum inside mechanisms, and everything I found has a high mathematical level. I'm an engineer, not a mathematics, so any article ...
6
votes
1answer
264 views

Why are the last 20 bytes of the public key used as the address?

According to this post regarding how to derive the Ethereum address from a public key: Take the last 40 characters / 20 bytes of this public key (Keccak-256). Or, in other words, drop the first ...
5
votes
2answers
2k views

How to implement cryptographic algorithms in smart contracts?

I need to implement cryptographic algorithms such as AESCCM and elliptic curve algorithms (ECDSA, ECIES) within a smart contract. Is there any implementation of such algorithms in Solidity or Serpent? ...
5
votes
1answer
908 views

Authentication using ethereum account

Trying to figure out a way to Authenticate users them having an ethereum account. New to ethereum and cryptography in general and my thought may not be adequate. In essence I am thinking to be able ...
5
votes
1answer
461 views

Generate key in Ruby, import in Geth

I'm a Ruby newbie and I need to implement a Geth-compatible key import/export in Ruby. I was looking at the Geth implementation in Go, as well as keythereum. For generating the key, I am using the ...
5
votes
1answer
153 views

How can one use the tokens provided by a crowdfunding platform?

I was reading about Weifund crowdfunding. In it, some custom crypto-tokens are provided to investors in exchange for an invested amount. I just want to know how will that investor use that token so ...
5
votes
1answer
1k views

Ethereum Authentication/Authorization

Lately I've been thinking about how to integrate Ethereum with other non-Ethereum systems. Would it be a bad idea to import and Ethereum keypair into an external (mobile/desktop) application, which ...
4
votes
2answers
3k views

How Ethereum confirm the transaction?

Am I right, that Ethereum do it the same way as Bitcoin (Bitcoin dev guide), and the only difference is that the Ethereum use it's own OP_CODES? UPD I mean, what is the Ethereum's alternative for &...
4
votes
1answer
110 views

Can an Ethereum key generated on a laptop be brute-forced by someone else because of low entropy?

I read this and this tweets. Though, I understand that this issue occur because some people use the same private key mentioned in a blog/forum. But, on the first tweet, people were talking about the ...
4
votes
2answers
381 views

What if a dishonest node execute a different program on EVM?

I want to create a program (on the Ethereum Virtual Machine), that can access some data under certains condition (only if authorized). So the program checks the authorization, and then (eventually) ...
4
votes
1answer
362 views

Why doesn't Ethereum do double hashing like Bitcoin?

Why doesn't Ethereum do double hashing like Bitcoin? What are the facts or theories on the security of single Keccak-256 hashing like Ethereum, as compared to Bitcoin's double hashing with SHA2-256? ...
4
votes
1answer
261 views

Does a greater number of hashing rounds in aes-128-ctr scrypt key generation mean stronger encryption?

Consider the following Ethereum account I created at MyEtherWallet: { version: 3, id: '4447b704-e28c-4e93-8b1d-32f519b46692', address: '115312fc0ab77a0fb15a66baf51f58baefcee1dd', Crypto: { ...
4
votes
1answer
303 views

How to use Ethereum precompile bn256Pairing to check equality on symmetric groups?

The address 0x8 contains bn256Pairing pre-compiled contract on Byzantium release. I have the following questions : If I have G_1 = G_2, i.e., a symmetric pairing, is it possible to check e(a_1, b_1) ?...
3
votes
2answers
3k views

How can I get a mnemonic phrase from a private key?

I have a private key for my wallet and also a keystore for it. I want to use it in MEWConnect. Is there a way to get a mnemonic phrase from a private key?
3
votes
1answer
286 views

Why does a signed transaction include a “hash” field?

When signing a transaction using the go-ethereum library, the resulting object looks something like this: "tx": { "nonce": "0x7", "gasPrice": "0x77359400", "gas": "0x5208", ...
3
votes
2answers
209 views

Confidential value transfers

Is there currently any way to do confidential transactions with Ethereum for a custom token? If not, is there any work/research being done on how this might be possible?
3
votes
1answer
328 views

Does Ethereum support pairing operations?

I need to build an application that uses bilinear pairing operations for generating signatures. If I send a message with its signature to Ethereum, can Ethereum verify this message? Does the EVM ...