I got this idea to use the features of the one-time pad, an encryption technique that provably cannot be cracked, but this time applied to encrypt a private key. A possible application could be to encrypt the private keys of a bitcoin wallet, or any other random private-key data. It fills a similar market as the familiar AES encryption but with the following features:
- (as a con) it is restricted to random data such as private-keys
- (as a pro) it is provably secure.
The algorithm is subject to the same limitations as a one-time pad algorithm and has the same benefits, but it can be used to encrypt sensitive data such as a bitcoin wallet in a provably secure manner. This is an improvement on the current art, which generally consists of using AES.
The algorithm would work as follows. I'll use 256 bit as an example, but any size should be fine for the algo to work (of course, the more bits, the more secure it is).
- Generate a 256-bit random number. This is the private key.
- Prompt the user for a password that is at least 256-bit long.
- Produce an encrypted file using XOR over the private key and the password.
- Delete the private key, saving only the encrypted file.
A user, aware of the password and the encrypted file, can produce the cleartext private key. Whereas an attacker, only aware of the encrypted file, provably cannot improve the brute force attack - the encrypted file, as it acts as the key component to a one-time pad, thus acquires its benefits.
Note: If 256-bit is considered too long for some user to remember their passwords, one can use a hashing algorithm such as Argon2 to produce a hash of 256-bits, possibly using a shorter password. In this case, the encrypted file will be produced as a result of using XOR between the hash and the private key. In this case, the security of the scheme is potentially less than if the user had used a 256-bit long password, but this nonetheless allows the user to tradeoff between password-length and security, which might be desirable in some circumstances.
This scheme guarantees that there are -provably- no possible algorithmic weaknesses with the encryption scheme: any and all possible weaknesses are exclusively offset to the domain of password selection by the end-user.
Unless I am missing something major here, this seems 100% the way to go to truly secure my private-keys... way way way better than AES. Am I missing something?