Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use Gpg4win to create a secure encrypted file

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Out of work needs, recently I was studying file encryption, just to find a tool to say.

I. Brief description of encryption mode

Encryption tools are based on algorithmic patterns and generally fall into two categories, one symmetric encryption and the other asymmetric encryption. The former encryption and decryption use a set of keys, often used for cryptographic encryption; the latter asymmetric encryption, encryption and decryption use two sets of keys: generally public key encryption, private key decryption.

File encryption is mainly for security, it is true that many software itself also carries encryption functions, but based on symmetric encryption password mode, security is questionable. Today I'm not going to talk about encryption principles, but I'm going to show you how asymmetric encryption tools work in practice.

Gpg4win is undoubtedly an asymmetric encryption software that is relatively easy to use under the Windows platform.

Official address: pgp4win latest version is 3.0.3

The tool is free, but I encountered a donation prompt when downloading it, and if there is no paypal, there is no problem. If so, watch out for donations.:)

2. Install GPG4win

WINDOWS software as long as it does not involve configuration installation is generally all the way next can be

1. Package

The good news is, this software has Chinese language, happy?

Installation wizard appears in Chinese language

Required and optional. Please study the specific functions by yourself.

5. Installation complete, icon as follows

Third, create a public-private key pair After starting the program for the first time, the default is that there is no key pair. You need to create it manually. Click "Create Key Pair"

Create a secret key requires 2 parameters, name and email, email address does not need to be a real email address, address format is consistent, as follows

3. Ask you to double check before and after formal creation

Then you are prompted to belong to the password used to protect your secret key, and suggestions will be made based on your password strength.

5. Creating a key pair takes a certain amount of computation time

6. Create complete prompt you to save copy or send public key etc.

7. will be displayed on the main screen.

. IV. Public and private key encryption test 1. Premise preparation

I prepared three text files for testing, as follows

2. Encrypt a file for your own use

1. Click the Sign/Encrypt button

This time I choose z00w00.txt file and choose Encrypt for me

3. At this point, you have to enter the password you just prompted. The advantage of this is to prevent others from stealing your computer to encrypt it for you.

4 will prompt after success

5. The desktop generates the z00w00.txt.gpg file

6. This file will not be opened on other computers

Even if you open it in notepad, it's gonna be garbled.

Even if someone else gets the file and installs the software, because there is no private key, it cannot be decrypted, as follows

The above is the practical instructions for protecting your own files, so you don't have to worry about women checking your computer often and finding that you have a bad record of XX sister videos.

^_^

3. Encrypt files for others

The following highlights another problem, how to encrypt files so that only designated people can open them

Premise 1: The other party needs to install the software (seemingly nonsense) Premise 2: You need to have the other party's public key

Again, public key encryption, private key decryption

To complete this test, I found another computer, software, and created the key pairs as follows:

1. Export import public key

Now complete 2 moves

Export it-dream's public key Import it-dream's public key to z00w00 Export the public key as follows:

Remember to check (highlight) and export

A file similar to the following will be exported

Import public key to z00w00

Import completed

2. Encryption and decryption

Select, Encrypt for others and check others 'public keys

Continue will raise a warning, just continue

There will be a prompt when encryption succeeds

Due to the use of the other party's public key encryption, if the original file is lost, you cannot decrypt it back to the original file.

Now let's let it-dream decipher it.

Because it contains a signature and z00w00 does not give it-dream the public key, it will report the following

This time we import the public key of z00w00 to it-dream and it's OK

So you can see the original file.

In bold is your secret key.

V. Signature only, no encryption

Document signatures are used to protect the document itself, and if the original document has been tampered with, it can be proved that it is not the original author himself. This feature is often used for software distribution, and many software developers use signature to protect the software itself in order to prevent their software from being decompiled and injected with harmful code.

1. Let's sign z00w002.txt and look at the original content first.

2. Uncheck encryption and output signature file

3. Output signature file

Now we can send the signature file z00w002.txt.sig and the original file z00w00.txt to the target recipient.

When the file has not changed, verify that the file is as follows:

5. Now we tamper with the original document and add the following text

6. If you check again at this time, you will definitely report an abnormality.

When I actually test, I use signature verification. When the program is executed, it always reports abnormal termination of the program. After 2 sets of system tests, I rule out the problem of a WINDOWS system. I initially think it is a software compatibility problem.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report