Java Signature and verification

Source: Internet
Author: User

Basic concepts:

Encrypted decryption

  encryption : The sender encrypts the plaintext to be sent by using the public key of the receiving party.

  decryption : The receiver uses its own private key for decryption.

A public key and a private key are paired, and a file encrypted with the public key can only be decrypted by the corresponding private key. Of course, it can also be encrypted with the private key and decrypted with the corresponding public key.

Signature Verification

signature : The sender uses a hash function to generate a message digest from the message text and then encrypts the digest with its own private key, resulting in the corresponding digital signature of the message.

Generally speaking, the sender will send the digital signature and the original message to the recipient.

  verification : After the receiving party obtains the original message and the digital signature, uses the same hash function to generate digest a from the message, in addition, decrypts the digital signature with the public key provided by the sender, obtains the digest B, compares A and B is the same, can

Know if the message has been tampered with.

function :

In fact, there are two functions of digital signature: one is to determine that the message is actually sent by the sender's signature, because others can not impersonate the sender's signature. Second, the digital signature can determine the integrity of the message.

The sender uses its own private key to complete the digital signature, and then encrypts the message with the receiver's public key, sending the digital signature and the datagram to the receiving party.

After getting the cipher and digital signature, the receiver decrypts the ciphertext with its own private key, obtains the plaintext, and then uses the public key provided by the sender to verify the identity of the sender, and the message has not been tampered with.

Java Signature and verification

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.