securityencryptionsecret-keyaccess-keys

How to generate Access Key (AK) and Secret Key (SK)?


AWS use ak/sk for authentication.
I am building a server-client application using ak/sk mechanism for authentication, AES for encryption, and HMAC for signature.
What's the best practice to generate such an ak/sk pair in my own program, and satisfy ak's unique constraint at the same time? Should I generate UUID as ak, and random string for sk? Are there any relations between ak and sk?


Solution

  • You can just generate UUID for ak, and random bytes for sk.

    See Best approach for generating API key