Generally speaking, XOR encryption as an encryption method is not recommended. The XOR encryption is basically a very simple cipher and easily broken, such as Known-Plaintext Attack. If you repeat use a short password to encrypt a long plain-text message, this won’t stand up minutes before being cracked.

However, coupled with the Mauborgne Constraint: (1) you may never reuse a key, (2) it must be the same size as the plain-text, (3) and it must be from a true random bit source—you have unbreakable cryptography.[1]

this works like an OTP (One-time pad) and Shannon proved that the OTP provided perfect secrecy.[2]

3. Use XOR encryption to protect private-keys

How can we use XOR encryption as an advanced technology to bring perfect-secrecy and unbreakable cryptography to our Bitcoin wallet?

Before we answer this question, let’s first ask why we do not just use an advanced and mature encryption method like AES to protect our wallet data.

AES encryption is an industry-recommended advanced encryption method and is also widely used in cryptocurrency wallets. There is no clear evidence show that this encryption method has weaknesses or back-doors, however, there may be risks in actual deployment. The risk is main caused by user’s week password. Users often use weak passwords. Even if some software using salt to improve password entropy, but the salt and algorithms can be cracked by reversing engineering.

So AES encryption cannot provide solid security, if the AES encrypted data obtained by an attacker, there is a height risk of being brute-force cracked.

Now we can use a random NFC-XOR-KEY stored in an NFC tag to protect Bitcoin private-keys with perfect secrecy.

And we can meet these two constraints easily:

The XOR-key is random.

The XOR-key is longer than Bitcoin private key length.

but what about the third constraint “you may never reuse a key”?

Review the encrypt progress:

bitcoin_private_key XOR NFC-XOR-KEY = xor-encrypted-data

and XOR is commutative, so:

NFC-XOR-KEY XOR bitcoin_private_key = xor-encrypted-data

Now we look as using the bitcoin_private_key to encrypt the NFC-XOR-KEY, and we know the bitcoin_private_key is random, and there is just one NFC-XOR-KEY as the pant-text message, so the xor-ed key (bitcoin_private_key) is never reused.

So finally, we can use one NFC-XOR-KEY, to protect many Bitcoin private-keys and keep perfect secrecy.

With this perfect secrecy XORed encryption, the protected private keys can resist any brute-force crack. Even if the attacker gets wallet data, he cannot decrypt the private-keys.