What are the encryption methods commonly used in network security?

王林
Release: 2021-01-08 10:01:14
forward
12742 people have browsed it

What are the encryption methods commonly used in network security?

The following are several encryption methods commonly used in network transmission:

(Learning video sharing: Programming video)

Tip: These encryptions involve plain text transmission and need to be encrypted and transmitted over the https protocol.

1. Key hashing

Use MD5 or SHA1 and other hashing algorithms to encrypt the plain text (the encryption here is only for people, not machines, because these algorithms and machines can use corresponding algorithms Calculate it)

What are the encryption methods commonly used in network security?

Advantages: Anti-tampering
Applicable scenarios: Ordinary file downloads
Disadvantages: No security, certifiable

2. Symmetric encryption

What are the encryption methods commonly used in network security?

Advantages: safe and authenticable
Applicable scenarios: fixed number of senders and receivers, few key users
Disadvantages: BS network transmission relationship , too many keys are difficult to maintain unless the key is encrypted and transmitted

3. Asymmetric encryption

3.1. The receiver sends the public key (to ensure data integrity)

Premise: The sender receives the receiver's public key during the first communication and saves it locally

What are the encryption methods commonly used in network security?

3.2. The sender sends the public key (guaranteeing the sender's authentication)

Premise: The receiver receives the sender’s public key during the first communication and saves it locally

What are the encryption methods commonly used in network security?

4, digital signature

What are the encryption methods commonly used in network security?

Applicable scenarios: login authentication
Disadvantages: insufficient confidentiality

Shorthand

Symmetric Algorithm

Symmestric Algorithm.Create ()=>
Provider.CreateEncryptor()
Provider.CreateDecryptor()
CryptoStream(Stream stream,ICrytoTransform transform,CryptoStreamMode mode):
CryptoStream(encryptedSteam,encryptor,CryptoStreamMode.Write)/ /Encryption is ready to read empty encryptedSteam is ready to be written
CryptoStream(encryptedSteam,decryptor,CryptoStreamMode.Read)//Decryption is ready to be written into the ciphertext stream encryptedSteam is ready to be read

Asymmetric encryption

Asymmetric encryption (ASymmisticAlgorithm):
Provider provider
provider.ToXmlString(true);//Get the public and private key pair
provider.ToXmlString(false);//Get the public key
provier .FromXmlString(publicKeyXml);
provier.FromXmlString(privateKeyXml);
provider.Encrypt();
provider.Decrypt();

Example:

Symmetric encryption :

            string key = "abc";
            string sendContent="你好!";
            var byteKey = Encoding.UTF8.GetBytes(key);
            var byteIV = Encoding.UTF8.GetBytes(key);//加密算法初始化向量
            DESCryptoServiceProvider des = new DESCryptoServiceProvider();//使用des加密
            byte[] bytesContent = Encoding.UTF8.GetBytes(sendContent);
            MemoryStream ms = new MemoryStream();
            CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(byteKey, byteIV), CryptoStreamMode.Write);
            cs.Write(bytesContent, 0, bytesContent.Length);
            cs.FlushFinalBlock();
Copy after login

Related recommendations: Website Security Tutorial

The above is the detailed content of What are the encryption methods commonly used in network security?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template