Top 10 Programming Language to learn in 2023

Are you a programming enthusiast looking to stay ahead of the curve in 2023? With the ever-evolving tech landscape, keeping up with the Best Programming Language to learn can be a daunting task. Fear not, as we have compiled a list of the top 10 Programming Languages that you should consider learning in 2023. Python: This versatile language continues to dominate in 2023, with its ease of use, readability, and a vast library of modules. JavaScript: As web development grows increasingly popular, JavaScript remains a crucial player, with its ability to create dynamic and interactive web pages. Java: This language has stood the test of time and remains a popular choice for enterprise software development. C++: A staple in the gaming and systems development industries, C++ offers exceptional performance and memory management. Swift: Apple's preferred language for iOS app development, Swift continues to grow in popularity with its simplicity and reliability. R: As data science and machin...

C Program For Caesar Cipher [Encryption & Decryption] | C Programming


Caesar Cipher

The Caesar cipher is one of the earliest known and simplest ciphers. It is a type of substitution cipher in which each letter in the plaintext is 'shifted' a certain number of places down the alphabet. For example, with a shift of 1, A would be replaced by B, B would become C, and so on. The method is named after Julius Caesar, who apparently used it to communicate with his generals.
More complex encryption schemes such as the Vigenère cipher employ the Caesar cipher as one element of the encryption process. The widely known ROT13 'encryption' is simply a Caesar cipher with an offset of 13. The Caesar cipher offers essentially no communication security, and it will be shown that it can be easily broken even by hand.

C Program For Caesar Cipher [Encryption]


#include<stdio.h>
int main()
{
    char msg[100], ch;
    int i,key;
    printf("Enter a plaintext \n");
    gets(msg);
    printf("Enter key");
    scanf("%d",&key);
    for(i=0;msg[i]!='\0';i++)
    {
        ch=msg[i];
        if(ch>='a'&&ch<='z')
        {
            ch=ch+key;
            if(ch>'z')
            {
                ch=ch-'z'+'a'-1;
            }
            msg[i]=ch;
        }
        else if(ch>='A'&&ch<'Z')
        {
            ch=ch+key;
            if(ch>'Z')
            {
                ch=ch='Z'+'A'-1;
            }
            msg[i]=ch;
        }
    }
    printf("Encrypted message: %s", msg);
    return 0;
}

C Program For Caesar Cipher [Encryption]


#include<stdio.h>
int main()
{
    char msg[100], ch;
    int i,key;
    printf("Enter a Encrypted test \t");
    gets(msg);
    printf("Enter key \t");
    scanf("%d",&key);
    for(i=0;msg[i]!='\0';i++)
    {
        ch=msg[i];
        if(ch>='a'&&ch<='z')
        {
            ch=ch-key;
            if(ch<'a')
            {
                ch=ch+'z'-'a'+1;
            }
            msg[i]=ch;
        }
        else if(ch>='A'&&ch<'Z')
        {
            ch=ch+key;
            if(ch<'A')
            {
                ch=ch+'Z'-'A'+1;
            }
            msg[i]=ch;
        }
    }
    printf("Dycrypted message: %s", msg);
    return 0;
}

Comments

Popular posts from this blog

Array in C Programming | C Programming

C program to Find Cartesian Product of Two Sets | C programming

Eliminating Epsilon transition (ε-Transitions) | Conversion of Epsilon-NFA to DFA | Conversion of Epsilon-NFA to NFA | Theory Of Computation (TOC)