The theory and technology of cryptography including the block cipher, stream cipher and public-key cryptosystem. The usual cryptographic algorithms, such as DES, RSA, AES and message digest algorithms are discussed. Basing on these studies, a design of secure communication is presented. It combines the data encryption with the authentication, can be applied to principal and subordinate system. It can provide a reliable protection for the secure communications for embedded devices. Finally, the core source code is shown.