Asymmetric encryption, SHA-1 encryption, Ras algorithm, Digital Signature

Source: Internet
Author: User
Tags asymmetric encryption

Digital signatures are common:

Before learning about digital signatures, you must first understand the SHA-1 digest and RSA encryption algorithm. Then, learn more about digital signatures.

SHA-1 SHA-1 (secure hash algorithm) is Data encryption algorithm.The idea of this algorithm is to receive a piece of plain text, and then convert it into a section (usually smaller) ciphertext in an irreversible way, it can also be understood as a string of input codes (called pre- ing or information ), and convert them into a short, fixed-digit output sequence, namely, a hash value (also known as an information digest or information Authentication Code. The security of one-way hash functions is that they produce hash values. Unidirectional. If a password is embedded in the input sequence, no one can generate a correct hash value without knowing the password, thus ensuring its security. Sha blocks the input stream according to each 512-bit (64 bytes), and generates 20 bytes of output called Information Authentication code or information digest.
The input packet length of this algorithm is unlimited, and the output is 160 bits. The input is processed by 512-bit grouping. SHA-1 is irreversible, conflict-proof, and has a good avalanche effect.
The hash algorithm can be used to implement digital signatures. The principle of digital signatures is that the plaintext to be transmitted is implemented through a function operation (hash) to convert a message to a Digest (different plain texts correspond to different message digests ), The message digest is encrypted and transmitted together with the plaintext to the receiver., The receiver generates a new message digest in the received plaintext and decrypts the digest sent by the sender. The comparison result is consistent, indicating that the plaintext has not been modified. If the difference is different, the plaintext has been tampered. In short: SHA-1 is a one-way Data Encryption Algorithm with fixed digits of 160.On different platforms, the platform itself is embedded with the implementation of SHA-1 and can directly call the corresponding function. RSA encryption algorithm RSA public key encryption algorithm was developed by Ron Rivest, Adi shamirh and lenadleman (MIT) in 1977. The names of RSA come from the names of the three developers. RSA is currently the most influential public key encryption algorithm. It can resist all known password attacks so far and has been recommended as the Public Key Data Encryption Standard by ISO. The RSA algorithm is based on a very simple number theory fact: It is very easy to multiply two large prime numbers, but it is extremely difficult to break down the product by line.Therefore, the product can be published as an encryption key.

RSA is an asymmetric cryptographic algorithm. asymmetric encryption means that the algorithm requires a pair of keys. If one of them is used for encryption, the other is used for decryption.
The RSA algorithm involves three parameters: N, E1, and E2.
Where, n is the product of two mass numbers p and q, and the number of digits occupied by the binary representation of N is the so-called key length.
E1 and E2 are a pair of related values, E1 can be any take, but requires E1 and (p-1) * (q-1) mutual quality; then select E2, requirements (e2 * E1) moD (p-1) * (q-1) = 1. (N, E1), (n, E2) is the key pair. Where (n, E1) is the public key and (n, E2) is the private key.
The encryption and decryption algorithms of RSA are identical. If a is set to plain text, and B is set to ciphertext, A = B ^ E2 mod n; B = a ^ E1 mod N; (In the public key encryption system, public key encryption is generally used, and Private Key decryption) E1 and E2 can be used interchangeably, that is:
A = B ^ E2 mod n; B = a ^ E1 mod N;

If the client is developed, we only care about the encryption algorithm:We need n (modulus) and E (exponent), Put the two in the platform's RSA password function to generate the password. Then, call the RSA encryption function to generate a string of numbers and send them to the server. Asymmetric encryption in 1976, American scholars dime and Henman proposed a new key exchange protocol to solve the problems of public information transmission and key management, allow both parties to exchange information on insecure media and securely reach an agreed key. This is the "public key system ". Compared with symmetric encryption algorithms, this method is also called asymmetric encryption algorithms ".
Unlike symmetric encryption algorithms, asymmetric encryption algorithms require two keys:Publickey and privatekey). A public key is a pair of private keys. If a public key is used to encrypt data, only the corresponding private key can be used for decryption. If a private key is used to encrypt data, only the corresponding public key can be decrypted. Because encryption and decryption use two different keys, this algorithm is called asymmetric encryption algorithm.

The basic process for asymmetric encryption algorithms to exchange confidential information is: Party A generates a pair of keys and discloses one of them as a public key to other Parties; if Party B obtains the public key, it encrypts the confidential information and sends it to Party A. Party A decrypts the encrypted information with another private key. Party A can only use its private key to decrypt any Information encrypted by its public key.
Asymmetric encryption algorithms have good confidentiality and eliminate the need for end users to exchange keys. However, encryption and decryption take a long time and are slow, it is not suitable for encrypting files, but only for encrypting a small amount of data.
The security of classic asymmetric encryption algorithms, such as RSA Algorithms, is quite high.A typical application of asymmetric encryption is digital signature.
Two keys are used in one process, one for encryption and the other for decryption. This encryption method is called asymmetric encryption or public key encryption, because one of the keys is public (the other must be kept confidential ). Digital signature integrates the above two technologies to achieve a very secure information transfer mechanism. After the above introduction, the digital signature is easy to understand. 1."Summary""Private Key""Public Key"Several key technologies, of course, this model itself is"Asymmetric encryption"* The above content is from Baidu Baike

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.