Cryptographic keys are long strings of random bits generated using specialized algorithms and help secure data by making it unpredictable to any adversary. Cryptographic keys are used in various cryptographic algorithms in many domains, i.e., Cloud computing, Internet-of-Things (IoT), Fog computing, and others. The key generation algorithms are essential in cryptographic data encryption and decryption algorithms. This work proposed a cryptographic key generation algorithm based on Shannon entropy and the Salp Swarm algorithm (SSA) for generating randomized keys. The proposed Cryptographic Key Generation algorithm utilizes the dynamic movement of salps to create high-quality, robust, and randomized keys against attacks. The transfer function and quantization method convert a salp into a cryptographic key. The proposed Cryptographic Key Generation algorithm has been evaluated on four transfer functions against three state-of-the-art swarm intelligence metaheuristics, i.e., particle swarm optimization, BAT, and grey wolf optimization algorithms. The keys of eight different bit lengths, i.e., 512, 256, 192, 128, 96, 80, 64, were generated and evaluated due to their applications in the different encryption algorithms, i.e., AES, DES, PRESENT, SIMON, SPECK, and 3DES. The simulation study confirms that the proposed key generation algorithm effectively produces secure cryptographic keys.