MD5 and RSA are the two most commonly used algorithms in network transmission. After understanding the principles of these two algorithms, you can get a general idea of what encryption is like. However, these two algorithms use different environments and are just complementary.
I. MD5 Algorithm
First, MD5 is irreversible and can only be encrypted but cannot be decrypted. For example, if the plaintext value
The main steps are as follows:1. Use Secretkeyfactory.getinstance ("encryption algorithm") to create the key factory, encryption algorithm such as "DES", "AES" and so on2. Generate the Key object with the new Deskeyspec (original key), the original key is the byte[] type3. Converting a key object into a canonical key object using the Generatesecret (Key object) m
(This article only saves copies)
Original http://edu.yesky.com/edupxpt/64/2182064.shtml
In view of the importance of RSA encryption and the lack of relevant source code, it is hereby posted. Need to download the bcprov-jdk14-123.jar.
Import javax. crypto. cipher;
Import java. Security .*;
Import java. Security. spec. rsapublickeyspec;
Import
1. Overview
In Internet-based applications, the sender encrypts and transmits the characters in a certain way, while the receiver decrypts the characters based on the agreed key. In this way, even if the characters transmitted are intercepted, it will not be easily identified. In addition, many application environments are complex. The server is a Java application, and the client has Java applications and
We all know that when the user joins the information, some sensitive information, such as the ID number, mobile phone number, the user's login password and other information, is not directly into the database. Today we will be a detailed example to illustrate the pure digital Java encryption and decryption technology.In general, after we get the information from
The simple Java encryption algorithm is:
BASE64 strictly speaking, it belongs to the encoding format, not the encryption algorithm
MD5 (Message Digest algorithm 5, Information Digest algorithm)
SHA (Secure Hash algorithm, security hashing algorithm)
HMAC (Hash message authentication code, hash messages authentication code)
1. BASE64Base6
Use encryption technology to protect Java source code
JavaThe source code of the program is easily peeked at by others. Anyone can analyze others' code as long as there is an anti-compiler. This article discusses how to avoid modifying the original programInEncryptionTechnical Protection source generation.
I. Why?Encryption? For traditional C or C ++ languages, i
We all know that when users add information, some more sensitive information, such as the identity card number, mobile phone number, user login password and other information, is not directly in the text into the database. Today, we will illustrate the pure digital Java encryption and decryption technology with a concrete example.In general, after we get the information from the page to the user, we encrypt
Java SMS4 Encryption AlgorithmIntroduction to SMS4:
This algorithm is a grouping algorithm. The Group length of this algorithm is 128 bits, and the key length is 128 bits, that is, 16 bytes. Both the encryption algorithm and the key extension algorithm adopt a 32-round nonlinear iteration structure. The decryption algorithm has the same structure as the
a pair of keys using the RSA algorithm and stores it//in th EIR respective files GenerateKey (); } final String originaltext = "Text to is encrypted"; ObjectInputStream inputstream = null; Encrypt the string using the public key InputStream = new ObjectInputStream (new FileInputStream (Public_key_file)); Final PublicKey PublicKey = (publickey) inputstream.readobject (); Final byte[] ciphertext = Encrypt (Originaltext, publickey); Decrypt the cipher text using
This example describes the MD5 encryption usage of Java Web development. Share to everyone for your reference. Specifically as follows:
MD5 is the acronym for Message Digest 5, an encryption algorithm that encrypts byte arrays with the following characteristics:
① cannot find the information before
usually, the encryption algorithm used is simple and efficient, the key is short, the encryption and decryption speed is fast, the decoding is extremely difficult. This article describes the use of Md5/sha1,dsa,desede/des,diffie-hellman.
The 1th Chapter Basic knowledge1.1. Single-Key cryptosystemSingle-key cryptosystem is a traditional encryption algorithm,
The Java encryption and decryption technology series SHA
Order
Background
Body
Comparison of SHA-1 and MD5
Code implementation
Conclusion
OrderThe basic one-way encryption algorithm--MD5 is introduced in the previous article, and the principle of its realization is also roughly stated. This article continues the one-way
the Java classes involved in DES encryption decryption
Cipher
This class provides password functionality for encryption and decryption. It forms the core of the Java cryptographic Extension (JCE) framework .To create the Cipher object, the application invokes the Cipher getinstance method and passes the name of the r
Des cryptographic decryption involves the Java class cipherThis class provides password functionality for encryption and decryption. It forms the core of the Java cryptographic Extension (JCE) framework .To create a Cipher object, the application calls Cipher's GetInstance method and passes the name of the requested transformation to it. Optionally, you can speci
Asymmetric encryption algorithm RSA process: A case of both sides of A and B1. Initialize key building key pair, generate public key, save private key to KeymapKeypairgenerator--->keypair-->rsapublickey, rsaprivatekey2, party a use private key encryption, after encryption in the private key to the encryption data signa
Asymmetric encryption algorithm RSA process: A case of both sides of A and B1. Initialize key building key pair, generate public key, save private key to KeymapKeypairgenerator---> KeyPair-rsapublickey, Rsaprivatekey2, party a use private key encryption, after encryption in the private key to the encryption data signat
1. MD5 encryption.
Algorithm Is one-way encryption, that is, encrypted data cannot be restored through decryption. The related classes are included in the Java. Security. messagedigest package.
2. 3-des encryption. the encryption algorithm is reversible. The decryption part
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.