such as AES and DES.
During project development, the company encountered the problem of cross-platform encryption and decryption of JAVA and PHP. After finding information from multiple parties and researching it, we found a general basic encryption and decryption solution as follows:
1: JAVA code (3DES)
Import javax. crypto. Cipher;
Import javax. crypto. SecretKey;
Import javax. crypto. spec. SecretKeySpec;
Import org. apache. log4j. Logger;
Import
RC4 is a symmetric cipher algorithm, which belongs to a sequence cipher (Streamcipher, also known as a stream password) in a symmetric cipher algorithm, which is a variable key length and a stream password oriented to byte operations .RC4 is one of the stream cipher Streamcipher, which is a sequence
, which is suitable for encrypting the data that needs to be transmitted by the network, and the speed is inferior to symmetric encryption. Asymmetric encryption applied to SSH, HTTPS, TLS, electronic certificates, electronic signatures, electronic IDs, etc.
The realization of symmetric encryption for fingerprint identification
The main process for using fingerprint-aware symmetric encryption is as follows:
Use Keygenerator to create a symmetric key that is stored in the KeyStore.
Set KeyGen
encryption. Common symmetric encryption algorithms are DES, 3DES, AES, Blowfish, Idea, RC5, RC6.The security of asymmetric encryption is relatively high, which is suitable for encrypting the data that needs to be transmitted by the network, and the speed is inferior to symmetric encryption. Asymmetric encryption applied to SSH, HTTPS, TLS, electronic certificates, electronic signatures, electronic IDs, etc.
The realization of symmetric encryption for fingerprint identification
The main proces
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 requested transformation to it. You can also s
Introduction
rsa cryptosystem is a public key cryptosystem which is proposed earlier. In 1978, Rivest,shamir and Adleman of the Massachusetts Institute of MIT (MIT) presented an asymmetric (public key) cryptosystem based on number theory, called the RSA Cryptosystem, in a paper entitled "Methods for obtaining digital signatures and public key cryptography". RSA is a kind of block cipher system, which is based on the "large integer element factorizati
I. OverviewThis class is located under the JAVAX.NET.SSL package, class declaration: PublicAbstract classhttpsurlconnection extends HttpURLConnectionClass Hierarchy:Java.lang.Object java.net.URLConnection java.net.HttpURLConnection Javax.net.ssl.HttpsURLConnectionHttpsURLConnectionExtended HttpURLConnection to support a variety of HTTPS-specific features.This class usesHostnameVerifierAndSSLSocketFactory。 The default implementation is defined for each of the two classes. Howeve
-independent session mechanism. At the time, the only session available in the game was httpsessions, which required a Web container, or a stateful session bean in EJB 2.1, which also had an EJB container. And the one I want to decouple from the container, can be used for any session in the environment I choose.
The last is the encryption problem. Sometimes we need to secure the data, but the Java cipher architecture (Java Cryptography Architecture)
This article shows you how to set stronger SSL on a Nginx Web server. We are implementing this method by weakening the crime attack by invalidating the SSL. Do not use the vulnerable SSLv3 in the protocol and the following version and we will set up a stronger cipher suite in order to be able to implement forward secrecy where possible, we also enable HSTs and HPKP. This allows us to have a stronger, outdated SSL configuration and we get a level in th
/*
Name: Heman encoding (priority queue implementation)
Copyright:
Author: self-defeating
Date: 28/09/14
Description:
A common Linear table is transformed into a Heman tree by using the priority queue, and then carried out the Heman encoding to obtain a cipher book that simultaneously records the plaintext and the corresponding encoding.
Using the priority queue (minimum heap) to construct a Heman tree is an efficient method, which is much faster than
algorithmKeygenerator kg = keygenerator. getinstance ("des ");Kg. INIT (SR );// Generate the keySecret Key key = kg. generatekey ();// Save the key data as a file for future use, where key filename is the saved file nameFileutil. writefile (keyfilename, key. getencoded ());
(2) encrypt data. After obtaining the key, you can use it to encrypt data. As shown below.
[Encrypt raw data with a key]
// Generate a trusted random number SourceSecurerandom sr = new securerandom ();// Obtain key data from
For example, there is a 21-bit byte array which is divided into three blocks. If there are not enough 8 bytes, add 0x00 and perform DES encryption on the three blocks:
The encrypted three pieces of data are the data encrypted by the ECB.
JavaCodeImplementation:
Public static byte [] des3encodeecb (byte [] key, byte [] data) throws exception {secretkey secret ey = new secretkeyspec (key, "desede"); cipher = ci
, suitable for local data and local database encryption, and less secure than asymmetric encryption. The common symmetric encryption algorithms are DES, 3DES, AES, Blowfish, Idea, RC5, RC6.
Asymmetric encryption is more secure and suitable for encrypting data that needs to be transmitted over the network, and is less efficient than symmetric encryption. Asymmetric encryption applied to SSH, HTTPS, TLS, electronic certificates, electronic signatures, electronic IDs, etc.
Symmetric encryp
of SSL encryption1) Enable FIPSAction steps: Security options, local policy, security settings, Local policies, administrative tools----"System cryptography: Using FIPS compliant algorithms for encryption, hashing, and signing" options, right-click Properties, under Local security settings, Select "Enabled (E)" and click "Apply", "OK". 2 is shown below:Figure 2 Enabling FIPS2) Disable SSL cipher SuiteOperation steps: Press 'Win + R', go to "run", typ
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.