Hashing

Message Hashing -- is one of the basic operations in cryptography. The hashing function performs an irreversible transformation of arbitrary data into limited integer.

The result of hashing are called -- Hash Values, Hash Code, Hash-Sum, Message Digest, or Hash.

  1. MD-5 -- outdated algorithm, but it is well suited and often used to check passwords and integrity of files.
  2. RIPEMD-160 -- used to encode Bitcoin addresses.
  3. SHA-2 -- current algorithm for obtaining the base number of a digital signature.
  4. SHA-3 -- modern, highly reliable algorithm, practical for working with a Root Seed and generating private keys.

All algorithms are well suited for generating pseudo-random sequences.

String

Experiment with creating Private Key

  1. Come up with a top secret phrase.
  2. Hashing using the MD-5 algorithm.
  3. Write down the hash sum. According to the quote from the first point, it should be a57c8f892e19bebdc1d6795a3d2d2bee.
  4. Save this number by any means. This number is not secret. The only purpose of this is to reliably reproduce the secret phrase in the future.
  5. Append (without space) the date 2025-Jun-10 to the secret phrase.
  6. Hashing using the SHA-2 algorithm. In this example, it should be f0a6f7b8befa9d904726dc867a68bb7306ac5fd5bc74eae2a3a9216499d007be.
  7. Insert a space between the secret phrase and the date. Repeat the hashing. Compare the result with the previous one.

The resulting number f0a6..07be can be used as private key for Bitcoin.

The proposed scheme makes wallets unnecessary.

Storing private keys in a wallet is dangerous:
  1. Wallet file theft and hacking
  2. Program errors and data loss
  3. Computer crash and data loss
  4. User errors while working with the archive
Using a seed to generate keys eliminates these problems. You need to focus on creating a strong key and reproducing it without errors.

Experiment for mail

  1. Rewrite Suffix 2025-Jun-10 to your email mail@example.com.
  2. Perform hashing using algorithm MD-5.

The resulting number f3422e2c76b7fb8eaf0e7f06f3205b03 will be a good password for your mailbox.

And again! --You don't need to remember it or save it anywheres.

The Suffix of seed is not secret. You can use Suffix to index keys and passwords.

Use the Current Date as the Suffix to generate Bitcoin keys. Then you can easily recover the key by trying a small number of Suffix variations.

Plain text

Hashing text is no different from hashing a characters string. But there is a practical nuance -- invisible characters EOL. You need to be careful when exchanging texts created in different operating systems.

Any type file

For a better understanding, try the following tasks.

(1) Create a simple text file and perform hashing. Compare the hash sums of the file and the text from the previous form. If the texts are technically absolutely identical, then the hash sums should be equal.

If this is not the case, be patient and try to find the error. Most likely, it will be related to the ends of the lines.

(2) Create several files that differ by exactly one character or an empty line. Compare their hash sums.

(3) In the first form, enter a line of text and calculate the hash. Try to create a text file with the same hash sum.

Hash of Hash

Some hashing algorithms are considered weak. And there are situations where you need extra security. If you are unsure, you can apply the hashing function to some data multiple times.

Surely, a little bit of paranoia is quite useful in cryptography ;-)

Please note that to calculate the hash sum from the hash sum, the binary representation of the number must be fed to the input of the algorithm.

md5(                               "123" ) = 202cb962ac59075b964b07152d234b70
md5( 0x202cb962ac59075b964b07152d234b70  ) = d022646351048ac0ba397d12dfafa304
md5(  "202cb962ac59075b964b07152d234b70" ) = d9b1d7db4cd6e70935368a1efb10e377

202cb962ac59075b964b07152d234b70 (hexadecimal) == 42767516990368493138776584305024125808 (decimal)

If you have difficulty understanding binary data and text encoding, go to ASCII.

Conclusion

Slightest change in the suffix gives a reliable change in the hash sum. Result -- compromising any derived key does not create risks of leakage of the root secret and other derived keys.

Software or e-wallet is only needed by scammers-programmers to sell to suckers.

Subskribita.net