Bitcoin Forum
May 06, 2024, 03:56:41 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Steal coins from unencrypted wallet after encryption  (Read 1685 times)
CYPER (OP)
Hero Member
*****
Offline Offline

Activity: 798
Merit: 502



View Profile
January 08, 2014, 05:08:02 PM
 #1

Imagine the following scenario: a thief had managed to steal an unencrypted wallet long time ago, which I now decide to encrypt and use.
If he doesn't know the encryption password, but has the same wallet from before encrypting it, can he spend any coins that I put in the wallet after encrypting it?

Thank you.
1715011001
Hero Member
*
Offline Offline

Posts: 1715011001

View Profile Personal Message (Offline)

Ignore
1715011001
Reply with quote  #2

1715011001
Report to moderator
BitcoinCleanup.com: Learn why Bitcoin isn't bad for the environment
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
Colin Miner
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile WWW
January 08, 2014, 07:40:36 PM
 #2

Yes.

This is why its important to shred unencrypted wallet backups after they have been replaced with the encrypted version.


Coins are not stored in the wallet, only private keys with their corresponding public key.

If the private key that is linked to coins is compromised, the coins can be spent.

FREE Namecoins (NMC), Devcoins (DVC) and IxCoins (iXC) while you mine Bitcoins (BTC) on the pool, in the cloud or both. Free to join, click here to Sign Up and mine your free coins.
Cheap VPS Hosting here or budget conscious Free cPanel hosting here. Buy BTC the safe and easy way at Localbitcoins.com (US and UK).
 "I'm no longer as confident as I was this morning." - xkeyscore89.  My Addie.cc.
more Free: BTC, LTC, FTC, TIPS, WDC, EAC & IFC
CYPER (OP)
Hero Member
*****
Offline Offline

Activity: 798
Merit: 502



View Profile
January 08, 2014, 08:00:16 PM
 #3

Yes.

This is why its important to shred unencrypted wallet backups after they have been replaced with the encrypted version.


Coins are not stored in the wallet, only private keys with their corresponding public key.

If the private key that is linked to coins is compromised, the coins can be spent.

I am aware of what the wallet contains, but when you encrypt your wallet you get a message that the old wallet will no longer work.
After some brief research I found that it prunes the entire pool of private keys and create a new one after encrypting, which is confusing to me.
BookLover
Hero Member
*****
Offline Offline

Activity: 533
Merit: 500


^Bitcoin Library of Congress.


View Profile
January 08, 2014, 08:40:55 PM
 #4

It is true that it prunes the "keypool", but this is simply a bunch of pre-generated keys which bitcoin-qt uses whenever it needs a new key. There's a lot more to this question than meets the eye but the simple answer is:

All coins in the addressess created before the encryption will be accessible to the thief.  This includes coins sent to these addresses before and after the encryption.

Colin Miner
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile WWW
January 08, 2014, 09:30:36 PM
 #5

Quote
When wallet passphrase enrcyption becomes enabled, any unused keys from the keypool are flushed (marked as used) and new keys protected with encyption are added.
from https://en.bitcoin.it/wiki/Wallet_encryption could be source of the confusion.

Which is cleared up by BookLover;
It is true that it prunes the "keypool", but this is simply a bunch of pre-generated keys which bitcoin-qt uses whenever it needs a new key. There's a lot more to this question than meets the eye but the simple answer is:

All coins in the addressess created before the encryption will be accessible to the thief.  This includes coins sent to these addresses before and after the encryption.

And you can prove this to yourself very easily. Just do what you are suggesting.

I have done this on my test rig, but you can follow this demo and see for yourself.

From the command console of bitcoin-qt:

21:07:10

dumpprivkey 12JCRJTxKjwbucjdP12hZwa9TeqLjsmAP8   <-- this dumps the private key for the specified address


21:07:10

L25HtjefAu1RAhVTFQToBqMJ8sedpBYXtuwuYBUkCsG6MBmsWMeQ   <-- this is the unencrypted private key of the address (no coins associated!)


encrypt wallet (test)  <-- I used the gui to encrypt the wallet with the pass phrase of 'test'


21:14:02

walletpassphrase test 6000  <-- this unlocks the wallet using the encryption key of 'test' for 6000 /units of time/


21:14:29

dumpprivkey 12JCRJTxKjwbucjdP12hZwa9TeqLjsmAP8  <-- with the wallet unlocked dump the private key again


21:14:29

L25HtjefAu1RAhVTFQToBqMJ8sedpBYXtuwuYBUkCsG6MBmsWMeQ  <-- and compare with the previous version


L25HtjefAu1RAhVTFQToBqMJ8sedpBYXtuwuYBUkCsG6MBmsWMeQ - the same!  Wink




FREE Namecoins (NMC), Devcoins (DVC) and IxCoins (iXC) while you mine Bitcoins (BTC) on the pool, in the cloud or both. Free to join, click here to Sign Up and mine your free coins.
Cheap VPS Hosting here or budget conscious Free cPanel hosting here. Buy BTC the safe and easy way at Localbitcoins.com (US and UK).
 "I'm no longer as confident as I was this morning." - xkeyscore89.  My Addie.cc.
more Free: BTC, LTC, FTC, TIPS, WDC, EAC & IFC
CYPER (OP)
Hero Member
*****
Offline Offline

Activity: 798
Merit: 502



View Profile
January 08, 2014, 10:05:23 PM
 #6

Thank you guys.
I have an old NMC wallet from 2011, which is probably safe, but one cannot be 100% sure.
So instead of testing out if a thief have a copy I will just create a new one and transfer the NMC there.
Colin Miner
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile WWW
January 08, 2014, 10:08:21 PM
 #7

So instead of testing out if a thief have a copy I will just create a new one and transfer the NMC there.
Yes, this has to be the safest way, move the coins to a new wallet that is properly secured  Smiley

FREE Namecoins (NMC), Devcoins (DVC) and IxCoins (iXC) while you mine Bitcoins (BTC) on the pool, in the cloud or both. Free to join, click here to Sign Up and mine your free coins.
Cheap VPS Hosting here or budget conscious Free cPanel hosting here. Buy BTC the safe and easy way at Localbitcoins.com (US and UK).
 "I'm no longer as confident as I was this morning." - xkeyscore89.  My Addie.cc.
more Free: BTC, LTC, FTC, TIPS, WDC, EAC & IFC
CYPER (OP)
Hero Member
*****
Offline Offline

Activity: 798
Merit: 502



View Profile
January 08, 2014, 10:10:33 PM
 #8

So instead of testing out if a thief have a copy I will just create a new one and transfer the NMC there.
Yes, this has to be the safest way, move the coins to a new wallet that is properly secured  Smiley

The coins are still at the pool and my dilema was to either use the old wallet (nostalgia seeing all these transactions from 2011) or a new one.

I am so paranoid sometimes, which in the Bitcoin world is a good thing  Grin

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!