A chaotic block cipher algorithm for image cryptosystems