<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wolf0</id>
	<title>Bitcoin Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Wolf0"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/Wolf0"/>
	<updated>2026-04-23T09:54:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=OpenSourceEncryptionSoftware&amp;diff=39072</id>
		<title>OpenSourceEncryptionSoftware</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=OpenSourceEncryptionSoftware&amp;diff=39072"/>
		<updated>2013-07-03T23:55:44Z</updated>

		<summary type="html">&lt;p&gt;Wolf0: /* Home page, Download, Donation, and Documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==dm-crypt==&lt;br /&gt;
===Description===&lt;br /&gt;
Dm-crypt is part of the Linux Kernel. Some distributions might not include it in their kernel configurations, however. It is a lot like TrueCrypt: it allows you to mount encrypted files or partitions and decrypt/encrypt them on-the-fly.&lt;br /&gt;
===Manual setup===&lt;br /&gt;
Your distro probably comes with a tool to simplify using dm-crypt (also see Tomb below). However, here is how you would manually mount a file-hosted dm-crypt volume. The [http://www.paranoiacs.org/~sluskyb/hacks/hashalot/ hashalot] tool is used to prompt you for and process your password. This is used both to create the device and access it:&lt;br /&gt;
 losetup /dev/loop0 ~/encrypted&lt;br /&gt;
 HASH=`hashalot -s InsertSaltHere sha256 | hexdump -e &#039;32/1 &amp;quot;%02x&amp;quot;&#039;`&lt;br /&gt;
 echo 0 `blockdev --getsize /dev/loop0` crypt aes-cbc-essiv:sha256 \&lt;br /&gt;
 $HASH 0 /dev/loop0 0 | dmsetup create dmDevice&lt;br /&gt;
 mount /dev/mapper/dmDevice /mnt/encrypted&lt;br /&gt;
* Losetup makes the container file (~/encrypted in this case) act like a device.&lt;br /&gt;
* The hashalot command prompts you for a password and then hashes it, adding the specified salt. The salt should be random, but it mustn&#039;t change.&lt;br /&gt;
* The hexdump command puts the binary hashalot output into the format required for dm-crypt&lt;br /&gt;
* Dm-crypt is set up on the /dev/loop0 device created by losetup. It uses the password hash created previously. The aes-cbc-essiv:sha256 encryption method is secure, though probably not as secure as Truecrypt&#039;s XTS method, which does not appear to be available in official kernel releases as far as I can tell. The dm-crypt device is created as /dev/mapper/dmDevice in this example.&lt;br /&gt;
* The device is mounted. Before you do this for the first time, you need to run mke2fs. If you ever enter the wrong password, the device will appear to contain random data and attempting to mount it will fail.&lt;br /&gt;
&lt;br /&gt;
==eCryptfs==&lt;br /&gt;
===Description===&lt;br /&gt;
eCryptfs is a POSIX-compliant enterprise-class stacked cryptographic filesystem for Linux.&lt;br /&gt;
===Download===&lt;br /&gt;
[https://launchpad.net/ecryptfs Latest source link on right side of page.]&lt;br /&gt;
&lt;br /&gt;
[https://launchpad.net/ecryptfs/+download All downloads.]&lt;br /&gt;
===Examples===&lt;br /&gt;
Examples can be found in Damien Oh&#039;s article [http://www.makeuseof.com/tag/encrypt-your-files-in-linux-with-ecryptfs/ How To Encrypt Files in Linux with eCryptfs.]&lt;br /&gt;
===FAQ===&lt;br /&gt;
[http://ecryptfs.sourceforge.net/ecryptfs-faq.html FAQ]&lt;br /&gt;
===HomePage===&lt;br /&gt;
[https://launchpad.net/ecryptfs eCryptfs - Enterprise Cryptographic Filesystem]&lt;br /&gt;
===License===&lt;br /&gt;
[https://launchpad.net/ubuntu/natty/+source/ecryptfs-utils/+copyright GPL 2+]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==OpenSSL==&lt;br /&gt;
===Description===&lt;br /&gt;
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a full-strength general purpose cryptography library.&lt;br /&gt;
===Donation===&lt;br /&gt;
[http://www.openssl.org/support/donations.html Donation page.]&lt;br /&gt;
===Download===&lt;br /&gt;
[http://www.openssl.org/source/ Source]&lt;br /&gt;
===Examples===&lt;br /&gt;
Based on Grondilu&#039;s [http://www.bitcoin.org/smf/index.php?topic=2458.msg33379#msg33379 post,] to encrypt the wallet, from a terminal in the bitcoin parent directory, type:&lt;br /&gt;
&lt;br /&gt;
openssl enc -aes256 -in ./.bitcoin/wallet.dat -out wallet.aes256&lt;br /&gt;
&lt;br /&gt;
From [http://www.madboa.com/people/paul/ Paul Heinlein&#039;s] [http://www.madboa.com/geek/openssl/ openssl command line how to,] to decode, add the &#039;-d&#039; option, set the &#039;-in&#039; option to the output file name, to type:&lt;br /&gt;
&lt;br /&gt;
openssl enc -d -aes256 -in wallet.aes256 -out wallet.dat&lt;br /&gt;
&lt;br /&gt;
There is a small shell script that automates the whole process of 1) decrypting wallet 2) launching Bitcoin 3) encrypting the wallet afterwards and cleaning up the unencrypted bits. [http://lorelei.kaverit.org/bitcoin.sh bitcoin-launch-script]&lt;br /&gt;
&lt;br /&gt;
==CCrypt==&lt;br /&gt;
===Description===&lt;br /&gt;
&#039;&#039;&#039;CCrypt&#039;&#039;&#039; is a linux command-line utility by Peter Selinger[http://www.mathstat.dal.ca/~selinger/] that replaces the Unix &#039;&#039;crypt&#039;&#039; command. &#039;&#039;&#039;CCrypt&#039;&#039;&#039; is much more secure than &#039;&#039;crypt&#039;&#039; because it uses the Rijndael block cipher, the same encryption algorithm as AES and SSL, the algoirthms of choice for the US government and the commercial banking industry. The command line syntax for &#039;&#039;&#039;ccrypt&#039;&#039;&#039; is a bit simpler than &#039;&#039;openssl&#039;&#039; because it doesn&#039;t require the user to select an encryption algorithm or name the output file, but merely specify the direction (encrypt or decrypt).&lt;br /&gt;
&lt;br /&gt;
===Download===&lt;br /&gt;
Download the source code version of your choice at [http://ccrypt.sourceforge.net downloads] such as [http://ccrypt.sourceforge.net/download/ccrypt-1.9.tar.gz v1.9]&lt;br /&gt;
&lt;br /&gt;
or in a Debian distribution like Ubuntu just execute&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install ccrypt&lt;br /&gt;
&lt;br /&gt;
===Examples===&lt;br /&gt;
To encrypt your wallet:&lt;br /&gt;
&lt;br /&gt;
    ccrypt ~/.bitcoin/wallet.dat&lt;br /&gt;
&lt;br /&gt;
To decrypt the file created above:&lt;br /&gt;
&lt;br /&gt;
    ccdecrypt ~/.bitcoin/wallet.dat.cpt&lt;br /&gt;
&lt;br /&gt;
or &lt;br /&gt;
    ccrypt -d ~/.bitcoin/wallet.dat.cpt&lt;br /&gt;
&lt;br /&gt;
===FAQ===&lt;br /&gt;
[http://ccrypt.sourceforge.net/faq.html FAQ]&lt;br /&gt;
&lt;br /&gt;
===HomePage===&lt;br /&gt;
[http://ccrypt.sourceforge.net/ Ccrypt Project on SourceForge]&lt;br /&gt;
&lt;br /&gt;
===License===&lt;br /&gt;
[http://www.gnu.org/copyleft/gpl.html GNU General Public License.]&lt;br /&gt;
&lt;br /&gt;
==Tomb==&lt;br /&gt;
===Description===&lt;br /&gt;
Tomb is a simple tool to manage encrypted storage on GNU/Linux.&lt;br /&gt;
&lt;br /&gt;
Tomb generates encrypted storage files to be opened and closed using&lt;br /&gt;
their associated keyfiles, which are also protected with a password&lt;br /&gt;
chosen by the user.&lt;br /&gt;
&lt;br /&gt;
A tomb is like a locked folder that can be safely transported and&lt;br /&gt;
hidden in a filesystem; its keys can be kept separate, for instance&lt;br /&gt;
keeping the tomb file on your computer harddisk and the key files on a&lt;br /&gt;
USB stick.&lt;br /&gt;
&lt;br /&gt;
===HomePage===&lt;br /&gt;
[http://tomb.dyne.org Tomb - Crypto Undertaker]&lt;br /&gt;
&lt;br /&gt;
===Donation===&lt;br /&gt;
[http://dyne.org/donate Donation page]&lt;br /&gt;
&lt;br /&gt;
===Download===&lt;br /&gt;
[http://apt.dyne.org Binaries (WIP: Debian and Ubuntu)]&lt;br /&gt;
&lt;br /&gt;
[http://ftp.dyne.org/tomb Source]&lt;br /&gt;
&lt;br /&gt;
===License===&lt;br /&gt;
[http://www.truecrypt.org/legal/license True Crypt Open Source License.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==True Crypt==&lt;br /&gt;
===Description===&lt;br /&gt;
Open-source disk encryption software for Windows 7/Vista/XP, Mac OS X, and Linux.  True Crypt creates a virtual encrypted disk within a file and mounts it as a real disk.&lt;br /&gt;
===Documentation===&lt;br /&gt;
[http://www.truecrypt.org/docs/ Documentation page.]&lt;br /&gt;
===Donation===&lt;br /&gt;
[http://www.truecrypt.org/donations/?lnk=5 Donation page.]&lt;br /&gt;
===Download===&lt;br /&gt;
[http://www.truecrypt.org/downloads Binaries]&lt;br /&gt;
&lt;br /&gt;
[http://www.truecrypt.org/downloads2 Source]&lt;br /&gt;
===FAQ===&lt;br /&gt;
[http://www.truecrypt.org/faq FAQ]&lt;br /&gt;
===HomePage===&lt;br /&gt;
[http://www.truecrypt.org/ TrueCrypt]&lt;br /&gt;
===License===&lt;br /&gt;
[http://www.truecrypt.org/legal/license True Crypt Open Source License.]&lt;br /&gt;
&lt;br /&gt;
==xorsplit==&lt;br /&gt;
===Description===&lt;br /&gt;
Open-source software for Linux.  xorsplit copies a file into 3 separate &lt;br /&gt;
backup files.  Any two of the backup files are sufficient to reconstruct&lt;br /&gt;
the original -- but any one of the files will yield at most half of&lt;br /&gt;
the original information (the odd bytes or the even bytes).  &lt;br /&gt;
  &lt;br /&gt;
Optionally, each of the backup files can be encrypted with a password.&lt;br /&gt;
&lt;br /&gt;
===Home page, Download, Donation, and Documentation===&lt;br /&gt;
[http://www.xorsplit.com/ xorsplit.com] (Down)&lt;br /&gt;
&lt;br /&gt;
===License===&lt;br /&gt;
[http://www.xorsplit.com/xorsplit.c  BSD-style Open Source License requiring&lt;br /&gt;
that the donation address remain unchanged.]&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
xorsplit file   -- splits the file into file.1, file.2, and file.3&lt;br /&gt;
&lt;br /&gt;
xorsplit-p file -- same, but requesting a password (no password means no encryption)&lt;br /&gt;
&lt;br /&gt;
xorsplit file.3 file.1 outfile   -- combine file.1 and file.3 into outfile.&lt;br /&gt;
&lt;br /&gt;
xorsplit-p file.3 file.1 outfile -- same, after using the password to decrypt&lt;br /&gt;
&lt;br /&gt;
==GNU Privacy Guard==&lt;br /&gt;
===Description===&lt;br /&gt;
GnuPG allows to encrypt and sign your data.&lt;br /&gt;
&lt;br /&gt;
===Homepage===&lt;br /&gt;
[http://www.gnupg.org/ gnupg.org]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Open Source]]&lt;/div&gt;</summary>
		<author><name>Wolf0</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Securing_your_wallet&amp;diff=39014</id>
		<title>Securing your wallet</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Securing_your_wallet&amp;diff=39014"/>
		<updated>2013-06-29T18:30:05Z</updated>

		<summary type="html">&lt;p&gt;Wolf0: /* Linux */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
&lt;br /&gt;
Wallet security can be broken down into two independent goals:&lt;br /&gt;
# Protecting your wallet against loss.&lt;br /&gt;
# Protecting your wallet against theft.&lt;br /&gt;
&lt;br /&gt;
In the case that your current wallet hasn&#039;t been protected adequately (e.g. put online with a weaker password):&lt;br /&gt;
# Making a new secure wallet, using appropriate long-term protection.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;For a brief overview see also: [[Wallet Security Dos and Don&#039;ts (Windows)|Wallet Security Dos and Don&#039;ts]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Paper Wallets==&lt;br /&gt;
[[Paper wallet]]s are a fairly simple way to store your bitcoins independent of a computer. When generated securely and stored on paper, or other offline storage media, a paper wallet decreases the chances of your bitcoins being stolen by hackers, or computer viruses.&lt;br /&gt;
&lt;br /&gt;
With each entry on a paper wallet, you are securing a sequence of secret numbers that is used to prove your right to spend the bitcoins assigned to one of your addresses. This secret number, called a [[private key]], is most commonly written as a sequence of fifty-one alphanumeric characters, beginning with a &#039;5&#039;.&lt;br /&gt;
&lt;br /&gt;
One way you can create a paper wallet is by going to the website [[BitAddress|bitaddress.org]]. This website features a free client-side paper wallet generator written in JavaScript. The webpage can be saved as a file and used on an offline computer. Using it online is relatively safe, for storing smaller amounts, but not airtight unless you take extra precautions to ensure your keys are not stolen by spyware. Alternatively Blockchain.info offers a [https://blockchain.info/wallet/paper-tutorial tutorial on how to generate a paper wallet] with an online component so you can still check your balance easily.&lt;br /&gt;
&lt;br /&gt;
To generate a safer paper wallet, it is best to &amp;quot;clean-boot&amp;quot; your computer with a bootable CD (such as a Linux Live CD), with your computer not connected to the Internet, to ensure that you do not have any active spyware that might steal any private keys you generate. Disconnecting from the Internet allows you to confirm that the paper wallet generator is truly self-contained and isn&#039;t depending on communication with a remote server. Run the saved paper wallet generator in a web browser, then print your paper wallets or store them on external media (do not save them on the computer), and then shut down the computer. You may need to load an appropriate printer driver in order to print while booted from the live CD.&lt;br /&gt;
&lt;br /&gt;
A paper wallet lists multiple Bitcoin addresses and their corresponding private keys. You can send Bitcoins to any address on the page and they will be inaccessible until the private key is imported into a wallet. Since version 0.6.0, the bitcoin software has a command called &amp;quot;importprivkey&amp;quot; that can load private keys, but you can also use the &amp;quot;Add Funds&amp;quot; - &amp;quot;Private key&amp;quot; screen at [[MtGox]] or Blockchain.info&#039;s &amp;quot;My Wallet&amp;quot; service to recover bitcoins from a private key. In the case of MtGox, bitcoins are deposited in your account, and can be sent out of MtGox after the standard number of deposit confirmations.&lt;br /&gt;
&lt;br /&gt;
Remember, spyware and viruses often attempt to monitor your computer activities so that their authors can steal from you. They are interested in passwords to online accounts, and anything of value. Bitcoin wallets and private keys are something of value that have already been targeted by malware. Paper wallets isolate you from much of this risk.&lt;br /&gt;
&lt;br /&gt;
If your computer is infected with spyware or viruses - even if there are no symptoms, or your antivirus isn&#039;t reporting anything - then anything you type, view, or save on your computer, could potentially be stolen by someone remotely controlling your computer. Your private key can then be intercepted while you enter it, so only enter a Bitcoin private key into your computer when your intent is to redeem its value &#039;&#039;immediately&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Hardware wallets ==&lt;br /&gt;
They are not operational yet, but [[Hardware wallet]]s are a major effort to provide a good combination of enhanced security and usability.&lt;br /&gt;
&lt;br /&gt;
==Importance of security updates==&lt;br /&gt;
&lt;br /&gt;
No software is perfect, and from time to time there may be security vulnerabilities found in your Bitcoin client as well.&lt;br /&gt;
Be sure you keep your client updated with the latest bug fixes, especially when a new vulnerability is discovered.&lt;br /&gt;
We maintain a [[CVEs|list a known vulnerabilities]] on this wiki - you can watch that page to get updates.&lt;br /&gt;
Note that you &#039;&#039;don&#039;t&#039;&#039; need to be running the latest major client version: some clients, including the popular Bitcoin-Qt, have older versions available with bugfix-only updates.&lt;br /&gt;
&lt;br /&gt;
==Securing the Bitcoin-QT or bitcoind wallet==&lt;br /&gt;
&lt;br /&gt;
Bitcoin transactions send Bitcoins to a specific public key. A Bitcoin address is an encoded hash of a public key. In order to use received Bitcoins, you need to have the private key matching the public key you received with. This is sort of like a super long password associated with an account (the account is the public key). Your Bitcoin wallet contains all of the private keys necessary for spending your received transactions. If you delete your wallet without a backup, then you no longer have the authorization information necessary to claim your coins, and the coins associated with those keys are lost forever.&lt;br /&gt;
&lt;br /&gt;
The wallet contains a pool of queued keys. By default there are 100 keys in the [[key pool]].  The size of the pool is configurable using the &amp;quot;-keypool&amp;quot; command line argument.  When you need an address for whatever reason (send, “new address”, generation, etc.), the key is not actually generated freshly, but taken from this pool. A brand new address is generated to fill the pool back to 100. So when a backup is first created, it has all of your old keys plus 100 unused keys. After sending a transaction, it has 99 unused keys. After a total of 100 new-key actions, you will start using keys that are not in your backup. Since the backup does not have the private keys necessary for authorizing spends of these coins, restoring from the old backup will cause you to lose Bitcoins.&lt;br /&gt;
&lt;br /&gt;
Creating a new address generates a new pair of public and private keys, which are added to your wallet. Each keypair is mostly random numbers, so they cannot be known prior to generation. If you backup your wallet and then create more than 100 new addresses, the keypair associated with the newest addresses will not be in the old wallet because the new keypairs are only known after creating them. Any coins received at these addresses will be lost if you restore from the backup.&lt;br /&gt;
&lt;br /&gt;
The situation is made somewhat more confusing because the receiving addresses shown in the UI are not the only keys in your wallet. Each Bitcoin generation is given a new public key, and, more importantly, each sent transaction also sends some number of Bitcoins back to yourself at a new key. When sending Bitcoins to anyone, you generate a new keypair for yourself and simultaneously send Bitcoins to your new public key and the actual recipient&#039;s public key. This is an anonymity feature – it makes tracking Bitcoin transactions much more difficult.&lt;br /&gt;
&lt;br /&gt;
So if you create a backup, do more than 100 things that cause a new key to be used, and then restore from the backup, some Bitcoins will be lost. Bitcoin has not deleted any keys (keys are never deleted) – it has created a new key that is not in your old backup and then sent Bitcoins to it.&lt;br /&gt;
&lt;br /&gt;
== Making a new wallet ==&lt;br /&gt;
&lt;br /&gt;
If a wallet or an encrypted wallet&#039;s password has been compromised, it is wise to create a new wallet and transfer the full balance of bitcoins to addresses contained only in the newly created wallet. Examples of ways a wallet may be compromised are through password re-use, minimal strength passwords, computer hack or virus attack.&lt;br /&gt;
&lt;br /&gt;
There are a number of ways to create a new wallet with Bitcoin-QT or bitcoind but this is a process that has been tested with bitcoind 0.6.3. We use the copy command to minimize the chance of any data loss but you are warned to make backups of any wallet.dat that holds a balance for you.&lt;br /&gt;
&lt;br /&gt;
:1. Shut down the Bitcoin program.&lt;br /&gt;
:2. Find and make a backup of the &amp;quot;compromised&amp;quot; wallet.dat file and rename it, perhaps adding a short description:&lt;br /&gt;
:::wallet.dat -&amp;gt;  wallet-compromised.dat&lt;br /&gt;
:Depending on your OS, the wallet file will be located at:&lt;br /&gt;
:::Windows: %APPDATA%\Bitcoin\&lt;br /&gt;
:::Linux: ~/.bitcoin/&lt;br /&gt;
:::Mac: ~/Library/Application Support/Bitcoin/&lt;br /&gt;
:3. Start the Bitcoin program and it will create a new wallet.dat. You may then encrypt the wallet as desired and make a new backup.&lt;br /&gt;
:4. Once you&#039;ve made a new wallet, you can obtain one or more addresses and copy them into a text editor. After obtaining the new address(es), shut down the Bitcoin program, make a backup of the new wallet.dat file and copy it to a new file named wallet-new.dat.&lt;br /&gt;
:5. Copy the wallet-compromised.dat file back to wallet.dat, start the Bitcoin program and transfer your balance to the new address(es) you put in your text editor. Once the balance is back to 0 for your compromised wallet, you may want to wait a couple minutes or for a confirmation or check block explorer to be sure the transactions have been broadcasted. Then you may shut down the Bitcoin program.&lt;br /&gt;
:6. Rename wallet.dat to wallet-compromised.dat. &lt;br /&gt;
:7. Rename wallet-new.dat to wallet.dat.&lt;br /&gt;
&lt;br /&gt;
You should now have a new wallet with all the bitcoins from the old wallet.&lt;br /&gt;
&lt;br /&gt;
==Making a secure workspace==&lt;br /&gt;
&lt;br /&gt;
If you are using your computer to handle bitcoins, a wallet, Bitcoin-related passwords, or Bitcoin private keys, you must take care that the system is free of malware, viruses, keyloggers, remote access tools, and other tools that may be used to make remote copies of any of the above. In the case that your computer is compromised, the precautions taken below may provide additional protection.&lt;br /&gt;
&lt;br /&gt;
===Debian-based Linux===&lt;br /&gt;
&lt;br /&gt;
The first step is to make a [http://www.howtogeek.com/howto/ubuntu/add-a-user-on-ubuntu-server/ new user]. In order for that new user to have an encrypted home directory, you&#039;ll first need the encryption utility. Run:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install ecryptfs-utils&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you&#039;re ready to create a new user&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo adduser --encrypt-home new_user_name&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You&#039;ll need to come up with a [[#Choosing_A_Strong_Password|secure]] new password for that user.&lt;br /&gt;
&lt;br /&gt;
When you get to the prompt &#039;Enter the new value, or press ENTER for the default&#039;, just keep hitting ENTER.&lt;br /&gt;
&lt;br /&gt;
Then switch user to the new user.  To get to the new user you can use the switch user icon for your system, which on Ubuntu is in the &#039;System/Quit&#039; screen, or if there is no switch icon on your system you can log out and log back in as the new user.&lt;br /&gt;
&lt;br /&gt;
Since the home folder of this user is encrypted, if you&#039;re not logged in as that user, data that is saved there can&#039;t be browsed, even by a root user. If something goes wrong with your system, and you need to decrypt the new user&#039;s files, you&#039;ll need its decryption key.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ecryptfs-unwrap-passphrase&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It will ask you for your user&#039;s password and give you the decryption key. &#039;&#039;&#039;WRITE DOWN OR SAVE THE CODE IT RETURNS&#039;&#039;&#039; because you will need it if you ever have to pull your data off while the OS is not working. (You can run it again later if you need to, but run it now so that you can get your data if your Linux install gets botched.)&lt;br /&gt;
&lt;br /&gt;
The encrypted folder data is not encrypted while it&#039;s in memory, and so if it&#039;s ever sent to the swap partition it can be stolen from there unless that too is encrypted - be aware that this will mean you cannot use Hibernate anymore, as the bootloader won&#039;t be able to restore the hibernation data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ecryptfs-setup-swap&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then click on a folder in the new user to display the file browser, then keep going up folders until you see the new user home directory, then right click to bring up the Properties dialog, then click on the Permissions tab, then in the Others section, set the folder access to None.&lt;br /&gt;
&lt;br /&gt;
For secure browsing, open Firefox, and then go into the Edit menu and click Preferences.  Starting from the left, click on the General tab, and in the &#039;Startup/When Firefox starts&#039; pop up menu, choose &#039;Show a Blank Page&#039;.  Then click on the Content tab, and deselect &#039;Load images automatically&#039; and deselect &#039;Enable JavaScript&#039;.  Then click on the Privacy tab, and in the &#039;History/Firefox will&#039; pop up menu, choose &#039;Never remember history&#039;.  Then click on the Security tab, and in the Passwords section, deselect &#039;Remember passwords for sites&#039; and deselect &#039;Use a master password&#039;.  Then click on the Advanced tab, then click on the Update tab, and then in the &#039;Automatically check for updates to&#039; section, deselect &#039;Add-ons&#039; and &#039;Search Engines&#039;.&lt;br /&gt;
&lt;br /&gt;
When JavaScript is disabled, the [http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.3.23/bitcoin-0.3.23-linux.tar.gz/download Linux download page] will not download automatically, so you&#039;ll have to click on the &#039;direct link&#039; part of the &amp;quot;Problems with the download? Please use this &#039;direct link&#039; or try another mirror.&amp;quot; line.&lt;br /&gt;
&lt;br /&gt;
===Mac===&lt;br /&gt;
This solution &#039;&#039;&#039;does not scale&#039;&#039;&#039;; the amount of needed space can grow beyond the image size.&lt;br /&gt;
&lt;br /&gt;
=====Backup all data=====&lt;br /&gt;
Follow these instructions to backup all the bitcoin data (wallet and block chains) to an encrypted disk image.&lt;br /&gt;
# Open Disk Utility&lt;br /&gt;
# Click New Image and choose a big enough size, 128-bit or 256-bit (faster or more secure) encryption and single partition.&lt;br /&gt;
# Save it somewhere you won&#039;t lose it (like your Wuala, Dropbox, Strongspace or whatever)&lt;br /&gt;
# Choose a safe and strong password&lt;br /&gt;
# Move everything from ~/Library/Application Support/Bitcoin/ to the image&lt;br /&gt;
# Symlink it back so the app would be able to use it&lt;br /&gt;
:::ln -s /Volumes/Bitcoin ~/Library/Application Support/Bitcoin&lt;br /&gt;
&lt;br /&gt;
Don&#039;t forget to mount your image before using Bitcoin and unmount it after quitting.&lt;br /&gt;
&lt;br /&gt;
=====Backup just wallet.dat=====&lt;br /&gt;
Follow these instructions to backup just the wallet.dat file. This results in a smaller disk image, but it&#039;s more complicated to do.&lt;br /&gt;
# Open Disk Utility&lt;br /&gt;
# Click New Image and choose a big enough size, 128-bit or 256-bit (faster or more secure) encryption and single partition.&lt;br /&gt;
# Save it somewhere you won&#039;t lose it (like your Wuala, Dropbox, Strongspace or whatever)&lt;br /&gt;
# Choose a safe and strong password&lt;br /&gt;
# Move your wallet.dat file to the image&lt;br /&gt;
# Symlink it back so the app would be able to use it&lt;br /&gt;
:::ln -s /Volumes/Bitcoin/wallet.dat ~/Library/Application Support/Bitcoin/wallet.dat&lt;br /&gt;
&lt;br /&gt;
[[File:MountWalletAndLauchnBitcoin_OSX_Automator.png|thumbnail|150px|Mount Wallet and launch Bitcoin]]&lt;br /&gt;
Don&#039;t forget to mount your image before using Bitcoin and unmount after quitting it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: If you start the Bitcoin application without having the image mounted, the application will overwrite your symlink with a new wallet. If that happens, don&#039;t panic. Just delete the new wallet.dat, mount the image, and recreate the symlink like above.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Automation&#039;&#039;&#039;: You can create a small application using [http://en.wikipedia.org/wiki/Automator_%28software%29 Automator] (included in OS X) to automatically mount the wallet and then launch Bitcoin App. See the Screenshot on how to do this.&lt;br /&gt;
&lt;br /&gt;
If one &#039;&#039;doesn&#039;t&#039;&#039; want to use encrypted Disk images, then a &#039;&#039;&#039;small shell script&#039;&#039;&#039; can be used instead that takes care of decrypting the wallet, launching bitcoin client, and encrypting it after the client exits. This script works on both OSX and Linux: [http://lorelei.kaverit.org/bitcoin.sh bitcoin-launch-script]&lt;br /&gt;
&lt;br /&gt;
===Windows===&lt;br /&gt;
&lt;br /&gt;
Due to the frequency with which Windows computers are compromised, it is advised to encrypt your wallet or to keep your wallet on an encrypted disk image created by third-party software, such as [http://www.truecrypt.org/ TrueCrypt] (open source) or [http://www.jetico.com/encryption-bestcrypt/ Jetico BestCrypt] (commercial). This also applies to the storage of passwords, private keys and other data that can be used to access any of your Bitcoin balances.&lt;br /&gt;
&lt;br /&gt;
Assuming that you have installed the Windows Bitcoin client and run it at least once, the process is described below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;b&amp;gt;To mount the Bitcoin data directory on an encrypted drive&amp;lt;/b&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;ol start=1 type=1&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Use the third-party disk image encryption program of your choice to create and mount an encrypted disk image of at least 5GB in size. This procedure stores the entire block chain database with the wallet.dat file so the required size of the encrypted disk image required may grow in the future.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Locate the Bitcoin data directory, and copy the directory with all contents to the encrypted drive.&lt;br /&gt;
&amp;lt;p&amp;gt;For help finding this directory, see &amp;lt;b&amp;gt;[[Securing_your_wallet#Locating_Bitcoin_s_data_directory|Locating Bitcoin&#039;s Data Directory]]&amp;lt;/b&amp;gt;.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a Windows shortcut that starts Bitcoin with the &amp;lt;code&amp;gt;-datadir&amp;lt;/code&amp;gt; parameter and specifies the encrypted drive and directory.&lt;br /&gt;
&amp;lt;p&amp;gt;For example, if you installed Bitcoin in the default directory, mounted your Bitcoin encrypted drive as &amp;lt;code&amp;gt;E:\&amp;lt;/code&amp;gt;, and stored your Bitcoin data directory on it as &amp;lt;code&amp;gt;Bitcoin&amp;lt;/code&amp;gt;, you would type the following command as the shortcut Target:&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;C:\Program Files\Bitcoin\bitcoin.exe -datadir=E:\Bitcoin&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open Bitcoin&#039;s settings and configure it &amp;lt;b&amp;gt;NOT&amp;lt;/b&amp;gt; to start automatically when you start Windows.&lt;br /&gt;
&amp;lt;p&amp;gt;This is to allow you to mount the Bitcoin encrypted disk image before starting Bitcoin.&amp;lt;/p&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Shut down Bitcoin, and then restart it from the new shortcut.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After doing this, any time you want to use Bitcoin, you must first mount the Bitcoin encrypted disk image using the same drive designation, and then run Bitcoin from the shortcut that you created, so that it can find its data and your wallet.&lt;br /&gt;
&lt;br /&gt;
== Locating Bitcoin&#039;s data directory ==&lt;br /&gt;
&lt;br /&gt;
The [[data directory]] is the location where Bitcoin&#039;s data files are stored, including the wallet data file.&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
Go to Start -&amp;gt; Run (or press WinKey+R) and run this:&lt;br /&gt;
&lt;br /&gt;
 explorer %APPDATA%\Bitcoin&lt;br /&gt;
&lt;br /&gt;
Bitcoin&#039;s data folder will open. For most users, this is one of the following locations:&lt;br /&gt;
&lt;br /&gt;
 C:\Documents and Settings\YourUserName\Application data\Bitcoin (Windows XP)&lt;br /&gt;
 &lt;br /&gt;
 C:\Users\YourUserName\Appdata\Roaming\Bitcoin (Windows Vista and 7)&lt;br /&gt;
&lt;br /&gt;
If you have trouble browsing to these folders, note that &amp;quot;AppData&amp;quot; and &amp;quot;Application data&amp;quot; are hidden by default.&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
&lt;br /&gt;
By default Bitcoin will put its data here:&lt;br /&gt;
&lt;br /&gt;
 ~/.bitcoin/&lt;br /&gt;
&lt;br /&gt;
You need to do a &amp;quot;ls -a&amp;quot; to see directories that start with a dot.&lt;br /&gt;
&lt;br /&gt;
If that&#039;s not it, you can do a search like this:&lt;br /&gt;
&lt;br /&gt;
 find / -name wallet.dat -print 2&amp;gt;/dev/null&lt;br /&gt;
&lt;br /&gt;
To change the directory Bitcoin stores its data in:&lt;br /&gt;
 Run in terminal or script: ./bitcoin(-qt) -datadir=./[Directory_Name]&lt;br /&gt;
&lt;br /&gt;
=== Mac ===&lt;br /&gt;
&lt;br /&gt;
By default Bitcoin will put its data here:&lt;br /&gt;
&lt;br /&gt;
 ~/Library/Application Support/Bitcoin/&lt;br /&gt;
&lt;br /&gt;
==Backup==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Using Dropbox to back up your Bitcoin data is not recommended as doing so introduces the following [https://en.wikipedia.org/wiki/Dropbox_(service)#Reception security concerns]:&lt;br /&gt;
# Dropbox stores your encryption key (meaning that a disgruntled Dropbox employee or an attacker who gained access to the system could decrypt your Dropbox data and steal your bitcoins)&lt;br /&gt;
# the Dropbox client only needs a password for the first login. After it authenticates once, the server assigns it a token which it uses to show that, at one time, its user knew the password rather than sending the actual password (meaning that if you ever use the Dropbox client on another PC, that PC&#039;s users can access your Dropbox - even if you change your password - and can steal your bitcoins or get a virus that will steal your bitcoins).&lt;br /&gt;
&lt;br /&gt;
For these reasons, an alternative that always uses password authentication such as [http://www.wuala.com/en/bitcoin Wuala] should be used. Wuala&#039;s servers do not store your encryption key and the program authenticates with the password each time it is started.&lt;br /&gt;
&lt;br /&gt;
Whether you use Dropbox as your backup or not, it is advised to use what Steve Gibson calls &amp;quot;pre-Internet encryption&amp;quot; which means to use some form of encryption on your files before you back them up, in case an attacker gains access to that backup. Make sure to pick a password that is memorable but secure.&lt;br /&gt;
&lt;br /&gt;
The only file you need to back up is &amp;quot;wallet.dat&amp;quot; which can be done one of two ways. To make a copy of the wallet.dat file, ensure that Bitcoin is closed and copy this file somewhere else. The other way is to use the [[api|backupwallet]] JSON-RPC command to back up without shutting down Bitcoin. &lt;br /&gt;
&lt;br /&gt;
Once a copy has been made, encrypt it, and put it in two or more safe locations. Consider the risk due to theft, fire, or natural disaster in proportion to the value of bitcoins stored in the wallet.&lt;br /&gt;
&lt;br /&gt;
=== General Solutions ===&lt;br /&gt;
&lt;br /&gt;
Your wallet.dat file is not encrypted by the Bitcoin program by default but the most current release of the Bitcoin client provides a method to encrypt with a passphrase the private keys stored in the wallet. Anyone who can access an unencrypted wallet can easily steal all of your coins.  Use one of these encryption programs if there is any chance someone might gain access to your wallet.&lt;br /&gt;
* [http://www.7-zip.org/ 7-zip] - Supports strongly-encrypted archives.&lt;br /&gt;
* [http://www.axantum.com/axcrypt/ AxCrypt by Axantum]&lt;br /&gt;
* [http://lrzip.kolivas.org lrzip] - Compression software for Linux and OSX that supports very high grade password protected encryption&lt;br /&gt;
* [http://www.truecrypt.org/ TrueCrypt] - Volume-based on-the-fly encryption (for advanced users)&lt;br /&gt;
&lt;br /&gt;
There is also a list of [[OpenSourceEncryptionSoftware|open source encryption software.]]&lt;br /&gt;
&lt;br /&gt;
Decrypting and encrypting the wallet.dat every time you start or quit the Bitcoin client can be &#039;&#039;tedious&#039;&#039; (and outright error-prone). If you want to keep your wallet encrypted (except while you&#039;re actually running the Bitcoin client), it&#039;s better to relegate the automation to a [http://lorelei.kaverit.org/bitcoin.sh small shell script] that handles the en/decryption and starting up Bitcoin client for you (Linux and OSX). &lt;br /&gt;
&lt;br /&gt;
There is also a method to print out and encrypt your wallet.dat as a special, scannable code. See details here: [[WalletPaperbackup]]&lt;br /&gt;
&lt;br /&gt;
==== Password Strength ====&lt;br /&gt;
Brute-force password cracking has come a long way. A password including capitals, numbers, and special characters with a length of 8 characters can be trivially solved now (using appropriate hardware). The recommended length is &#039;&#039;&#039;at least&#039;&#039;&#039; 12 characters long.  You can also use a multi-word password and there are techniques to increase the strength of your passwords without sacrificing usability. [http://www.baekdal.com/tips/password-security-usability The Usability of Passwords] &lt;br /&gt;
&lt;br /&gt;
However, simply using dictionary words is also insecure as it opens you up to a dictionary attack. If you use dictionary words, be sure to include random symbols and numbers in the mix as well.&lt;br /&gt;
&lt;br /&gt;
If you use keyfiles in addition to a password, it is unlikely that your encrypted file can ever be cracked using brute-force methods, even when even a 12 character password might be too short.&lt;br /&gt;
&lt;br /&gt;
Assume that any encrypted files you store online (eg. Gmail, Dropbox) will be stored somewhere forever and can never be erased.&lt;br /&gt;
&lt;br /&gt;
===== Choosing A Strong Password =====&lt;br /&gt;
Make sure you pick at least one character in each group:&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  Lowercase: abcdefghijklmnopqrstuvwxyz&lt;br /&gt;
  Uppercase: ABCDEFGHIJKLMNOPQRSTUVWXYZ&lt;br /&gt;
  Number: 1234567890&lt;br /&gt;
  Symbol: `~!@#$%^&amp;amp;*()-_=+\|[{]};:&#039;&amp;quot;,&amp;lt;.&amp;gt;/? (space)&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;9 char = unsuitable for use&lt;br /&gt;
  09 char = insecure&lt;br /&gt;
  10 char = low security&lt;br /&gt;
  11 char = medium security&lt;br /&gt;
  12 char = good security (good enough for your wallet)&lt;br /&gt;
  13 char = very good, enough for anything.&lt;br /&gt;
&lt;br /&gt;
You might want to read [http://security.stackexchange.com/questions/662/what-is-your-way-to-create-good-passwords-that-can-actually-be-remembered What is your way to create good passwords that can actually be remembered?] and [http://security.stackexchange.com/questions/6095/xkcd-936-short-complex-password-or-long-dictionary-passphrase XKCD #936: Short complex password, or long dictionary passphrase?]&lt;br /&gt;
&lt;br /&gt;
==== Email-based Archival and Remote Backup ====&lt;br /&gt;
One of the simplest methods for storing an appropriately &#039;&#039;&#039;encrypted&#039;&#039;&#039; archive of your wallet.dat file is to send the archive as an email attachment to your own e-mail address.  Services like Gmail use very comprehensive distributed networks that make the loss of data very unlikely.  One can even obfuscate the name of the files within the archive, and name the archive something less inviting, such as: &#039;personal notes&#039; or &#039;car insurance&#039;.&lt;br /&gt;
&lt;br /&gt;
Another solution is to use a file storage service like [http://www.wuala.com/bitcoin Wuala] ( encrypted, [http://www.bitcoin.org/smf/index.php?topic=5817.0 instructions]), [http://www.dropbox.com Dropbox] (after encrypting the wallet first) and [http://en.wikipedia.org/wiki/Comparison_of_online_backup_services others], including the more secure [http://www.spideroak.com SpiderOak].&lt;br /&gt;
&lt;br /&gt;
=== Automated Backups using Cron, Bash and GNU/Linux ===&lt;br /&gt;
&lt;br /&gt;
Linux users can setup backups using cron by telling it to run a backup script at set intervals of time. Run &#039;crontab -e&#039; and add this line near the bottom:&lt;br /&gt;
&lt;br /&gt;
 01 * * * * /usr/local/bin/backupwallet.sh&lt;br /&gt;
&lt;br /&gt;
This cron line will run the /usr/local/bin/backupwallet.sh script at the 01 minute of every hour. Remember to add a newline after the last line of the crontab file, or else the last line won&#039;t run. You may also wish to ignore the script&#039;s output by appending &amp;quot; &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&amp;quot; to the line (this will also prevent emails from being sent).&lt;br /&gt;
&lt;br /&gt;
Create /usr/local/bin/backupwallet.sh:&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 # /usr/local/bin/backupwallet.sh&lt;br /&gt;
 #&lt;br /&gt;
 # Performs backup of bitcoin wallet.&lt;br /&gt;
 #&lt;br /&gt;
 # Written by: https://en.bitcoin.it/wiki/Securing_your_wallet&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Standard Options&lt;br /&gt;
 #&lt;br /&gt;
 TS=$(date &amp;quot;+%Y%m%d-%H%M&amp;quot;)&lt;br /&gt;
 WALLET=/tmp/wallet-${TS}&lt;br /&gt;
 WALLET_E=/tmp/wallet-${TS}.crypt&lt;br /&gt;
 BITCOIN=bitcoind  # /path/to/bitcoind&lt;br /&gt;
 GPG=gpg  # /path/to/gpg&lt;br /&gt;
 GPG_USER=username  # Username of gpg recipient. User should have gpg setup.&lt;br /&gt;
 RM=rm&lt;br /&gt;
 RM_OPTS=&#039;--force&#039;&lt;br /&gt;
 USE_SHRED=0  # Flip to 1 to use `shred` instead of `rm`.&lt;br /&gt;
 SHRED=shred&lt;br /&gt;
 SHRED_OPTS=&#039;--force --iterations=9 --zero --remove&#039;&lt;br /&gt;
 &lt;br /&gt;
 #&lt;br /&gt;
 # Storage Options&lt;br /&gt;
 # Only 1 set of options should be un-commented (the last one will be used).&lt;br /&gt;
 # Update CP_DEST paths as neccessary.&lt;br /&gt;
 #&lt;br /&gt;
 # CP - Storage on a local machine. Could be Dropbox/Wuala folder.&lt;br /&gt;
 #CP=cp&lt;br /&gt;
 #CP_DEST=&#039;/var/data/backups/&#039;  # &#039;~/Dropbox/&#039;, etc.&lt;br /&gt;
 #&lt;br /&gt;
 # SSH - Storage on a remote machine.&lt;br /&gt;
 CP=scp&lt;br /&gt;
 CP_DEST=&#039;remoteuser@example.com:~/wallets/&#039;&lt;br /&gt;
 #&lt;br /&gt;
 # S3 - Storage on Amazon&#039;s S3. Be sure s3cmd is installed and properly setup.&lt;br /&gt;
 # You may need &amp;quot;s3cmd put --force&amp;quot; if you use a sub-directory in CP_DEST.&lt;br /&gt;
 #CP=s3cmd put&lt;br /&gt;
 #CP_DEST=&#039;s3://bucket&#039;&lt;br /&gt;
 &lt;br /&gt;
 do_clean() {&lt;br /&gt;
   # Remove temporary wallets.&lt;br /&gt;
   if [ 1 -eq $USE_SHRED ]; then&lt;br /&gt;
     $SHRED $SHRED_OPTS $WALLET $WALLET_E&lt;br /&gt;
   else&lt;br /&gt;
     $RM $RM_OPTS $WALLET $WALLET_E&lt;br /&gt;
   fi&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 do_fail() {&lt;br /&gt;
   do_clean&lt;br /&gt;
   echo failed!&lt;br /&gt;
   exit 1&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 # Perform the backup.&lt;br /&gt;
 echo -n Making backup...&lt;br /&gt;
 $BITCOIN backupwallet $WALLET&lt;br /&gt;
 [ ! -s &amp;quot;$WALLET&amp;quot; ] &amp;amp;&amp;amp; do_fail  # If the backup does not exist or is empty, fail.&lt;br /&gt;
 echo done.&lt;br /&gt;
 echo -n Encrypting backup...&lt;br /&gt;
 $GPG -r $GPG_USER --output $WALLET_E --encrypt $WALLET&lt;br /&gt;
 [ 0 -ne $? ] &amp;amp;&amp;amp; do_fail  # If gpg returns a non-zero result, fail.&lt;br /&gt;
 echo done.&lt;br /&gt;
 echo -n Copying to backup location...&lt;br /&gt;
 $CP $WALLET_E &amp;quot;$CP_DEST&amp;quot;&lt;br /&gt;
 [ 0 -ne $? ] &amp;amp;&amp;amp; do_fail  # If the $CP command returns a non-zero result, fail.&lt;br /&gt;
 echo done.&lt;br /&gt;
 do_clean&lt;br /&gt;
 &lt;br /&gt;
 exit 0&lt;br /&gt;
&lt;br /&gt;
The shell script:&lt;br /&gt;
&lt;br /&gt;
* Calls bitcoind backupwallet to create a time/date-stamped wallet.&lt;br /&gt;
* GPG encrypts the wallet with your public key.&lt;br /&gt;
* Copies the result using one of several storage options (cp, scp, and s3cmd).&lt;br /&gt;
* Uses the rm or shred command to remove the temporary wallet files.&lt;br /&gt;
&lt;br /&gt;
Be sure to modify the script options to fit your setup. After you save, make sure the file can be executed properly by the cron user. Common permissions for files in /usr/local/bin/ can be applied using (verify with your distribution!):&lt;br /&gt;
&lt;br /&gt;
 cd /usr/local/bin/ &amp;amp;&amp;amp; chown root:root backupwallet.sh &amp;amp;&amp;amp; chmod 755 backupwallet.sh&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
&lt;br /&gt;
==Restore==&lt;br /&gt;
&lt;br /&gt;
Assuming your backup is recent enough that you haven&#039;t used up all of your key pool... restoring a wallet to a new (or old) location and rescanning the block chain should leave you with all your coins. Just follow these steps:&lt;br /&gt;
* Shut down the Bitcoin program.&lt;br /&gt;
* Copy your backed-up wallet.dat into your bitcoin data directory.&lt;br /&gt;
* If you are copying in a backed-up wallet.dat that was last used on a Bitcoin version prior to 0.3.21 into an existing profile, delete files &#039;&#039;blk*.dat&#039;&#039; to make the client re-download the block chain. You may also need to do this if your transactions don&#039;t all show up after you restart Bitcoin.&lt;br /&gt;
&lt;br /&gt;
==Erasing Plain-text Wallets==&lt;br /&gt;
&lt;br /&gt;
In most operating systems, including Windows, Linux, and Mac OS X, simply deleting a wallet.dat file will &#039;&#039;not&#039;&#039; generally destroy it. It is likely that advanced tools can still be used to recover the wallet.dat file, even after it has been deleted.&lt;br /&gt;
&lt;br /&gt;
The Linux &#039;&#039;&#039;shred&#039;&#039;&#039; command can be used to overwrite the wallet file with random data prior to deleting; this particular copy of the file will then be practically impossible to recover.  Using shred (and similar tools on Windows) however does not guarantee that still other copies don&#039;t exist somewhere hidden on your HD. That will depend on your system configuration and what packages you have installed. Some system restore and backup tools, for instance, create periodic snapshots of your  filesystem, duplicating your wallet.dat.&lt;br /&gt;
&lt;br /&gt;
In Mac OS, the equivalent of &#039;&#039;&#039;shred&#039;&#039;&#039; is &#039;&#039;&#039;srm&#039;&#039;&#039; (introduced in Leopard). Using the Finder to remove files, clicking &amp;quot;Secure Empty Trash&amp;quot; in the Finder menu will shred the contents of the trash can. As with any OS this doesn&#039;t guarantee that there are not other copies elsewhere on your system.&lt;br /&gt;
&lt;br /&gt;
For Windows, the built-in command &#039;&#039;cipher /W&#039;&#039; will shred all previously-deleted files. [http://www.cylog.org/utilities/cybershredder.jsp CyberShredder] can securely deleted individual files.&lt;br /&gt;
&lt;br /&gt;
==Online and Mobile Wallets==&lt;br /&gt;
&lt;br /&gt;
Thus far, this article has been discussing the security of a wallet file for Bitcoin-QT or bitcoind that is under your sole control. Additional wallets applications and services have become available that offer other features and more convenience but not without introducing additional risk. When storing bitcoins with an [[eWallet]] such as Instawallet or Easywallet, you are essentially storing your private keys or wallet with that provider. &lt;br /&gt;
&lt;br /&gt;
Online wallets have a number of pros and cons to consider. For example, you can access your wallet on any computer in the world, but depending on the service, your bitcoins may be lost if the service is compromised. &lt;br /&gt;
&lt;br /&gt;
Mobile wallet applications are available for Android devices that allow you to send bitcoins by QR code or NFC, but this opens up the possibility of loss if mobile device is compromised. It may be possible to encrypt and backup the wallet or private keys on a mobile device but it is not advisable to store a large amount of bitcoins there without doing your own research and testing.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Data directory]]&lt;br /&gt;
* [[How to import private keys]]&lt;br /&gt;
* [http://startbitcoin.com/how-to-create-a-secure-bitcoin-wallet/ Secure Bitcoin Wallet Tutorial]&lt;br /&gt;
* [[How to set up a secure offline savings wallet]]&lt;br /&gt;
* [http://arimaa.com/bitcoin/ Bitcoin Gateway - A Peer-to-peer Bitcoin Vault and Payment Network]&lt;br /&gt;
* [http://blog.cyplo.net/2012/04/01/bitcoin-wallet-recovery-photorec/ Find lost wallet eg. after disk format, using Photorec]&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;br /&gt;
&lt;br /&gt;
[[de:Sichere deine Geldbörse]]&lt;br /&gt;
[[es:Cómo asegurar su monedero]]&lt;br /&gt;
[[zh-cn:保护你的钱包]]&lt;/div&gt;</summary>
		<author><name>Wolf0</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Mini_private_key_format&amp;diff=38910</id>
		<title>Mini private key format</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Mini_private_key_format&amp;diff=38910"/>
		<updated>2013-06-26T12:01:31Z</updated>

		<summary type="html">&lt;p&gt;Wolf0: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:QR-privkeys-sidebyside.png|thumb|right|QR codes of the same private key, in mini versus regular private key format.  Both codes have the same dot density and error correction level, but the mini key is 57% of the full code&#039;s size.]]&lt;br /&gt;
The &#039;&#039;&#039;mini private key format&#039;&#039;&#039; is a method of encoding a Bitcoin private key in as few as 30 characters so that it can be embedded in a small space.  This private key format was first used in Casascius physical bitcoins, and is also favorable for use in QR codes.  The fewer characters encoded in a QR code, the lower dot density can be used, as well as more dots allocated to error correction in the same space, significantly improving readability and resistance to damage.  The mini private key format offers its own built-in check code as a small margin of protection against typos.&lt;br /&gt;
&lt;br /&gt;
An example key using this encoding is &#039;&#039;&#039;S6c56bnXQiBjk9mqSYE7ykVQ7NzrRy&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Usage on a physical bitcoin==&lt;br /&gt;
The way it might appear within a physical bitcoin is on a round card printed as follows:&lt;br /&gt;
&lt;br /&gt;
Side of discs showing mini private key: (from [[Casascius physical bitcoins]])&amp;lt;br/&amp;gt;&lt;br /&gt;
[[Image:Miniprivkeys.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
Side of discs showing prefix of bitcoin address (printed on the opposite side):&amp;lt;br/&amp;gt;&lt;br /&gt;
[[Image:Minipubkeys.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
The examples in this article use the private key and Bitcoin address of the leftmost circle in the above two photos.&lt;br /&gt;
&lt;br /&gt;
==Usage in bar codes==&lt;br /&gt;
The mini private key is suitable for use in QR codes.  The recommended settings for maximizing readability are: QR version 3, error correction level Q (near highest, 25% possible lost codeword recovery).  This results in a 29x29 grid.  A minikey QR code can also fit in a 25x25 grid with QR version 2, error correction level L (lowest, 7% possible lost codeword recovery).&lt;br /&gt;
&lt;br /&gt;
The sample private minikey encoded as a QR code on a 29x29 grid looks like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Private_minikey_in_2D_barcode.gif]]&lt;br /&gt;
&lt;br /&gt;
The mini private key is small enough to fit in a one-dimensional barcode while still remaining practical.  Among the most popular one-dimensional barcode symbologies, the one known as &amp;quot;Code 128&amp;quot; is best suited for encoding a minikey due to its favorable data density and support for mixed case strings.  The variant known as &amp;quot;Code 128-B&amp;quot; produces the shortest code for strings containing lowercase characters.&lt;br /&gt;
&lt;br /&gt;
The sample private minikey encoded with Code 128-B looks like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Private_minikey_in_1D_barcode.gif]]&lt;br /&gt;
&lt;br /&gt;
==Import==&lt;br /&gt;
Mini private keys can be imported through the following clients/services:&lt;br /&gt;
&lt;br /&gt;
===Applications===&lt;br /&gt;
* [[Armory]]&lt;br /&gt;
&lt;br /&gt;
The current mainline (&amp;quot;Satoshi&amp;quot;) client cannot currently be used to import minikeys.&lt;br /&gt;
&lt;br /&gt;
===Mobile===&lt;br /&gt;
&lt;br /&gt;
* Mt. Gox Mobile can redeem a private key scanned from a QR Code or is entered using the keyboard.  Upon importing, Mt. Gox sweeps the funds to a secondary address, and then a user must wait for six confirmations before the funds will appear in the Mt. Gox account.&lt;br /&gt;
&lt;br /&gt;
===Web===&lt;br /&gt;
&lt;br /&gt;
* [[BlockChain.info]]&lt;br /&gt;
** Private keys can be imported into a Blockchain.info wallet and bitcoins can be sent to another address immediately upon import without needing to wait for any confirmations.  Even after import, funds remain associated with the private key until they are actually spent to a different address.&lt;br /&gt;
* [[StrongCoin]]&lt;br /&gt;
* [[Mt. Gox]]&lt;br /&gt;
** Importing minikeys is done through the deposit screen using the &amp;quot;Import Private Key&amp;quot; deposit method.  Upon importing, Mt. Gox sweeps the funds to a secondary address, and then a user must wait for six confirmations before the funds will appear in the Mt. Gox account.  Removing the imported bitcoins from the Mt. Gox account is treated as a bitcoin withdrawal and counts against daily/monthly limits.&lt;br /&gt;
** Mt. Gox also permanently remembers any imported private key and automatically sweeps any future funds sent to it into the user&#039;s Mt. Gox account.&lt;br /&gt;
** Mt. Gox&#039;s import screen doesn&#039;t properly detect or reject typos. If you make a mistake, Mt. Gox will treat it as a valid entry and report that a private key with a balance of 0.00 BTC from a bitcoin address you won&#039;t recognize was &amp;quot;successfully&amp;quot; imported.&lt;br /&gt;
&lt;br /&gt;
==Decoding==&lt;br /&gt;
The private key encoding consists of 30 alphanumeric characters from the [[base58]] alphabet used in Bitcoin.  The first of the characters is always the uppercase letter S.&lt;br /&gt;
&lt;br /&gt;
To determine whether the minikey is valid:&lt;br /&gt;
&lt;br /&gt;
# Add a question mark to the end of the mini private key string.&lt;br /&gt;
# Take the SHA256 hash of the entire string.  However, we will only look at the first byte of the result.&lt;br /&gt;
# If the first byte is 00, the string is a well-formed minikey.  If the first byte is not 00, the string should be rejected as a minikey.&lt;br /&gt;
&lt;br /&gt;
===Example with SHA256===&lt;br /&gt;
Here is an example with the sample private key S6c56bnXQiBjk9mqSYE7ykVQ7NzrRy.&lt;br /&gt;
&lt;br /&gt;
The string &amp;quot;S6c56bnXQiBjk9mqSYE7ykVQ7NzrRy?&amp;quot; has a SHA256 value that begins with 00, so it is well-formed.&lt;br /&gt;
&lt;br /&gt;
To obtain the full 256-bit private key, simply take the SHA256 hash of the entire string.  There is no encoding for line breaks in the string, even if the key is broken into multiple lines for printing.  The SHA256 should be taken of exactly thirty bytes.&lt;br /&gt;
&lt;br /&gt;
 SHA256(&amp;quot;S6c56bnXQiBjk9mqSYE7ykVQ7NzrRy&amp;quot;) = 4C7A9640C72DC2099F23715D0C8A0D8A35F8906E3CAB61DD3F78B67BF887C9AB  &lt;br /&gt;
&lt;br /&gt;
This sample key in [[wallet export format]] is 5JPy8Zg7z4P7RSLsiqcqyeAF1935zjNUdMxcDeVrtU1oarrgnB7, and the corresponding [[Bitcoin address]] is 1CciesT23BNionJeXrbxmjc7ywfiyM4oLW.&lt;br /&gt;
&lt;br /&gt;
==Check code==&lt;br /&gt;
The mini private key format offers a simple typo check code.  Mini private keys must be generated in a &amp;quot;brute force&amp;quot; fashion, keeping only keys that conform to the format&#039;s rules.  If a key is well-formed (30 Base58 characters starting with S), but fails the hash check, then it probably contains a typo.&lt;br /&gt;
&lt;br /&gt;
If the SHA256 hash of the string followed by &#039;?&#039; doesn&#039;t result in something that begins with 0x00, the string is not a valid mini private key.&lt;br /&gt;
&lt;br /&gt;
==Creating mini private keys==&lt;br /&gt;
Creating mini private keys is relatively simple.  One program which can create such keys is [[Casascius Bitcoin Utility]].&lt;br /&gt;
&lt;br /&gt;
Mini private keys must be created &amp;quot;from scratch&amp;quot;, as the conversion from mini private key to full-size private key is one-way.  In other words, there is no way to convert an existing full-size private key into a mini private key.&lt;br /&gt;
&lt;br /&gt;
To create mini private keys, simply create random strings that satisfy the well-formedness requirement, and then eliminate the ones that do not pass the typo check.  (This means eliminating more than 99% of the candidates.)  Then use the appropriate algorithm to compute the corresponding private key, and in turn, the matching Bitcoin address.  The Bitcoin address can always be computed from just the private key.&lt;br /&gt;
&lt;br /&gt;
It is strongly advisable to avoid using the digit &amp;quot;1&amp;quot; in minikeys unless it is being printed in such a way where a user is unlikely to mistake it for the lowercase letter &amp;quot;l&amp;quot;.  Few clients and redemption tools are prepared to tell the user that their entry containing the letter &amp;quot;l&amp;quot; should actually be the number &amp;quot;1&amp;quot; - rather, they will simply reject the code and may leave the user confused.&lt;br /&gt;
&lt;br /&gt;
In all cases, you &#039;&#039;&#039;must&#039;&#039;&#039; use a secure cryptographic random number generator to eliminate risks of predictability of the random strings.&lt;br /&gt;
&lt;br /&gt;
==Casascius Series 1 coins==&lt;br /&gt;
&lt;br /&gt;
Casascius Series 1 Physical Bitcoins use a 22-character variant of the minikey format, instead of 30 characters.  Everything is the same other than the length.  To properly implement minikey redemption, services and clients MUST support the 30-character format, but MAY support the 22-character format as well.  Use of the 22-character format for future applications is discouraged due to security considerations.&lt;br /&gt;
&lt;br /&gt;
==Python Code==&lt;br /&gt;
The following code produces sample 30-character SHA256-based mini private keys in Python.  For real-world use, &#039;&#039;random&#039;&#039; must be replaced with a better source of entropy, as the Python documentation for &#039;&#039;random&#039;&#039; states the function &#039;&#039;&amp;quot;is completely unsuitable for cryptographic purposes&amp;quot;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import random&lt;br /&gt;
import hashlib&lt;br /&gt;
&lt;br /&gt;
BASE58 = &#039;23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz&#039;&lt;br /&gt;
&lt;br /&gt;
def Candidate():&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Generate a random, well-formed mini private key.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    return(&#039;%s%s&#039; % (&#039;S&#039;, &#039;&#039;.join(&lt;br /&gt;
        [BASE58[ random.randrange(0,len(BASE58)) ] for i in range(29)])))&lt;br /&gt;
&lt;br /&gt;
def GenerateKeys(numKeys = 10):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Generate mini private keys and output the mini key as well as the full&lt;br /&gt;
    private key. numKeys is The number of keys to generate, and &lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    keysGenerated = 0&lt;br /&gt;
    totalCandidates = 0&lt;br /&gt;
    while keysGenerated &amp;lt; numKeys:&lt;br /&gt;
        try:&lt;br /&gt;
            cand = Candidate()&lt;br /&gt;
            # Do typo check&lt;br /&gt;
            t = &#039;%s?&#039; % cand&lt;br /&gt;
            # Take one round of SHA256&lt;br /&gt;
            candHash = hashlib.sha256(t).digest()&lt;br /&gt;
            # Check if the first eight bits of the hash are 0&lt;br /&gt;
            if candHash[0] == &#039;\x00&#039;:&lt;br /&gt;
                privateKey = GetPrivateKey(cand)&lt;br /&gt;
                print(&#039;\n%s\nSHA256( ): %s\nsha256(?): %s&#039; %&lt;br /&gt;
                      (cand, privateKey, candHash.encode(&#039;hex_codec&#039;)))&lt;br /&gt;
                if CheckShortKey(cand):&lt;br /&gt;
                    print(&#039;Validated.&#039;)&lt;br /&gt;
                else:&lt;br /&gt;
                    print(&#039;Invalid!&#039;)&lt;br /&gt;
                keysGenerated += 1&lt;br /&gt;
            totalCandidates += 1&lt;br /&gt;
        except KeyboardInterrupt:&lt;br /&gt;
            break&lt;br /&gt;
    print(&#039;\n%s: %i\n%s: %i\n%s: %.1f&#039; %&lt;br /&gt;
          (&#039;Keys Generated&#039;, keysGenerated,&lt;br /&gt;
           &#039;Total Candidates&#039;, totalCandidates,&lt;br /&gt;
           &#039;Reject Percentage&#039;,&lt;br /&gt;
           100*(1.0-keysGenerated/float(totalCandidates))))&lt;br /&gt;
&lt;br /&gt;
def GetPrivateKey(shortKey):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Returns the hexadecimal representation of the private key corresponding&lt;br /&gt;
    to the given short key.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    if CheckShortKey(shortKey):&lt;br /&gt;
        return hashlib.sha256(shortKey).hexdigest()&lt;br /&gt;
    else:&lt;br /&gt;
        print(&#039;Typo detected in private key!&#039;)&lt;br /&gt;
        return None&lt;br /&gt;
&lt;br /&gt;
def CheckShortKey(shortKey):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Checks for typos in the short key.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    if len(shortKey) != 30:&lt;br /&gt;
        return False&lt;br /&gt;
    t = &#039;%s?&#039; % shortKey&lt;br /&gt;
    tHash = hashlib.sha256(t).digest()&lt;br /&gt;
    # Check to see that first byte is \x00&lt;br /&gt;
    if tHash[0] == &#039;\x00&#039;:&lt;br /&gt;
        return True&lt;br /&gt;
    return False&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wolf0</name></author>
	</entry>
</feed>