DES encryption for Android data encryption

preface:

A colleague asked me about the implementation of Android DES encryption. I simply implemented it. Let's summarize it today.

Several other encryption methods: • RSA encryption for Android data encryption • AES encryption for Android data encryption • DES encryption for Android data encryption • MD5 encryption for Android data encryption • Base64 encoding algorithm for Android data encryption • Sha secure hash algorithm for Android data encryption

DES encryption introduction: DES is a symmetric encryption algorithm. The so-called symmetric encryption algorithm is an algorithm that uses the same key for encryption and decryption. DES encryption algorithm came from the research of IBM and was officially adopted by the U.S. government. Later, it began to spread widely. However, it is less and less used in recent years, because des uses 56 bit key and can be cracked within 24 hours with modern computing power.

DES encryption usage:

1.) desutil constant class introduction

1.) dynamically generate secret keys

The length cannot be less than 8 bytes, because the fixed format of DES is 128bits, i.e. 8bytes.

3.) two methods of processing secret key

First:

Second:

4.) encryption implementation

5.) decryption implementation

Des knowledge extension: 3DES

3DES is a mode of DES encryption algorithm. It uses three 64 bit keys to encrypt data three times. Data encryption standard (DES) is a long-standing encryption standard in the United States. It uses symmetric key encryption. 3DES (Triple DES) is the encryption algorithm for the transition from des to AES (NIST designated 3-DES as the transitional encryption standard in 1999), which is a more secure deformation of Des. It takes des as the basic module and designs the packet encryption algorithm through the combined packet method.

Comparison between DES and AES:

When asked to use DES encryption, I refused in my heart. Just from the name, AES (Advanced Encryption Standard) advanced encryption standard has higher security than des. In fact, AES itself is to replace des. AES has better security, efficiency and flexibility than DES, so AES is preferred for symmetric encryption.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>