<p>It is possible for some encrypted wallet to spend coins (<a href="https://play.google.com/store/apps/details?id=de.schildbach.wallet&amp;hl=en" rel="nofollow noreferrer">e.g. this one</a>) without requesting a decryption password or any other form a authentication. Of course, a password is requested when first importing the wallet file, but nothing after that. This seemingly means that a simple user process has access to my private keys. What prevents another process from replicating the same code and reading the same files so as to spend my coins? There appears to be a major vulnerability, which I am guessing is not real. What cryptographic trick is in play here, to allow such wallet behavior without exposing the user's private keys? </p>

<p><strong>EDIT</strong> The answer to the paradox stems from the fact that access to the file system on Android does not work in the same way as on a typical Linux distribution. A file owned by an app cannot be accessed by another app (unless the other app is root). This allows the Android wallet to decrypt the private keys (with password) when restoring a backup file, and save the unencrypted keys to a new file without compromising security. So it is possible for the wallet to spend coins without referring to the backup file again (which would require a password) and simply look for the private keys in the newly created file (which requires no password). (The Answer is due to <strong>Nick ODell and Andreas Schildbach</strong>, as can be seen <a href="https://bitcoin.stackexchange.com/questions/50553/how-do-i-programmatically-find-out-whether-this-phone-has-a-wallet-with-at-least/50559?noredirect=1#comment58708_50559">from the comments of this thread</a>).</p>

CC BY-SA 3.0
2017-01-12T12:39:41.330Z
As far as I know Bitcoin Wallet for Android does not have an encrypted wallet, only an encrypted backup.
Pieter Wuille
CC BY-SA 3.0
2017-01-13T20:20:34.263Z
@PieterWuille Thank you Pieter, yes in fact I had the Android wallet in mind when asking the question, and yes I was wrong to assume the wallet was encrypted (the backup certainly is). So really the question should have been "How can a wallet with encrypted backup spend coins without asking decryption password?" and the answer is (most likely), "It does so by decrypting the keys (with password) when restoring the wallet and keeping those keys without encyption in a separate file". This behavior is possible on Android, as files for a given app are not accessible by another app, unless root.
Sven Williamson
<wallet><encryption>
How can an encrypted wallet spend coins without asking for decryption password?
Sven Williamson
# How can an encrypted wallet spend coins without asking for decryption password?

(Asked by: username_0 on 2017-01-05)

It is possible for some encrypted wallet to spend coins ([e.g. this one](https://play.google.com/store/apps/details?id=de.schildbach.wallet&hl=en)) without requesting a decryption password or any other form a authentication. Of course, a password is requested when first importing the wallet file, but nothing after that. This seemingly means that a simple user process has access to my private keys. What prevents another process from replicating the same code and reading the same files so as to spend my coins? There appears to be a major vulnerability, which I am guessing is not real. What cryptographic trick is in play here, to allow such wallet behavior without exposing the user's private keys?

**EDIT** The answer to the paradox stems from the fact that access to the file system on Android does not work in the same way as on a typical Linux distribution. A file owned by an app cannot be accessed by another app (unless the other app is root). This allows the Android wallet to decrypt the private keys (with password) when restoring a backup file, and save the unencrypted keys to a new file without compromising security. So it is possible for the wallet to spend coins without referring to the backup file again (which would require a password) and simply look for the private keys in the newly created file (which requires no password). (The Answer is due to **Nick ODell and Andreas Schildbach**, as can be seen [from the comments of this thread](https://bitcoin.stackexchange.com/questions/50553/how-do-i-programmatically-find-out-whether-this-phone-has-a-wallet-with-at-least/50559?noredirect=1#comment58708_50559)).

**Tags:** wallet, encryption

> **Comments:**
> **username_1**: As far as I know Bitcoin Wallet for Android does not have an encrypted wallet, only an encrypted backup.  
> **username_0**: @username_1 Thank you username_1, yes in fact I had the Android wallet in mind when asking the question, and yes I was wrong to assume the wallet was encrypted (the backup certainly is). So really the question should have been "How can a wallet with encrypted backup spend coins without asking decryption password?" and the answer is (most likely), "It does so by decrypting the keys (with password) when restoring the wallet and keeping those keys without encyption in a separate file". This behavior is possible on Android, as files for a given app are not accessible by another app, unless root.  

---

## 0 answers

