Order
In the previous article, we briefly introduced the second asymmetric encryption algorithm--DH, which is often called the key exchange protocol, which is mainly for the protection of the key. At the same time, due to the level of the limit, the intention of this series is over, this article is a summary of it, review what has been written in the past few months.
Background
In fact, before I started writing this series, I didn't know much about Java's encryption and decryption. The reason to write these articles is mainly due to the work. Remember a few months ago, when the project to do a digital certificate, certificate generation, storage, transmission and other processes are required to encrypt, at that time, I am not so understanding of the addition and decryption of this piece, it is simply a bad time to fill a short, simple study. Later, after the work of the task is completed, consider the addition of decryption this piece in the work is very frequent, it is better to share, a piece of learning.
Classification
- One-way encryption algorithm
- Symmetric encryption algorithm
- Asymmetric encryption algorithm
- Digital Signature Algorithm (not covered)
Common algorithms
- BASE64
- MD5
- SHA
- Hmac
- Des
- 3DES
- Aes
- Pbe
- Rsa
- Dh
Principle
Writing so many encryption and decryption algorithms, in fact, they are essentially the same principle. Just beginning to write the first few times, have not found, but the more to the back, this feeling is particularly obvious, careful thinking is really, it seems that my response is a little slow ah.
The so-called encryption, said the popular point, is the original data, change the form of output, so that the human eye can not be identified at a glance, thereby protecting the authenticity of the data. So for computers, computers only know 0 and 1. No matter what form of data, for the computer is the same, are a lot of 0 and 1 combination. 0 and 1 are the same, but different combinations (or permutations) produce different results, and the purpose of encryption is to allow it to produce different results so that other people or computers do not recognize them correctly, so that the data is not compromised or tampered with.
Different cryptographic algorithms, the principle is common, but the complexity of the encryption is different. Moreover, many cryptographic algorithms are based on a different encryption algorithm on the basis of implementation. In the final analysis, it is the use of certain methods, according to certain rules, using other characters (including some special characters) to replace the normal character, so that it changes the normal form of expression.
About Code
In the sharing of each algorithm, the general will be affixed to the Java implementation code, these code, some of my own writing, some reference to some of Daniel's, after their implementation, only posted to the blog post, mainly to facilitate the learning and understanding of other children's shoes. Of course, in these codes, I have projects here, and if any of the small partners need to, I can be a private person.of course, the code is not very good, there are a lot of things to improve, I hope the great God passed by many criticisms.
Concluding remarks
This encryption and decryption series has lasted such a long time, it is not my wish, but, after this period of research, for the encryption of this piece, I learned a lot, at the same time, also solved a lot of problems. Before I feel very boring, do not understand the East, now is very clear. I hope these things can help the little friends.
Finally, say goodbye, Encrypt and decrypt!.
Summary of the Java encryption and decryption technology series