<jupyter_start><jupyter_text>Caesar Cipher  About RSA AlgorithmCaesar 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. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on.  Algorithm1. Input Plain Text, P from user.2. Input Key, K from user.3. During Encryption, each alphabet in the plaintext is Shifted to the right by K characters, in a cyclic order.4. During Decryption, each alphabet in the plaintext is Shifted to the left by K characters, in a cyclic order.**Example:**Key = 2 and Plaintext = A   Encryption : **A -> B -> C** , therefore, Ciphertext = C    Decryption : **A <- B <- C** , therefore, Plaintext = A  EncryptionThe Alphabets A ... Z are represented as 0 ... 25 with A = 0 , B = 1 , ... , Z = 251. Each alphabet in P, is represented in its numeric form as mentioned above. 2. Modulus 26 is applied on the key, so that the key is within 0 to 26. 3. The output value is added to the numeric representation, 4. The resulting value if converted to its corresponding alphabet. Mathematically, **Cn = Pn + ( k mod 26 )**     OR     **Cn = ( Pn + k ) mod 26**where,**Pn** is the *numeric representation* of the nth Charcter of the plaintext, P**Cn** is the *numeric representation* of the nth Charcter of the Ciphertext, C**k** is the *key*![CaesarsEnc.jpg](attachment:CaesarsEnc.jpg) DecryptionThe Alphabets A ... Z are represented as 0 ... 25 with A = 0 , B = 1 , ... , Z = 251. Each alphabet in C, is represented in its numeric form as mentioned above. 2. Modulus 26 is applied on the key, so that the key is within 0 to 26. 3. The output value is subtracted from the the numeric representation, 4. The resulting value if converted to its corresponding alphabet. Mathematically, **Pn = Cn - ( k mod 26 )**     OR     **Pn = ( Cn - k ) mod 26**where,**Pn** is the *numeric representation* of the nth Charcter of the plaintext, P**Cn** is the *numeric representation* of the nth Charcter of the Ciphertext, C**k** is the *key*![CaesarDec.jpg](attachment:CaesarDec.jpg)  Implementation of Caesar Cipher using Python<jupyter_code>def encrypt(plaintext, key):
    ciphertext = []
    for i in plaintext:
        if i.isupper() :
            ciphertext.append(chr((ord(i)+key-65)%26+65))
        elif i.islower():
            ciphertext.append(chr((ord(i)+key-97)%26+97))
        else:
            ciphertext.append(i)
    return "".join(ciphertext)

def decrypt(ciphertext, key):
    plaintext = []
    for i in ciphertext:
        if i.isupper() :
            plaintext.append(chr((ord(i)-key-65)%26+65))
        elif i.islower():
            plaintext.append(chr((ord(i)-key-97)%26+97))
        else:
            plaintext.append(i)
    return "".join(plaintext)

print("Welcome! This is Caesar Cipher's implementation in Python.")
print("----------------------------------------------------------")
print() 
print("Caesar Cipher Encryption")
plaintext = input("  Enter Plaintext: ")
print("  Ciphertext: ",  encrypt(plaintext, int(input("  Enter the Key: "))))
print()
print("Caesar Cipher Decryption")
ciphertext = input("  Enter Ciphertext: ")
print("  Plaintext: ", decrypt(ciphertext, int(input("  Enter the Key: "))))<jupyter_output>Welcome! This is Caesar Cipher's implementation in Python.
----------------------------------------------------------

Caesar Cipher Encryption
  Enter Plaintext: Caesar Cipher is not Secure
  Enter the Key: 56
  Ciphertext:  Geiwev Gmtliv mw rsx Wigyvi

Caesar Cipher Decryption
  Enter Ciphertext: <KEY>
  Enter the Key: 56
  Plaintext:  Caesar Cipher is not Secure
{'fraction_non_alphanumeric': 0.1322140608604407, 'fraction_numerical': 0.019412381951731374, 'mean_word_length': 3.1221621621621622, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '651140', 'license': 'MIT', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1092, 'n_words': 481, 'path': 'Caesar Cipher/Caesar Cipher.ipynb', 'repo_name': 'TanmoySG/RSA-Algorithm', 'size': '3834'}