Hugs and kisses bring with them rights and responsibilities

The X was apparently a Christian cross people put at the end of a letter to signify sincerity. Then they would kiss the X as a display of their sworn oath. It was a sort of a two-layer security, a bit like now with username and password.
The origins of the hug O are more doubtful although some say it might have come from Jewish traders who would not have liked to put in an X because of “you know, how things are a bit complicated right now”.