CSCI361: you are to design and implement (t, n) Shamir’s secret sharing scheme as described in the lecture in C++, Java or Python: Cryptography and Secure Applications Assignment, UOW

Task 1. Cryptanalysis

Let 𝐸𝑛𝑐 be an encryption algorithm based on a one-way function 𝐹 , and π‘Ÿ a shared secret key between the sender and the receiver. 𝐸𝑛𝑐 works as follows:

1. Compute 𝐾 = 𝐹(π‘Ÿ)||𝐹(2π‘Ÿ)||𝐹(3π‘Ÿ)||𝐹(4π‘Ÿ)||.. ;

2. For a message 𝑀, the ciphertext is computed as 𝑀⨁𝐾 (i.e., one-time pad).

Assume that an eavesdropper knows the function 𝐹 but does not know the secret key π‘Ÿ.

a) Suppose 𝐹 is defined as 𝐹(π‘₯) = 𝑔 π‘₯ π‘šπ‘œπ‘‘ 𝑝 where p is a 1024-bit prime number and 𝑔 is a generator of π‘π‘βˆ— . Assume that the discrete logarithm problem cannot be solved in the group 𝑍𝑝 βˆ— . The secret key π‘Ÿ is chosen randomly from π‘π‘βˆ’1 . Show that the eavesdropper can decrypt the whole message easily once after obtaining 𝑔, 𝑝, and the first 1024 bits of the plaintext-ciphertext pair.

b) Suppose 𝐹 is an RSA function, that is 𝐹(π‘₯) = π‘₯ 𝑒 π‘šπ‘œπ‘‘ 𝑛 where n is 1024-bit long. Assume the RSA problem cannot be solved in the group 𝑍𝑛 βˆ—, and r is chosen randomly from 𝑍𝑛 βˆ— . Show that the eavesdropper can decrypt the
message easily once after obtaining n, e, and the first 1024 bits of the plaintext-ciphertext pair.

Task 2. Shamir Secret Sharing

In this section, you are to design and implement (t, n) Shamir’s secret sharing scheme as described in the lecture in C++, Java or Python. Your program should be called SSS.cpp, SSS.java, or SSS.py and it comprises at least the following functionalities:

β€’ Share Generation: to generate shares in the (t, n) Shamir’s secret sharing scheme. As a hint, you should at least accept the secret, t, n and the modulus in the parameter.

β€’ Share Reconstruction: to reconstruct the secret from the given shares in the (t, n) Shamir’s secret sharing scheme.

In this part, you need to explain your design first in file Task2.pdf to explain the logic of your functions. As usual, you need to take the screen capture of the sample run of your program and put it in Task2.pdf as well.

Task 3. ElGamal Signature with SHA-1

In this section, you are to implement an ElGamal signature scheme, where the message will need to be first hashed with the SHA-1 algorithm. The algorithm for SHA-1 is available online, for example at:

In your report for this section, you will need to quote any algorithm where you download online and cite it accordingly, instead of stating that it is written by you. The program is divided into three parts:

β€’ Keygen: this part is to generate the private and public key for ElGamal algorithm and store it in a file called π‘˜π‘’π‘¦π‘“π‘–π‘™π‘’.𝑑π‘₯𝑑.

β€’ Sign: this part is to sign a text file given as an input. In this mode, the program will ask for the name of the text file, then read the private key from π‘˜π‘’π‘¦π‘“π‘–π‘™π‘’.𝑑π‘₯𝑑 for signing. Prior to signing the file, the program will compute the hash of the file using SHA-1, then sign it to produce 𝑠𝑖𝑔.𝑑π‘₯𝑑.

β€’ Verify: this part is used to verify the signature in 𝑠𝑖𝑔.𝑑π‘₯𝑑 for the file, using the public key from π‘˜π‘’π‘¦π‘“π‘–π‘™π‘’.𝑑π‘₯𝑑.

You need to structure your program using the possible inputs given as the parameter of the program. This part needs to be written in Java, C++, or Python. This part will need to be submitted with the filename ElGamalsign (with .cpp, or java, or py respectively), together with Task3.pdf containing your report detailing how to use the program.

Task 4. Design of One-Time Signature Schemes

A fail-stop signature scheme provides some extra protection to the system. An the unbounded adversary is an adversary who can solve a computationally hard problem, such as discrete logarithm problem and factorization problem.
Please refer to the following scheme:

Key Generation

Public Key:
𝑦1 = 𝑔 π‘Ž1𝑦 π‘Ž2 (π‘šπ‘œπ‘‘ 𝑝)
𝑦2 = 𝑔 𝑏1𝑦 𝑏2 (π‘šπ‘œπ‘‘ 𝑝)

𝑔 denotes a generator of 𝑍𝑝

βˆ— and 𝑦 is a random element from 𝑍𝑝
βˆ—. The private key is (π‘Ž1,π‘Ž2, 𝑏1,𝑏2).

Signing

𝜎1 = π‘Ž1π‘š + 𝑏1Β  (π‘šπ‘œπ‘‘ π‘ž)
𝜎2 = π‘Ž2π‘š + 𝑏2 (π‘šπ‘œπ‘‘ π‘ž)
where π‘ž|𝑝 βˆ’ 1. The signature on π‘š is (𝜎1,𝜎2).

The notation π‘ž|𝑝 βˆ’ 1 means that π‘ž is a multiple of 𝑝 βˆ’ 1.

Verification

To verify (π‘š,𝜎1, 𝜎2 ), one does the following.
𝑦1 π‘šπ‘¦2 𝑔 𝜎1 =? 𝑦 𝜎2 (π‘šπ‘œπ‘‘ 𝑝).

If the equation holds, then the signature is accepted. Otherwise, the signature is rejected.

Write a C++, Java or Python program to accomplish the task. You need to take the screen capture of the sample run of your program and put it in a file named
Task4.pdf. You need to submit both your source code and the report (Task4.pdf).

5 Task 5. Implementing Ring Signature of 2 users

In this task, you are to implement a ring signature for 2 users, as described in the lecture notes. The input files are the following:
β€’ publickey.txt
β€’ message.txt
The file publickey.txt has four lines, which indicates: 𝑒1 ,𝑛1 ,𝑒2 ,𝑛2 from RSA algorithm. The message.txt contains a string of characters, which needs to be signed. You need to implement two programs: sign and verify. The sign program will sign the message (from message.txt) and read the public keys from publickey.txt. It will ask for one input, which is user 1 or user 2, who is the signer, and the program will ask for that user’s private key. Then, the sign program will output signature.txt.

The verify program will take an input of publickey.txt, message.txt and signature.txt and it will output True or False to show the verification of the ring signature.

The symmetric encryption should use the AES algorithm. You can import the AES algorithm from the existing library or use any implementation of AES algorithm (with 10 rounds) to do this.

You may implement you program using C++, Java, or Python. You need to take the screen capture of the sample run of your program and put it in a file named
Task5.pdf. You need to submit both your source code and the report (Task5.pdf).

6 Task 6. Various Questions

Answer the following questions. You do not need to implement any program for these tasks. These tasks are pen-and-paper exercises. Please show all your workings for Task 6.1 to 6.4. Answers without showing the workings, receive no mark.

1. Assume that the size of message space (domain) for a given hash function is 2 50. Also, assume that we want the chance of the adversary finding a collision to be at most 2 βˆ’30. What is the size of the hash (in bits) required?

2. Sign and verify the message π‘š = 11 using the RSA signature when 𝑝 = 59, π‘ž = 47, and 𝑒 = 15.

3. Demonstrate that the RSA signature with the parameters given in Q2 is forgeable under chosen message attack with two messages π‘š1 = 2 and π‘š2 = 3.

4. Adam and Bob share the same modulus 𝑛 = 21 for RSA, and encryption exponents π‘’π‘Ž = 5 and 𝑒𝑏 = 4 with 𝑔𝑐𝑑(π‘’π‘Ž,𝑒𝑏 ) = 1 . Charlie sends them the same message π‘š encrypted with π‘’π‘Ž and 𝑒𝑏 respectively, resulting in the ciphertexts π‘π‘Ž = 14 and 𝑐𝑏 = 7. Eve intercepts both π‘π‘Ž and 𝑐𝑏 , and applies a common modulus attack to recover the message π‘š. What is the message π‘š?

Write your answer in a file called Task6.pdf. You need to show all the key steps in order to obtain full marks. Submit Task6.pdf together with the other tasks in this assignment to Moodle.

Stuck with a lot of homework assignments and feeling stressed ?
Take professional academic assistance & Get 100% Plagiarism free papers
Get A Free Quote

The post CSCI361: you are to design and implement (t, n) Shamir’s secret sharing scheme as described in the lecture in C++, Java or Python: Cryptography and Secure Applications Assignment, UOW appeared first on Singapore Assignment Help.