Java encryption and decryption symmetric encryption algorithm asymmetric encryption algorithm MD5 BASE64 AES RSA

Source: Internet
Author: User
Tags base64 encode asymmetric encryption

[Preface]

This article briefly introduces the concepts related to encryption technology, and finally summarizes the existing encryption technology in java as well as its usage and examples.

[Simple encryption]

1. Simple concept

Plaintext: the information before encryption

Ciphertext: Confidential Information

Algorithms: encryption or decryption algorithms

Key: The key used by the algorithm (read as miyao, correct should be miyue, but everyone reads miyao)


2. Simple Example

Set 123456Add 1 to each number.234567,

123456 is the plaintext, 234567 is the ciphertext, And the encryption key is 1. the encryption algorithm is


3. symmetric encryption and asymmetric encryption

For example,

123456 --> 234567 of the encryption key is 1, and the encryption algorithm is for each +

234567 --> 123456 the decryption key is also 1, and the decryption algorithm is for each-

The encryption algorithm (+) and the decryption algorithm (-) are called symmetric encryption,

Likewise, asymmetric encryption is called an asymmetric encryption algorithm.


4. algorithm example

Symmetric encryption algorithms: DES algorithm, 3DES algorithm, TDEA algorithm, Blowfish algorithm, RC5 algorithm, IDEA algorithm,AES Algorithm.

Asymmetric encryption algorithm:RSA, Elgamal, backpack algorithm, Rabin, D-H, ECC.

Typical hash algorithms: MD2, MD4,MD5And SHA-1 (the purpose is to convert any long input to a fixed long output by using an algorithm, and ensure that the input changes slightly and the output is different, and reverse decryption is not allowed)


5. Classic Algorithms
AES (symmetric), RSA (asymmetric), MD5, SHA-1 (hash)

[Algorithm example]

1. base64

It is not an encryption algorithm, but an encoding method. Because the encrypted data is byte [], for readability, byte [] is generally converted into base64 encoding.

Example: Java-encrypted base64 encode

2. md5

It is not an algorithm. It is the fifth version of the message digest algorithm. It is a hash algorithm and is generally used for unidirectional encryption.

Example: Java-based MD5 Encryption

3. AES

Symmetric encryption algorithm, the receiver of DES

Example: Java-encrypted AES symmetric encryption algorithm

4. RSA

To be updated

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.