# Programming Encryption Algorithms

## Computer Science (Caesar Cipher & Vigenere Cipher)

Encryption is the process of converting a plain text message into cipher text which can be decoded back into the original message. While security is an afterthought for many PC users, it’s a major priority for businesses of any size. Encryption is a way to keep your data safe. There are many different encryption algorithms being used today, some of the most regularly used are RSA, Triple DES, Blowfish, and AES. Two of the simplest and most widely known encryption techniques are Caesar Cipher, and Vignere Cipher. The two encryption methods we will focus on in this article are the Caesar Cipher, and Vignere Cipher algorithms.

### Caesar Cipher

The Caesar cipher is a type of substitution encryption. It is considered one of the easiest algorithms to implement. It was used by and is named after Julius Caesar. This cipher is however easily broken through different techniques such as frequency analysis.

Substitution encryption is a type of encryption where some letter is replaced by another letter some constant number away.

### How Encryption Works using (Caesar Cipher)

Lets say I want to send a secret message to someone, so I encrypt it using Caesar Cipher.

For instance, below I have an encrypted message using Caesar cipher and a right rotation of twenty three places, or equivalently a left shift of 3 (the “shift”/ “rotation” parameter is called the “key”):

`EBIIL COFBKA`

Once encrypted, the message becomes slightly unreadable. But, equipped with the secret pass code or “key” I text the sender, s/he can decrypt it and get the original message:key = 3

`HELLO FRIEND`

So the key was a left shift of 3 or equivalently a right shift of 23. You can see what that looks like for the alphabet below for the matching characters.

`Plain Text:    ABCDEFGHIJKLMNOPQRSTUVWXYZCipher Text:   XYZABCDEFGHIJKLMNOPQRSTUVW`

Formula:

### Caesar Cipher Program

Here is a video on programming this algorithm using the C — Programming language. You can use this video to create your own encrypted text.

### Vigenere Cipher

The Vigenère cipher is a form of polyalphabetic substitution. It is an algorithm of encrypting alphabetic text (e.g. “a” , “b”, “c” etc) by using a series of interwoven Caesar ciphers based on the letters of a keyword. Although Giovan Battista Bellaso had invented the cipher, the Vigenère cipher is named after Blaise de Vigenère.

Polyalphabetic cipher is any cipher based on substitution, using multiple substitution alphabets. Vigenere Cipher is an example of this. A more complex example is the Enigma machine.

### How Encryption Works using (Vigenere Cipher)

Lets say I want to send a secret message to someone, so I encrypt it using Vigenere Cipher.

For instance, below I have an encrypted message using the Vigenere Cipher and a key = “ABCD”

`CSASTP KV SIQUT GQU CSASTPIUAQJB`

Once encrypted, the message becomes slightly unreadable. But, equipped with the secret pass code or “key” I text the sender, s/he can decrypt it and get the original message:key = “ABCD”

`CRYPTO IS SHORT FOR CRYPTOGRAPHY`

So the key was “ABCD”. You can see what that looks like for the alphabet below for the matching characters.

`Key:        ABCDABCDABCDABCDABCDABCDABCDPlaintext:  CRYPTOISSHORTFORCRYPTOGRAPHYCiphertext: CSASTPKVSIQUTGQUCSASTPIUAQJB`

Formula:

### Vigenere Cipher Program

Vigenere Cipher C Program video.

### Conclusion

Learning how these cyphers work can help your understanding of other encryption methods, but I wouldn’t use them if there was something confidential that I wanted to keep away from everyone else, accept maybe a in class love letter. Thanks for reading and I hope you enjoyed this article. Be sure to check out my videos on programming and computer science on YouTube !

Like what you read? Give randerson112358 a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.