Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [encryption]

Questions related to the encryption in Ethereum

Filter by
Sorted by
Tagged with
2 votes
1 answer
37 views

Public key encryption using metamask on solidity smart contract

Questions: In Solidity, how can we fetch the encrypted public key for the wallet directly from the smart contract using solidity? I have managed to retrieve it using JavaScript, but I need to know ...
No One's user avatar
  • 21
0 votes
0 answers
18 views

How to probe ownership of a MetaMask derived encryption public key?

If I were to store the messages targeted to a specific encryption public key generated by MetaMask (using x25519-xsalsa20-poly1305), how could I allow the recipient to authenticate and claim the ...
leonacostaok's user avatar
1 vote
0 answers
15 views

Given a public key, is it possible to create a challenge that would produce a known signature, if signed by the corresponding private key?

Noob alert! Since hardware wallets don't support decryptWithPrivateKey function, I would like to make a workaround using signatures If it's possible to create the challenge, that would produce a pre-...
Anton Makiievskyi's user avatar
0 votes
1 answer
49 views

encrypt address and save into smart contract

Is there any way I can encrypt my MetaMask wallet address and save this encrypted address in a Solidity smart contract? For example, encrypt the address off-chain and store it in the smart contract. ...
dustinioxyz's user avatar
1 vote
0 answers
29 views

Secure and deterministic browser symmetric key generation?

I would like to know, what are the best practices to solve the following problem: Imagine there's an Alice with browser and Ethereum account (connected with Metamask / Wallet connect / etc). She needs ...
Sergey Potekhin's user avatar
0 votes
0 answers
12 views

Treshold signature computing

I have two questions: Can someone point me to some solution providing multi-party {t,n}-threshold ECDSA? I imagine that such scehemes works first by creating an ECDSA private key then sharding it to ...
Hristo Todorov's user avatar
0 votes
0 answers
16 views

Signing a message which includes another signature

I'm trying to implement a commit-reveal scheme, where I also want to sign the input parameters to the Solidity function which commits the encrypted message. The signature verification of the input ...
user2340939's user avatar
1 vote
1 answer
157 views

Use private key to encode your own public address

Let's say I use a wallet's private key to encode/digitally sign it's own public address, meaning that upon using its public address to decrypt that encoded/signed data, the result would be the public ...
user2340939's user avatar
5 votes
1 answer
397 views

Now that eth_decrypt and eth_getEncryptionPublicKey are deprecated, is there a good way to encrypt and decrypt data via a user's private key?

The project I'm trying to make has this flow: User inputs some data It gets encrypted using their private key It gets stored to a place which is accessible to anyone but only the person in possession ...
AweSamarth's user avatar
1 vote
1 answer
40 views

Can an encrypted message be safely revealed

In this demo Alice is using Bob's public key to sign a message that only the Bob can decrypt. Is it safe for Bob to reveal this decrypted message, or would that allow an attacker to determine his ...
Origin's user avatar
  • 133
0 votes
1 answer
471 views

How to get Publickey of metamask by Public address?

I want to get Publickey of metamask by Public address
laravel Developer's user avatar
0 votes
2 answers
49 views

what is the best technique to encrypt any document before storing (uploading) on IPFS?

I want to encrypt document before uploading to IPFS and enable more than user to decrypt it and note that the number of users may increase or decrease in any time?
laravel Developer's user avatar
1 vote
0 answers
323 views

How to solve this error MetaMask - RPC Error: The requested account and/or method has not been authorized by the user?

I used below code from account 1 on metamask to encrypt certain text let encryptionPublicKey; await window.ethereum.request({ method: 'eth_getEncryptionPublicKey', params: [account1], // you must ...
laravel Developer's user avatar
0 votes
1 answer
359 views

What is the best way to store the private key to sign transactions on web3js

So I have a web3js script(bot), something along these lines: let walletAddress = "" let pvtKey = "" signed = await web3.eth.accounts.signTransaction(txObject, pvtKey); What is ...
Jonh Snow's user avatar
0 votes
1 answer
115 views

Is it possible to decrypt data on-chain so that others do not see it

I was wondering if it was possible to do secure encryption/decryption or signature and verification entirely on-chain? To my understanding, this is impossible because in order to sign a message we ...
RishtarCode47's user avatar
2 votes
0 answers
51 views

Decrypting a message using smart contract

Is this possible to send a message from address A to address B on Ethereum (or another type of blockchain), and it is so that address B can't open the message, unless a smart contract permits it ...
m0j1's user avatar
  • 177
2 votes
1 answer
419 views

Does a hardware wallet always generate the same seed phrase?

If I buy a new Ledger out of the box (untampered by the seller) and generate its seed phrase (Attempt #1), but then format the device to factory settings in order to once again re-generate a seed ...
user610620's user avatar
  • 1,528
3 votes
1 answer
750 views

Can two Ledgers generate the same seed phrase?

There’s millions of hardware wallets in existence right now generating 24 word seed phrases offline. Surely somewhere in the world there must be two or more devices that have generated the same seed ...
user610620's user avatar
  • 1,528
2 votes
3 answers
1k views

Is there any example of obfuscation or mechanism for Ethereum smart contract

I am trying to create an 'obfuscator' for Ethereum smart contracts, it can either obfuscate solidity code or the 'bytecode'. Is there any encryption techniques which can help in protecting 'sensitive ...
Dhruv's user avatar
  • 21
4 votes
1 answer
234 views

Why does Tornado Cash can not be attack by "front running attack"?

If a miner sees the transaction with the "Tornado Cash withdraw" in the mempool and decides to create another transaction of his own, how the Tornado Cash defeat this?
JESSE Bin's user avatar
  • 197
3 votes
2 answers
443 views

if I put a message's sha256() hash on smart contract, can anyone recoverd the message?

If no one can recover the message, can I use this message as a "password" to some functions in the smart contract? like: contract Test { bytes32 hash; constructor(bytes32 _hash) { ...
JESSE Bin's user avatar
  • 197
0 votes
0 answers
26 views

Allow decryption key to be known only after a certain time

We have a smart contract containing encrypted data that should remain encrypted till a specified timeLimit. Then, the decryption key would be made public, for everyone to read that data. We want to ...
explorer's user avatar
1 vote
1 answer
476 views

How to store an encrypted variable for each owner of an NFT that only they can decrypt?

Let's say, for example, we want to store a URL on-chain for a specific NFT, but we do not want anyone else to be able to see the URL. We can have a function in the contract that asks for an ID and ...
Bruffstar's user avatar
  • 111
0 votes
1 answer
675 views

Encrypt and decrypt string inside contract using contracts private|public key

I need to write down methods to encrypt and decrypt string messages using contract private | public keys in a smart contract. However you may think it's dangerous or anything else, the question is: Is ...
Mohammad Raha's user avatar
0 votes
1 answer
100 views

How encrypted and not encrypted data look like on Etherscan?

I would like to understand the importance of encrypting sensitive data before sending them to an Ethereum smart contract and its significant benefit compared to the case where we don't encrypt them. ...
Nikolas's user avatar
  • 15
0 votes
1 answer
20 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 ...
tanny's user avatar
  • 1
0 votes
1 answer
18 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 ...
phaze's user avatar
  • 1,595
0 votes
2 answers
34 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 ...
Brijesh's user avatar
  • 43
1 vote
0 answers
55 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 ...
user66732's user avatar
  • 455
1 vote
1 answer
598 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 ...
Nitbit's user avatar
  • 23
1 vote
1 answer
849 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 ...
BlueT's user avatar
  • 21
5 votes
1 answer
3k 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, ...
FromTheAshes's user avatar
2 votes
1 answer
1k 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 ...
Nikhil Mankani's user avatar
1 vote
0 answers
218 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-...
K A's user avatar
  • 11
0 votes
1 answer
471 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. ...
Ganesh Ghag's user avatar
0 votes
1 answer
227 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 ...
rbinnun's user avatar
  • 136
0 votes
2 answers
927 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 ...
quantum.snowball's user avatar
0 votes
1 answer
778 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 ...
codebird456's user avatar
0 votes
0 answers
225 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 ...
Amirali Sahraei's user avatar
0 votes
1 answer
112 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. ...
Bluefrogx's user avatar
0 votes
1 answer
1k 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 ...
user66732's user avatar
  • 455
1 vote
1 answer
247 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 ...
Marc's user avatar
  • 267
0 votes
2 answers
827 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 ...
Cumhur Canıgüz's user avatar
0 votes
1 answer
287 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 ...
ckrug's user avatar
  • 3
0 votes
1 answer
225 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 ...
Pooya Taheri's user avatar
1 vote
1 answer
2k 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 ...
YulePale's user avatar
  • 1,853
2 votes
2 answers
493 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 ...
user66732's user avatar
  • 455
3 votes
1 answer
444 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 ...
Bas Bastiaansen's user avatar
2 votes
1 answer
347 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 ...
Julian Martinez's user avatar
5 votes
0 answers
147 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 ...
Mikko Ohtamaa's user avatar