Python's multiple methods of encrypting and decrypting AES

foreword

This article is the 24th article of this column, and I will continue to share various dry goods knowledge of python later, which is worthy of attention.

Students who have done reptile projects have encountered AES encryption and decryption.

In cryptography, encryption algorithms are also divided into two-way encryption and one-way encryption. One-way encryption includes digest algorithms such as MD5 and SHA, which are irreversible. The two-way encryption includes symmetric encryption and asymmetric encryption , and the symmetric encryption includes AES encryption, DES encryption, etc. It should be noted that two-way encryption is reversible, and there is a key for the ciphertext. The AES algorithm is a substitute for the DES algorithm, and it is also one of the most popular encryption algorithms now.

So what exactly is AES? In general, the AES encryption standard, also known as the Advanced Encryption Standard Rijndael encryption method, is a 21st century encryption standard designed by the National Institute of Standards and Technology NIST to replace DES. The basic requirement of AES is to adopt a symmetric block cipher system, the key length can be 128, 192 or 256 bits, and the block length is 128 bits. It is worth mentioning that in 1998, NIST started the first round of analysis, testing and collection of AES, and a total of 15 candidate algorithms were produced.

Next, the author will introduce the encryption and decryption of AES in detail with the specific code.

text

1. Install third-party libraries

Before using python to encrypt and decrypt AES, first install the corresponding library that needs to be used.

That is the main character to be introduced in this article——

おすすめ

転載: blog.csdn.net/Leexin_love_Ling/article/details/130056587