You should read up on Asymmetrical Encryption, and Digital Signature Algorithms.
You don't need an encryption & decryption (I assume you mean symmetrical) algorithm for an activation code. If you think about it, the same key is used to encrypt as to decrypt, meaning that the key itself needs to be provided to the application in order for it to work, which is an automatic fail on the security front.
You can secure an activation key by using the RSA or DSA algorithms. These are asymmetric encryptions, meaning you have a private key that can decrypt, and a public key that can only encrypt. They both have signature functions that generate a hash from your "activation code" then encrypt that hash to produce a signature. The message and the signature only match if they are unchanged - if you only have the public key, you can verify that the message (in your case the activation code) and the signature match, but you need the private (secret) key to generate the signature.
I wrote an article on this a long time ago - the code is clunky and has some bugs, but the article is well written and explains these concepts fairly well:
RSA License Protection[
^]