Optimized encrypt_block function by removing bytes object concatination and replacing with bit-wise operations