≡ Menu

Introduction to Cryptography Basic Principles

Whenever we come across the term cryptography, the first thing and probably the only thing that comes to our mind is private communication through encryption. There is more to cryptography than just encryption. In this article, we will try to learn the basics of cryptography.

The Basic Principles

1. Encryption

In a simplest form, encryption is to convert the data in some unreadable form. This helps in protecting the privacy while sending the data from sender to receiver. On the receiver side, the data can be decrypted and can be brought back to its original form. The reverse of encryption is called as decryption. The concept of encryption and decryption requires some extra information for encrypting and decrypting the data. This information is known as key. There may be cases when same key can be used for both encryption and decryption while in certain cases, encryption and decryption may require different keys.

2. Authentication

This is another important principle of cryptography. In a layman’s term, authentication ensures that the message was originated from the originator claimed in the message. Now, one may think how to make it possible? Suppose, Alice sends a message to Bob and now Bob wants proof that the message has been indeed sent by Alice. This can be made possible if Alice performs some action on message that Bob knows only Alice can do. Well, this forms the basic fundamental of Authentication.

3. Integrity

Now, one problem that a communication system can face is the loss of integrity of messages being sent from sender to receiver. This means that Cryptography should ensure that the messages that are received by the receiver are not altered anywhere on the communication path. This can be achieved by using the concept of cryptographic hash.

4. Non Repudiation

What happens if Alice sends a message to Bob but denies that she has actually sent the message? Cases like these may happen and cryptography should prevent the originator or sender to act this way. One popular way to achieve this is through the use of digital signatures.

Types of Cryptography

There are three types of cryptography techniques :

  • Secret key Cryptography
  • Public key cryptography
  • Hash Functions

1. Secret Key Cryptography

This type of cryptography technique uses just a single key. The sender applies a key to encrypt a message while the receiver applies the same key to decrypt the message. Since only single key is used so we say that this is a symmetric encryption.

The biggest problem with this technique is the distribution of key as this algorithm makes use of single key for encryption or decryption.

2. Public Key Cryptography

This type of cryptography technique involves two key crypto system in which a secure communication can take place between receiver and sender over insecure communication channel. Since a pair of keys is applied here so this technique is also known as asymmetric encryption.

In this method, each party has a private key and a public key. The private is secret and is not revealed while the public key is shared with all those whom you want to communicate with. If Alice wants to send a message to bob, then Alice will encrypt it with Bob’s public key and Bob can decrypt the message with its private key.

This is what we use when we setup public key authentication in openssh to login from one server to another server in the backend without having to enter the password.

3. Hash Functions

This technique does not involve any key. Rather it uses a fixed length hash value that is computed on the basis of the plain text message. Hash functions are used to check the integrity of the message to ensure that the message has not be altered,compromised or affected by virus.

So we see that how different types of cryptography techniques (described above) are used to implement the basic principles that we discussed earlier. In the future article of this series, we’ll cover more advanced topics on Cryptography.

Add your comment

If you enjoyed this article, you might also like..

  1. 50 Linux Sysadmin Tutorials
  2. 50 Most Frequently Used Linux Commands (With Examples)
  3. Top 25 Best Linux Performance Monitoring and Debugging Tools
  4. Mommy, I found it! – 15 Practical Linux Find Command Examples
  5. Linux 101 Hacks 2nd Edition eBook Linux 101 Hacks Book

Bash 101 Hacks Book Sed and Awk 101 Hacks Book Nagios Core 3 Book Vim 101 Hacks Book

Comments on this entry are closed.

  • Mark Boyajian July 18, 2012, 8:47 am

    Perfectly timed article! I just encountered a situation with my daughter who needed to send some private data to an employer and I suddenly realized that “this is a big deal”! It seems to me that this issue should be requisite knowledge for everyone nowadays, and the situation with my daughter was a wake-up call to me that I need to learn this stuff – and fast! So, you have started my journey and I look forward to the next installments. As always, you do a top-notch job and always target relevant material. Many, many thanks!

  • bob July 18, 2012, 8:48 am

    as usual, excellent job.

  • Jalal Hajigholamali July 18, 2012, 8:58 am


    Very nice article ..

  • yogesh July 18, 2012, 9:17 am

    this article is very interesting. but sir i have confusion b/w steganography & cryptography. could u explain it.

  • pathum July 18, 2012, 9:31 am

    nice start… go ahead

  • linuxismylife July 18, 2012, 9:42 am

    Superb article.

  • Pierre B. July 18, 2012, 12:30 pm

    As a quick answer to yogesh :

    Steganography is nothing but “hiding” data within others data, when cryptography is about making data not readable but still visible.

    Cryptography example : In a encrypted VPN you can see data but not understand it…
    Steganography example : In a “cat picture” (stored on your computer) you hide your “bank account log and passwd” (do not do this!)…

    For more comprehensive entry to cryptography, check this.

  • Simon Bradley July 18, 2012, 1:30 pm

    Nice – except for one thing.

    If you encrypt with a PRIVATE key, then ANYONE with the PUBLIC key can decrypt it. Not a secure method.

    You need to encrypt with the recipients PUBLIC key which everyone has, but only the receiver with his PRIVATE key can decrypt.

    Your diagram suggests the insecure method.


  • Ethan July 18, 2012, 7:50 pm

    This article is helpfull to anyone use SSH.

  • Ramesh Natarajan July 18, 2012, 11:58 pm


    Thanks for pointing out the mix-up in the diagram. It is fixed now.

  • SINIRANJI July 22, 2012, 7:17 am

    Need of the hour, every one should know about this, linux sysadmins need this when they use python pearl scripts to automate things and where ever they put password it will be in hash ssh format. please include this too

  • Abhishek Joshi July 22, 2012, 8:47 am

    Can you please tell me in public key cryptography,how can we enforce that the message encrypted with bob’s public key open can only open with bob’s private key?

  • Hai Phan July 25, 2012, 7:12 am

    Abhishek Joshi
    Bob has to send his public key to Alice (for example). Alice will use Bob’s public key to encrypt her messages. When Bob gets Alice’s messages, he will use his private key to decrypt her messages. Remember that Bob only sends out his public key.

  • RaghuG August 6, 2012, 6:16 am

    This is a nice article. Thanks for the eye-opener.

  • A Thakare August 23, 2012, 5:44 am

    It is very nice article. i choose this article for my seminar. It is easy to understand
    and also for use.

  • Ankit September 21, 2012, 4:08 am

    Good article. waiting for sequels. 🙂

  • rajesh kumar V January 31, 2013, 5:48 am

    Nice one.

  • Ahmed Soomar October 3, 2013, 5:52 am

    A nice and useful article with basic of cryptography thanks a lot

  • NUPOOR June 21, 2014, 6:42 am

    thank you for this article it actually gave a basic idea of what is cryptography and what is it made of!!!!

  • Neshkelvin July 4, 2014, 1:07 am

    Hi sir. I wanted to to ask you..what is principle of cryptography flipping coin..did you can explain? I couldn’t understand the topic..tq

  • ajay eshwar January 21, 2015, 6:32 am

    hello sir….. yours article is really awesum

  • rona February 20, 2015, 4:07 am

    thanku 4 ur valuable information

  • Mukesh June 4, 2015, 2:14 pm

    Nice article

  • Anonymous December 2, 2015, 10:18 am


  • Chinju January 15, 2016, 11:59 pm

    Very useful article….thank you sir.