added ways to find the min hamming distance to check for keysize