Questions tagged [encryption]
Questions related to the encryption in Ethereum
136
questions
0
votes
1
answer
3
views
missing encodePacket / .abi + keccak256
I'm not 100% sure how to describe my issue, total noob following the BlindAuction solidity tutorial and stuck unable to compile. any help is much appreciated.
function generateBlindedBidBytes32(uint ...
0
votes
0
answers
6
views
How to encrypt data stored on a blockchain?
I'm really new to web3 development and blockchain in general, so please excuse me if I am understanding something wrong.
So let's say a person wants to start a marketplace selling an item that they do ...
0
votes
0
answers
8
views
Decrypt Open SSL with a public key within Solidity contract
I wish to implement a whitelist function to my NFT minting solidity contract that also includes an NFT asset limit. For example, user A is allowed to mint 1 NFT, and user B 3 NFTs etc. I also wish to ...
0
votes
1
answer
11
views
Library for a local encrypted wallet
Is there any wallet/library that restricts access to a private key through encryption, but also allows certain actions to be performed by default, such as signing messages?
I would like to have code ...
0
votes
2
answers
14
views
Encryption or hashing with data
The data which we send via Ethereum blockchain , is it ecrypted and sent to sender only & never stored on blockchain OR is it hashed ?
Hashing is a one way process . It means that the data once ...
1
vote
0
answers
16
views
How to encrypt a message with multiple public keys for multiple recipients
Is it possible to encrypt a message using multiple Ethereum public keys for multiple recipients of a message, e.g. using
https://github.com/pubkey/eth-crypto#encryptwithpublickey
, so that each ...
0
votes
0
answers
44
views
Handling encryption of data in smart contract based app (specific scenario)
Small heads up, I'm a complete beginner, so many concepts are still unclear for me. Please correct me at any point if I'm talking nonsense.
My question is how should data stored in a smart contract be ...
1
vote
1
answer
107
views
Data decryption in a smart contract
I have an address named 'verifier' set in a smart contract.
A user has a message which is encrypted from verifier's private key. The user send this message in a transaction to contract.
How can we ...
1
vote
1
answer
219
views
Got different Public keys from same Private key. `eth-crypto`'s `recoverPublicKey()` and MetaMask's `eth_getEncryptionPublicKey`
Update (2022.03.25)
From @Ismael's comment and MetaMask github issue:
The key from MetaMask's eth_getEncryptionPublicKey rpc is NOT the Public Key of my account, but a different key calculated from ...
0
votes
0
answers
28
views
Wallet privatekey encryption
I'm currently developing a app with electron/reacts, and was wondering what's the best approach to encrypt private keys for wallets I generated.
Thanks in advance.
0
votes
1
answer
546
views
Encrypting/Decrypting data on IPFS using Ethereum Public/Private key?
I would like my app to connect to a Web3 wallet, store encrypted data on IPFS, then retrieve that data and decrypt it (without the user exposing their private key to my app).
Is this possible? If not, ...
1
vote
1
answer
318
views
Encryption using public key from eth_getEncryptionPublicKey metamask function
I'm trying to encrypt data/files before uploading them to IPFS and I want to do this using metamask provided public and private keys. For this, I have tried using eth_getEncryptionPublicKey but this ...
1
vote
0
answers
77
views
Decrypting data on chain and verifying the decryption is correct
I already know decrypting data on chain will reveal the key and the plaintext to everyone and for my use case that is exactly what I want.
I want to be able to build a contract that has a pre-...
0
votes
1
answer
65
views
storing encrypted data on ethereum and using encrypt decrypt offchain
All data stored on public blockchains like ethereum is available for public viewing.
All there any libraries, frameworks or solutions, for storing encrypted data inside smart contract data structures.
...
0
votes
1
answer
86
views
Minimum and Maximum Values Returned by keccak256
In the statement:
uint256 x = uint256(keccak256(abi.encodePacked(valuesToEncode)));
What’s the minimum and maximum possible values for x?
When I looped random valuesToEncode the smallest resulting ...
0
votes
0
answers
68
views
Malformed private key when attempting to sign transaction
I am attempting to sign a transaction but I get a malformed private key.
The code below is example code that I have cobbled together.
main.go
package main
import (
"bytes"
"...
0
votes
0
answers
42
views
Curious about the Math that makes Blockchain/Ethereum work ! Any good resources to learn it?
A bit of a background about me ; Computer Engineer but during my studies i didn't dive too deep into the maths , especially the crypto maths that makes the blockchain and cryptography work
looking for ...
0
votes
1
answer
275
views
Best practice to store private key for containerized apps in the cloud
I am a crypto investor. I am staking a coin but the smart contract requires the user to claim and restake the rewards by transacting a smart contract function every 24 hours. Currently I am doing it ...
0
votes
1
answer
207
views
Restore from ethereum keystore file results in an unusable private key
I have a keystore file from an old ellipal wallet with some eth with it.
The corresponding password is correct (I can use it to display the private key and keystore in it) and I can also run the ...
0
votes
0
answers
110
views
Encrypt and decrypt a string in solidity
I would like to write a function to encrypt a string by decreasing it's length then it will be possible to reach the original one too ( two way encryption ).
I don't care about the security. my ...
0
votes
1
answer
33
views
Is there a way to hide parameters in a smart contract?
Imagine we have a very simple contract which pays 1%, 1.2% or 3%(very special fee) on an anniversary basis.
But we don't want the different holders to know who are on what fee rate of others.
...
0
votes
1
answer
357
views
Public/Private Key encryption/decryption with wallet
The following case:
There is a dApp in place, connected with a wallet (e.g. Metamask). Wallets usually don't offer public/priate key encryption/decryption.
I want to decrypt a message for the owner of ...
1
vote
1
answer
122
views
How to securely decrypt game data inside smart contract
I have a problem I haven't been able to figure out, as follows: Suppose I have a game running on the blockchain (a solidity/smart contract game) where there are a limited number of plots of land that ...
0
votes
2
answers
168
views
Is there a bruteforce uses random private keys to find spesific public key as a lottery?
I actually know how private key and public key works. But I don't know how to brute force private key. In calculation it is impposible. But with luck anything is possible. What I mean is this: If we ...
0
votes
1
answer
114
views
Is it possible to intercept a message sent to a smart contract (i.e. a guess for a quiz) and send it as your own before the original reaches it?
I'm trying to write a smart contract that can be generated by an individual given ETH/ERC-20 value to lock and a secret passphrase (hashed). Then, given that another individual sends the passphrase in ...
0
votes
0
answers
25
views
Is it possible to use ethereum smart contracts for cryptocurrency exchange
I know ether can easily be accepted by smart contracts, however, would it be possible to exchange ether sent to the contract for another cryptocurrency? Wouldn't a private key need to be stored in the ...
0
votes
1
answer
141
views
How to securely send a message
I was wondering that can I encrypt a string, send it to a smart contract, for that to be decrypted only by some address's private key?
e.g "Hello" to be encrypted in a way that it would be ...
1
vote
1
answer
1k
views
Can you get the seed phrase of a HD wallet from the private key of one of the wallets?
Let us say I have a HD wallet. Can I get it’s seed phrase from the private key of one of its wallets?
Also are seed phrases just easy to remember private keys? If so does that mean that from the seed ...
2
votes
1
answer
373
views
ERC721 Metadata encrypted by owner's public/private key
Is there a good way to keep personal data (e.g. name, address , etc.) in the ERC721 metadata JSON, encrpyted with the public key of the owner, so that only the owner can decrypt it with his/her ...
3
votes
1
answer
357
views
Why doesn't web3.js/metamask have a decrypt with private key function yet?
For smart-contracts and dApps it is in many cases important to put encrypted data on the blockchain, encrypted with the public key.
I have been searching, but there doesn't seem to be a way to decrypt ...
1
vote
1
answer
113
views
Verifying ETH Deposit Contract signatures using Chainsafe BLS library
I am attempting to verify BLS signatures using the Chainsafe BLS library. I am attempting to independently verify signatures associated with deposits to the ETH Deposit Contract. In order to test that ...
3
votes
0
answers
97
views
Homomorphic encryption with Ethereum compatible chains
Are there any blockchains or even Ethereum mainnet contracts that would offer homomorphic encryption primitives and example code?
A sample use case would be homomorphic secret sharing that is needed ...
1
vote
1
answer
1k
views
Can we decrypt a message by using private key through Metamask
Say I have a hash of a file which is stored on IPFS.I want to encrypt the hash with public keys of few people.
How can I do the encryption of the hash (encrypted hash should be stored on smart ...
1
vote
2
answers
103
views
Store encrypted data on-chain VS on cloud
So, I am currently doing research for a project and an interesting question was born. If I have data that I want to store encrypted, why to choose blockchain instead of a cloud provider? Since the ...
5
votes
1
answer
289
views
What is the v part of transaction signature?
If I understand correctly when we send a transaction, we send an unsigned part m and a signature consisting of v, r, s. Each node verifies the signature by checking:
hash(m,r) * publicKey + r = s * ...
2
votes
0
answers
58
views
Confidential data encryption on blockchain
I already built a supply chain that is able to collect product information on Ethereum. Now, that data can be confidential, but I still want to do Matrix calculations on it. I came across homomorphic ...
1
vote
1
answer
76
views
Why is privateKey padded before secp256k1 signing?
I am checking how the Ethereum handles signing but I can't figure out why the math.PaddedBigBytes is necessary:
func Sign(digestHash []byte, prv *ecdsa.PrivateKey) (sig []byte, err error) {
if ...
1
vote
1
answer
440
views
Is it possible to have multiple private keys for a single public address? [duplicate]
Since the ratio of all possible digits (please correct my math if I am wrong) of a public key versus private is:
1/79228162514264337593543950336
for public (40^16): 1 461 501 637 330 902 918 203 684 ...
0
votes
1
answer
1k
views
How can I encrypt a file using an ethereum public address and decrypt it with the private address?
The expected outcome is very simple:
Users will send their ERC20s to a smart contract. Depending on the amount, each user will get a file specifically created for them. I want to distribute that ...
0
votes
1
answer
50
views
Data encryption
Since all data on the Blockchain is public. Presume I have multiple users submitting data which I want to hide, is there a way I can encrypt that data on the Blockchain ?
Or do I have to encrypt off-...
2
votes
1
answer
107
views
Algorithm used for symmetric key encryption by quorum
What are the symmetric key encryption techniques used by the enclave in quorum to encrypt the payload? The documentation of quorum mentions that the enclave uses a symmetric key to encrypt the payload ...
0
votes
1
answer
173
views
Asymmetric encryption with master Key
Is there any way i can derive private and public keypairs from a Master Key? The Master Key should be able to decrypt every encryption made with the generated Keypairs.
to explain a bit further i ...
1
vote
1
answer
271
views
How to store and encrypt Keys?
I am developing chrome extension like metamask for the private Chain. I have generated the keys and using localStorage to store the Keys. But I am not sure whether I am going correct or not for ...
0
votes
1
answer
426
views
Storing encrypted data and decrypt on-chain
The idea was to store the encrypted number of tokens,and when user was sending his private key, smart-contract would decrypt the data and perform an action of sending tokens to someone else. The catch ...
3
votes
1
answer
1k
views
Decrypt message on-chain
I want to store some data in smart contract and then decrypt it on chain. Pseudocode:
contract EncryptedData {
bytes data;
string public decryptedData;
constructor(bytes data_) public {
...
4
votes
2
answers
723
views
How to encrypt a file with multiple public address?
Can I encrypt a file with multiple public address such that each of them can decrypt the file using their private keys?
Thus achieving a system to securely store file on IPFS which can be accessed by ...
0
votes
1
answer
53
views
Assymetric encryption with only address
I would like to send an encrypted message to an address, without knowing their public key.
If I understand ECIES correctly, in order to send an encrypted ECIES message to a party, say Bob, I need to ...
0
votes
2
answers
130
views
Encryption and Decryption when transmitting data
If I was sending data to a smart contract, do I need to encrypt it before transmitting and decrypt it in the smart contract? Or is this done automatically?
0
votes
2
answers
414
views
Blockchain Smart Contract EHR
I'm trying to do a miny EHR(Electronical Health Record) with Smart Contracts where I have a Pacient Contract.
The problem is that in solidity everything is public, even the private variables, so I got ...
1
vote
1
answer
268
views
How to get decrypted transaction data in quorum?
On Quorum_Node1 I am sending a transaction with privateFor: parameter as follows:
eth.sendTransaction({from: eth.accounts[0], to: "0xca84356...9a3d0ccf92b8e",
data: web3.toHex('sample message for ...