In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what is the way to encrypt the one-time password book". The content in the article is simple and clear, and it is easy to learn and understand. let's go deep into the editor's train of thought. Let's study and learn "what is the way of one-time password book encryption"?
Disposable password book
Disposable codebook, or Vernam Cipher, is an encryption algorithm developed by Gilbert Vernam in 1917.
The reason why it is called an one-time codebook is that the key used for encryption is one-time, that is, the key will only be used once, and the previous encrypted content will not be decrypted due to the disclosure of the key.
Even if the key is compromised, it will only affect the communication process once.
Preparation before encryption
In general, what do we need to do if we want to encrypt a message?
In the modern computer society, we all know that the computer can only represent the two numbers 0J1, so if you transmit the text, you need to convert the text into the corresponding binary code.
There are many existing coding rules, such as ASCII,Unicode, which we will introduce in the following articles.
Similarly, to encrypt the encoded text is to encrypt the binary of the encoded text through a certain bit operation to get the encrypted result.
The encryption method of disposable codebook
Back to the one-time password book, his encryption method is very simple, which is to XOR plaintext and a string of random binaries. This random binary number can be generated by constantly tossing a coin (1 on the front and 0 on the back):
Encode the plaintext, that is, convert it to binary.
Generates a key with the same number of binary digits as plaintext.
XOR the plaintext and the binary of the key to generate the final result.
Decryption of disposable codebook
How do we decrypt it after encryption? Let's take a look at the features of XOR.
XOR refers to an XOR operation. The result of XOR is 0 when the number on the bit is the same, and the result of XOR is 1 when the number above is different.
For example:
0 XOR 0 = 0
0 XOR 1 = 1
1 XOR 0 = 1
1 XOR 1 = 0
A very important characteristic of XOR is reversibility, that is:
A XOR B = C, then C XOR B = A.
Then the result obtained through the XOR of the original text and key can be obtained by XOR operation of the result and key again.
This is the process of decrypting an one-time codebook: XOR the key and the result.
Unable to decipher
Although the one-time password book is very simple, the one-time password book cannot be deciphered. This decoding does not mean that the existing computing power is not enough, but that it cannot be deciphered even if it has infinite computing power.
Why?
If you get the encryption result, and then traverse the equal-length key to crack it violently, you will finally generate the original text, assuming that the original text length is 128bit, then you can generate all the combinatorial arrangements of the original text of 2 to the 128th power, that is, the 128bit length of the original text.
Even if there are some meaningful words in these combinations, you are not sure whether they are the original text, because multiple meaningful words may be generated in all the combinations.
So this kind of decryption is meaningless, just like I know the length of the original text, and then construct the original text of that length myself.
Defect
Since the disposable password book is so good, why do we seldom use it in actual work?
The key is too long
The one-time password book is different or obtained with a key as long as the original text, and if the original text is very large, then the corresponding key is also very large.
Unable to reuse key
Each key is used only once, which is both a disadvantage and an advantage. It means that we have to change the key every time, which adds complexity.
Distribution of key
Because the key is the same length as the original text and ciphertext, the target side must get the key if it wants to decrypt it. If it can transmit the secret key to the target side, why not send the original text secret to the target side directly?
Preservation of key
Each encryption needs to change a key, which means that each plaintext needs to save a key of the same length, if plaintext can be well preserved, then why do one more step of encryption?
Thank you for your reading. The above is the content of "what is the way to encrypt an one-time password book". After the study of this article, I believe you have a deeper understanding of what is the way to encrypt an one-time password book. The specific use of the situation also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.