Final answer:
Kerckhoffs's principle advocates for system security based on key secrecy, not obscurity of the algorithm. Known-plaintext and chosen plaintext attacks differ by the attacker's level of control over the plaintext. The checksum in UDP and TCP headers is calculated for error-checking in data transmission.
Step-by-step explanation:
Kerckhoffs's principle asserts that a cryptographic system should be secure even if everything about the system, except the key, is public knowledge. This highlights the importance of the secrecy of the key over the algorithm itself.
A known-plaintext attack is where the attacker has access to both the plaintext (unencrypted text) and its corresponding ciphertext (encrypted text), but has no control over the plaintext. Conversely, in a chosen plaintext attack, the attacker can choose arbitrary plaintexts to be encrypted and obtain the corresponding ciphertexts, providing more power over the cryptographic analysis.
Calculation of Checksum in UDP and TCP Headers
The checksum in UDP and TCP headers is a means of error-checking in data transmission. It is calculated by summing segments of the data in a predefined manner, often using one's complement arithmetic, to detect changes in the transmitted data.