All good cryptographic algorithms are public domain. "Commercial" cryptographic algorithms are almost always snake oil.
Now, there is a difference between the algorithm and an implementation of an algorithm.
- If the abstract design itself is not in the public domain (let alone standardized), then it's probably not something that you want to use.
- A specific implementation of a public domain algorithm is a piece of software and may be licensed in an arbitrary manner.
The standardized algorithms that are in the public domain were designed by competent cryptographers with a proven track record, and the algorithms have been analyzed by the cryptographic community in general. Neither of these points are guaranteed if you are purchasing the rights to use some proprietary algorithm.
Library recommendation
Depending on what you want to do, you probably want to use libsodium. It uses the ISC license, which:
... is functionally equivalent to the simplified BSD and MIT licenses, differing in its removal of language deemed unnecessary following the global adoption of the Berne Convention.
Note that this library offers somewhat generic tools. It does not directly offer functions like generate_license_key and verify_license_key. I'm not aware of a well-known crypto library that does offer such functions out of the box.