The reason that cryptography has been studied for the past 4000 years is that people keep cracking the code. All modern algorithms use a key to control the encryption and decryption. The key for encryption and descryption need not be the same. Symmetric algorithms uses the same key for both encryption and decryption. Therefore, the key must be secret.
Asymmetric algorithms uses different keys for encryption and decryption.
The encryption key is public. If someone wanted to send you an encrypted message, they can use your public encryption key to encrypt the message and you will use your private decryption key to descrypt it. DES is a symmetric algorithm while RSA and the Digital Signature Standard are asymmetric. RSA is a public-key cryptosystem developed by MIT professors Ronald L. Rivest, Adi Shamir, and Leonard M. Adleman in 1977. To understand how RSA works, Cary Sullivan and Rummy Makmur have simplified the RSA algorithm in Javascript .