Quantum Key Distribution (QKD) systems are thought to be the best method for securing data in cloud storage and boosting security and privacy. Due to the increasing use of cloud services, ensuring the confidentiality of stored data in cloud storage, data exchange, and key sharing used to encrypt data has become a major concern in recent years. The error key may occur during key generation. Through this error key, Eve can easily know the knowledge of the shared key. Enhanced error correction algorithms are utilized to discover and eliminate mistake bits while transmission, ensuring that both keys are equal and producing their shared error-free secret key. Hence, this study improves a BB84 protocol by improving its bit size at the compatibility level using the Sailfish Optimization Algorithm (SOA), and together with the transmitter, as well as the receiver, create a raw key in the next state. QKD is developed from improved BB84 protocol and encrypts data using a hybrid AES-RC4 encryption algorithm. The improved BB84 protocol generates the quantum key distribution, which encrypts data using a hybrid encryption algorithm. Here, error correction is done through the multi-objective function which is optimized using the Sailfish optimization technique, resulting in outcomes through adding either estimate mistake or a best key combination. After encryption, if the data is uploaded to the cloud, only the authorized user can decode the data. Moreover, in a Python environment, the proposed method is implemented, and the proposed model's accuracy rate is 97 per cent, with a 3 per cent error rate and 59 s for key generation time. As a result, the proposed SOA-based QKD swift key generation system outperforms existing methods.