Usual approach is to take a hash of the message. Encrypt the hash with your private key. People can verify the sig by decrypting the hash with your public key and seeing that it's the same as the hash of the message.

If you want good security use a well tested mainstream library that implements this all for you. There are a lot of ways to get crypto wrong ;)