20145309 Experiment 5

Source: Internet
Author: User
20145203 Experiment five Java Network programming and security experiment content

1. Master the socket program writing;

2. Mastering the use of cryptographic technology;

3. Design a secure transmission system.

Experimental requirements

1. Secure transmission based on Java socket

2, based on TCP implementation of client and server, pair programming one person responsible for the client, one person responsible for the server

3. Use Git for version control

4, select the symmetric algorithm for data encryption and decryption.

5. Select the asymmetric algorithm to distribute the key for the symmetric encryption key.

6, select the appropriate hash algorithm for integrity verification.

7. Select the appropriate algorithm to sign/verify the hash value.

Experimental steps

1, run the TCP code, I am responsible for the service side.

* * Pair partner 20145216 Shi Yao is responsible for client blog address: http://www.cnblogs.com/sjy519/p/5471476.html**

2. Set the IP address

• Open cmd, enter the ipconfig command,

3. Establish socket Object Getinetaddress (): Obtain the IP address of the remote server.

Getport (): Gets the port of the remote server.

Getlocaladdress (): Gets the client's local IP address.

Getlocalport (): Gets the client's local port.

getInputStream (): Gets the input stream. This method throws IOException if the socket has not yet been connected, or has been closed, or the input stream has been closed through the Shutdowninput () method.

Getoutputstream (): Gets the output stream, which throws IOException if the socket has not yet been connected, or has been closed, or the output stream has been closed through the Shutdownoutput () method.

4, Information security transmission:

① Sender A —————— > receiver B

②a encryption, use B's public key

③b decryption, use B's private key

20145309 Experiment 5

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.