|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class Check implements Operazioni {
System. out. println("Inserire la stringa da controllare:");
String StrToCheck = myInput. readLine();
System. out. println("Inserire l'hash da controllare:");
String HashToCheck = myInput. readLine();
boolean CheckStrings = StrEquals(StrToCheck,HashToCheck);
if(CheckStrings)
System. out. println("Le stirnghe corrispondono!");
else
System. out. println("Le stringhe non corrispondono!");
}
mdEnc.update(StrToCheck.getBytes(), 0, StrToCheck.length());
if(md5.equals(HashToCheck))
return true;
else return false;
}
}
|
|