Question: Could you please help me to solve this problem on the link below? Link: https://1drv.ms/w/s!AoIxLH9P9wW9miSnM1A_-FQVA7bd Alternative link: https://www.dropbox.com/s/zbp024pklteiv5v/Question.doc?dl=0 Also you can read my question below:
Could you please help me to solve this problem on the link below?
Link: https://1drv.ms/w/s!AoIxLH9P9wW9miSnM1A_-FQVA7bd
Alternative link: https://www.dropbox.com/s/zbp024pklteiv5v/Question.doc?dl=0
Also you can read my question below: ( I WANT ONLY THE JAVA CODES)
SE 470 PROJECT SPRINT 1
Definition: A program will be written to measure agility.
Agility: Agility is how much you apply agile concepts to software development. If you apply agile principles, you should discover the problems earlier and you should solve those problems immediately. As a result, the customer satisfaction would be accomplished.
The project will be developed in teams. Each team will use a different base string and produce special strings. The special strings will have a SHA-256 hash value starting with a secret code string. The aim is to produce maximum number of correct special strings. The secret code will be announced in the class.STUDENT EDIT WHO ASKED THIS ON CHEGG.COM: HERE YOU CAN ASSIGN A RANDOM SECRET CODE ARBITRARILY
For each team, there are 2 types of correct special strings. The first type string is correct, if it is a SHA-256 hash value starting with the secret code. The second type string is correct, if its first type part is correct and as a whole it has a SHA-256 hash value starting with the secret code. The following sentences summarize the special strings.
For the Team N:
Base string: TEAMSTORY
Special string type 1: TEAMSTORY+
Special string type 2: < Special string type 1>DONE+
: a digit = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] = [0-9] + : one or more digits
Example for Team 5:
Base string: TEAM05STORY
Special string type 1: TEAM05STORY+
Special string type 2: < Special string type 1>DONE+
Here is an example program to get SHA-256 hash value for Team 5:
import java.security.MessageDigest; import java.util.Arrays;
import java.util.Date;
public class Agility {
public static void main(String[] args) { String base = "TEAM05"; int count = 0;
while (true) { count++;
String trial = base + "STORY" + count; String trialHash = getSHA256Hash(trial); if (trialHash.startsWith("SECRET CODE"))
PrintLineToFile(trial, "Agility.txt");
}
}
public static String getSHA256Hash(String data) { try {
MessageDigest digest = MessageDigest.getInstance("SHA-256"); byte[] hash = digest.digest(data.getBytes("UTF-8"));
return bytesToHex(hash); } catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
public static String bytesToHex(byte[] bytes) { StringBuffer stringBuffer = new StringBuffer(); for (int i = 0; i < bytes.length; i++) {
stringBuffer.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1));
}
return stringBuffer.toString();
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
