Secret key is included in cipher text. so how can we say that if hacker grab the cipher text he will not be able crack the code? if he cannot do with cipher-text then how receiver can crack the message from same cipher-text? what is difference?


Most of the time - the key is not included in the cipher-text. The key needs to be "pre-shared" between the sender and recipient. This is true for symmetric encryption.

Or - the key can be encrypted using the asymmetric encryption. That the sender could encrypt with the recipient's public key (not secret) and only the recipient could decrypt with its private (secret) key.

This is base of the asymmetric encryption. It is very expensive (in performance), so a one-time symetric key is generated and encrypted using the asymmetric encryption. The key is used for symmetric encryption of the payload (of any size). The recipient receives the encrypted symmetric key (what could be retrieved using the private asymmetric key) and then the rest of the payload can be decrypted.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.