Caesar Cipher

Caesar Cipher


Encrypt

  • To encrypt is the process of making data unreadable by other humans or computers for the purpose of preventing others from gaining access to its contents.

  • Encrypted data is generated using an encryption program such as PGP, encryption machine, or a simple encryption key and appears as garbage until it is decrypted.

  • To read or use the data, it must be decrypted, and only those who have the correct password or decryption key can make the data readable again.

  • A very basic encryption technique known as simple substitution, substitution cipher, or Caesar cipher (named after Julius Caesar) that shifts the letters of the alphabet over a few characters. For example, as shown below the alphabet is shifted over four characters.

    Encrypt key

    a=e, b=f, c=g, d=h, e=i, f=j, g=k, h=l, i=m, j=n, k=o, l=p, m=q, n=r, o=s, p=t, q=u, r=v, s=w, t=x, u=y, v=z, w=a, x=b, y=c, and z=d.

    Decrypt key

    a=w, b=x, c=y, d=z, e=a, f=b, g=c, h=d, i=e, j=f, k=g, l=h, m=i, n=j, o=k, p=l, q=m, r=n, s=o, t=p, u=q, v=r, w=s, x=t, y=u, and z=v

  • Using this technique a user could encrypt the message: computer hope free help for everyone to: gsqtyxiv lsti jvii lipt jsv izivcsri. Below is an example of how this could be done using Perl.

    my (%key, $new);
    my $alpha = "abcdefghijklmnopqrstuvwxyz";
    my $message = "computer hope free help for everyone";
    @alpha = split(//, $alpha);
    my $i=1;
    foreach $alpha (@alpha) {
    if ($i >= 23) {
    $i = -3;
    }
    $key{$alpha} = $alpha$i+3;
    $i++;
    }
    @message = split(//,$message);
    foreach $message (@message) {
    if ($message =~/a-z/i) {
    $new .= "$key{$message}";
    }
    else {
    $new .= "$message"; }
    }
    print "Old: $message\nEncrypted: $new\n";


    What is an Operating System? » Computer Shortcut Keys and their
    Functions
    » Keyboard Function Keys » Computer Basics - Hardware - Software - Parts

    Short Stories for Kids - Moral Stories – English Short Stories for Children - Moral Stories for Kids - Stories for Kids - Funny Story for Kids - Scary Stories for Kids - Really Funny Short Stories - Bedtime Stories
    Proverb Stories
    Powerful Motivational Quotes for Students » Success Quotes » English Short Stories for Kids

    Cabin Crew Jobs & Career Advice » Secretary Job Description » Receptionist Job Description » Top 100 Interview Questions and Answers » How to Prepare for an Interview » How to Write a CV » How to Choose a Career » Computer Shortcut Keys and their Functions

    Scholarships in Australia » Scholarships in Austria » Scholarships in Belgium » Scholarships in Canada » Scholarships in Germany » Scholarships in Ireland » Scholarships in Italy » Scholarships in Japan » Scholarships in Korea » Scholarships in Netherlands » Scholarships in Switzerland » Scholarships in UK » Scholarships in USA

    Scholarships for Study in Africa » Scholarships for African Students » Undergraduate Scholarships » African Women Scholarships & Grants Scholarships for Study in Africa » Scholarships for African Students » Undergraduate Scholarships » African Women Scholarships & Grants Scholarships for Study in Africa » Scholarships for African Students » Undergraduate Scholarships » African Women Scholarships & Grants Short Stories for Kids - Moral Stories – English Short Stories for Children - Moral Stories for Kids - Stories for Kids - Funny Story for Kids - Scary Stories for Kids - Really Funny Short Stories - Bedtime Stories
    Proverb Stories
    Powerful Motivational Quotes for Students » Success Quotes »Scholarships in UK » Scholarships in USA Scholarships in UK » Scholarships in USA Scholarships in UK »

  • Click here to post comments

    Join in and write your own page! It's easy to do. How? Simply click here to return to Computer Basics FAQ.