In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Xiaobian to share with you how Linux to achieve random number generator, I believe most people still do not know how to share this article for your reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!
Random Number Generator for Linux File Security
First of all, it has always been to check whether the software is installed. In fact, this does not need to be checked. The default installation is generally available. The required commands and packages are as follows
OK, let's demonstrate this with two users in the picture below, Steven and Kevin.
First of all, everyone has to have their own public and private keys, let's first generate it, use the command gpg-gen-key to generate it, the following figure asks us which algorithm to use, I will use the default, the first, directly Enter
OK, now ask us what the key length we want is, between 1024 and 4096, the default is 2048, I also use the default, directly enter
OK, now ask us how long after the key expires, I will use never expires, which is the default, again, directly enter
Now we need a user ID to identify our key. Needless to say, it's steven, because this is steven generating his own key. After confirming the information, we press O to generate our KEY.
Now let's enter the password in KEY, it will be more secure, even if your file and public key are in someone else's hand, there is no password.
do it again
Now it's time to start our generation journey. We can tap the keyboard, move the mouse, write to the disk, and so on, and we'll generate our unique key.
Here's what I typed in. Feel free.
Then you will see the following figure, indicating that the generation was successful
Let's derive our key.
Let's see what's in it, as shown below, okay, I'm dizzy, I don't understand it, but I don't understand it, because it's encrypted.
Okay, so we switch to kevin, and then again, he generates a key.
Similarly, he also derived a key.
OK, so far, even if the two users 'keys are generated, now let's start to let the two users import each other's keys.
Steven imported kevin's secret key into the image below.
Kevin imported steven's secret key.
Okay, so steven has a file called 1.txt.
Now let's do the encryption and decryption process, now encrypt 1.txt
Gpg-ear is encrypted, followed by the user ID of the user you want to give the file to, and then which file name
Okay, encryption is complete, so let's look at the encrypted stuff, see if we can actually see what's there, and look, the image below is encrypted, and now let's use kevin to look at it, because we authorized it to see.
In the picture below, Kevin logged in. What he saw was also garbled, indicating that certain security can be guaranteed during transmission. After anyone gets it, it is garbled. Only the person we specify can decrypt it.
Let's try to decrypt it with kevin, follow the file with gpg-d, and then we put the content in task.txt
All right, we need to get the code right
Now let's take a look at the contents of that task.txt, you should be able to see the contents now.
That's all for "How to implement a random number generator in Linux." Thanks for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
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.