Here is an example of SHA-256 hash coding one can find anywhere on the web:
Is there a way to set it up so it can output for multiple "passwords"? Example, instead of only outputing fcdb4b423f4e5283afa249d762ef6aef150e91fccd810d43e5 e719d14512dec7 with the above coding, I want to have an output of every possible 16 digit hex value. I understand the output will be huge if I run the entire 0000000000000000 through ffffffffffffffff sequence (16^16 = 18 quintillion+ results). But I want my output to look like this:import java.security.MessageDigest; public class SHAHashingExample { public static void main(String[] args)throws Exception { String password = "0000000000000000"; MessageDigest md = MessageDigest.getInstance("SHA-256"); md.update(password.getBytes()); byte byteData[] = md.digest(); //convert the byte to hex format method 1 StringBuffer sb = new StringBuffer(); for (int i = 0; i < byteData.length; i++) { sb.append(Integer.toString((byteData[i] & 0xff) + 0x100, 16).substring(1)); } System.out.println("Hex format : " + sb.toString()); //convert the byte to hex format method 2 StringBuffer hexString = new StringBuffer(); for (int i=0;i<byteData.length;i++) { String hex=Integer.toHexString(0xff & byteData[i]); if(hex.length()==1) hexString.append('0'); hexString.append(hex); } System.out.println("Hex format : " + hexString.toString()); } }
0000000000000000 fcdb4b423f4e5283afa249d762ef6aef150e91fccd810d43e5 e719d14512dec7
0000000000000001 665e994827f6b03167e80c1513eb356e0d4f013f2e03a3b345 e1e5e3c24dfca6
and so on until...
ffffffffffffffff 6534b338bcb91cf173444c24ed8bc0f1b7065face0ea95cdd1 b936556c6860ed
As new as I am to coding, I understand that this is a LARGE amount of data and I'll also need a way to export the output I create into a text editor (likely notepad). Any assistance would be greatly appreciated.