public static boolean slowStringComparison(String givenSignature,String computedSignature){
  if (null == givenSignature || null == computedSignature || givenSignature.length() != computedSignature.length())   return false;
  int n=computedSignature.length();
  boolean signaturesMatch=true;
  for (int i=0; i < n; i++) {
    signaturesMatch&=(computedSignature.charAt(i) == givenSignature.charAt(i));
  }
  return signaturesMatch;
}

public static boolean slowStringComparison ( String givenSignature , String computedSignature ) { if ( null == givenSignature || null == computedSignature || givenSignature . length ( ) != computedSignature . length ( ) ) return false ; int n = computedSignature . length ( ) ; boolean signaturesMatch = true ; for ( int i = 0 ; i < n ; i ++ ) { signaturesMatch &= ( computedSignature . charAt ( i ) == givenSignature . charAt ( i ) ) ; } return signaturesMatch ; }
this method is low performance string comparison function . the purpose of this method is to prevent timing attack .
