im trying to convert a hash to a big integer so i can do some calculations with it. Im successful in that but on the other side i need to be able to convert the big integer back to the hash to do verification. But i cant do the conversion back succesfully, below is my code and the output. Please do advise and assist..
This is the code
//convert hash to bytes then to big int to mod pow
BigInteger hashy = new
BigInteger(hash.getBytes(StandardCharsets.ISO_8859_1));
System.out.println("hashy: " +hashy);
//test if convert back to big int works
String convertedBackHash = (hashy.toByteArray()).toString();
System.out.println("hash to hashy to hash: " + convertedBackHash);
This is the output
hash: d1bb961ac85f6d9ae66b469b5cabe83f9f88e4ee
hashy: 835979497806227327262557895525398820611883198135120938003873334575862278693562754177889725605221
hash to hashy to hash: [B@60e53b93
Anyone knows what went wrong?