a ruby method that allows encode to affine cypher and decode