Change the function encrypt_char

Encapsulation. Convert char in int inside function.