Thanks for help. I actually don't want to encrypt string. "Xor" of a string is counted this way: 's' xor 't' xor 'r' xor 'i' xor 'n' xor 'g'. The result will be used as a CheckSum at the end of a record passed to the fiscal printer. If the CheckSum is not correct no slip will be printed. But thanks for your code. It's very useful.