BTC key algorithm
How are bitcoin addresses and private keys generated? Bitcoin uses elliptic curve algorithm to generate public key and private key, and chooses secp256k1 curve. The generated public key is a 33 byte large number, and the private key is a 32 byte large number. The wallet file wallet.dat directly stores the public key and private key. The bitcoin address we use when receiving and sending bitcoin is obtained after the public key is processed by the algorithm. The specific process is that the public key is first processed by SHA-256 algorithm to get 32 byte hash result, then processed by ripemed algorithm to get 20 byte summary result, and then the address we see is obtained through the character conversion process. This character conversion process is the same as that of the private key. The steps are as follows: first, add the version number to the input content (the summary result of 20 bytes for the public key and the large number of 32 bytes for the private key). After two successive SHA-256 algorithms, take the first 4 bytes of the hash result of the last time as the check code and attach it to the back of the input content, and then encode it with base58, Get the string{ RRRRR}
2. If you replace it with the earliest backup wallet (wallet. DAT), you can still trade normally. Considering the principle of bitcoin, it can be concluded that as long as there is a private key (wallet), you can prove that you are the legitimate owner of the wallet. No matter whether you encrypt or delete the wallet (the core is the private key corresponding to an address), you can't deny it
3. When backing up the bitcoin wallet, you should also pay attention to the existence of the change mechanism of bitcoin payment (for example, if you send 50 BTC in a complete 100 BTC to an address, the system will send 50 BTC to the other party's address, and return 50 BTC to a new address of your client, which will not be directly displayed in your address list)
4. After sending bitcoin to other addresses 100 times or using 100 different addresses to receive bitcoin, please back up your wallet again, otherwise the returned and received bitcoin will be lost forever. In addition to encrypting wallets, users can also generate offline paper wallets and brain wallets.
Theoretically, it is possible, but at present, human computer technology has not achieved such high performance, so it is almost impossible to crack with traditional technology. With the development of quantum technology, the current encryption technology is likely to be completely cracked, including bitcoin algorithm, RSA encryption and so on em>
private key
is a 256 bit
random number
, which is generated by SHA-256 algorithm
keep the private key with symmetric encryption. Symmetric key algorithm means that both encryption and decryption use one key. The encryption methods we usually use are symmetric encryption, such as WinRAR encryption, bitcoin QT encryption of the private key file is also using the symmetric encryption algorithm. The commonly used symmetric encryption algorithms are AES, DES, RC4, RC5 and so on. Symmetric encryption requires users to set relatively complex keys to prevent brute force cracking. Go to top method 1 uses bitcoin QT to encrypt the private key wallet. In the command mode, we can use the encryptwallet command to encrypt the wallet. For the usage of command mode, please refer to the basic teaching of bitcoin: how to use the private key of paper wallet. This is the most simple and effective method of private key encryption. However, when the walletpassphrase command is used to decrypt the wallet, the key will be read into the computer memory, so it is possible for the attacker to obtain the key. Encryption command: encrypt wallet yourpassword decrypt wallet command: walletpassword yourpasswordtimeout change password command: walletpassword exchange oldpasswordnewpasswordgo to top method 2, use AES encryption provided by blockchain. Blockchain provides users with private key file encryption service based on AES algorithm. Users can download the encrypted file and save it properly
go to top method 3 uses TrueCrypt, a third-party software, to encrypt the key file, which is also recommended by the editor. TrueCrypt is open source and free, with high software maturity, and supports two factor authentication and whole hard disk encryption. In addition, FBI personnel have suffered losses on TrueCrypt, so they have a good reputation. The FBI has admitted defeat in attempts to break the open source encryption used to secure hard drives seized by Brazilian police ring a 2008 investigation.
the bureau had been called in by the Brazilian authorities after the country's own National Institute of Criminology (Inc) had been unable to crack the passphrases used to secure the drives by suspect banker, Daniel Dantas.Brazilian reports state that two programs were used to encrypt the drives, one of which was the popular and widely-used free open source program TrueCrypt. Experts in both countries apparently spent months trying to discover the passphrases using a dictionary attack, A technique that involves trying out large numbers of possible character combinations until the correct sequence is found. Users who use it must keep the key in mind. If you forget the key, no one can recover your encrypted files
TrueCrypt, the official website of TrueCrypt, uses the asymmetric encryption method to keep the private key of the document. The asymmetric encryption method uses the form of public key and private key to encrypt the file. Users can encrypt files with public key and decrypt files with private key. Common asymmetric encryption algorithms include RSA, ElGamal, ECC and so on. The advantage of asymmetric encryption is that the complexity of the key is generally very high, which can effectively prevent violent cracking. The disadvantage is that there is a certain threshold, which is not suitable for ordinary users. Go to top method 1. Indivial users can consider using RSA for encryption. First, you can create a public key and a private key. Click here to generate the key. After keeping the public key and private key properly, you can encrypt and decrypt with the public key. Click here to encrypt and decrypt. RSA public key and private key generation process RSA public key and private key generation process randomly choose two large prime numbers P and Q, P is not equal to Q, calculate n = PQ. According to Euler function, R is obtained= φ( N) = φ( p) φ( q) = (p-1) (Q-1) select an integer E which is less than R and obtain the mole inverse element of e with respect to mole R, named D If and only if e and R are coprime, the records of P and Q are destroyed N. E) is the public key and (n, d) is the private key. Second, we can use PGP (pretty good privacy) tool to encrypt files. PGP encryption allows each public key to bind to all information of a user. Compared with RSA, the function of PGP is more perfect and reliable. However, with the upgrade of Pgp, new encrypted messages may not be decrypted by the old PGP system, so users should be familiar with PGP settings before using PGP. There are many PGP encryption tools on the Internet, so the editor will not list them
Introction to Pgp in Wiki PGP online encryption and decryption system PGP command FAQ advanced method to keep the private key. The above ways to keep the private key are very common. An experienced attacker may still get the user's private key file. For more advanced private key storage methods, please refer to the advanced teaching content of bitcoin in the future.
