Generating application access and secret keys

Does anyone know how AWS access and secret keys are generated? Are they pure random strings? Is there a math relationship between the access and secret key? If I were to build an application, how do I go about generating my own access and secret key ?