Skip to content

Muhammad-Ahsan-Rasheed/ceaser-cipher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

 

Python Code for Ceaser Cipher

Table of Content


GitHub followers

Caesar cipher

In cryptography, a Caesar cipher, also known as Caesar's cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and most widely known encryption techniques.

Example

The transformation can be represented by aligning two alphabets; the cipher alphabet is the plain alphabet rotated left or right by some number of positions. For instance, here is a Caesar cipher using a left rotation of three places, equivalent to a right shift of 23 (the shift parameter is used as the key):

PlainABCDEFGHIJKLMNOPQRSTUVWXYZ
CipherXYZABCDEFGHIJKLMNOPQRSTUVW

When encrypting, a person looks up each letter of the message in the "plain" line and writes down the corresponding letter in the "cipher" line.

Plaintext:  THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
Ciphertext: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD

How this code is working?

The code has three main functions:

  1. encrypt - to encrypt the text
  2. decrypt - to decrypt the text
  3. filing - to read, write the file and perform encryption and decryption

 

P.S: It will only encrypt the alphabets, not numbers.

I used list comprehension for one line code. If you want to know more about check this out

List Comprehension

List Comprehension Effective Way to Solve Tasks?

Follow for more updates...

Want to collaborate? Let’s catch up! 💀

Happy Coding 😄

Releases

No releases published

Packages

No packages published

Languages