prschulz / vigenere_cipher

design a vigenère cipher—morning exercise

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vigenere Cipher

History Lesson: The Vigenere Cipher, based off of the Caesar Cipher, was first documented in the mid 15th century by Leon Alberti. It was refered to as 'the indecipherable cipher' by the French and remained unbroken for around 400 years by Charles Babbage, the grandfather of the programmable computer.

Real Lesson: Implement a Vigenere Cipher using JavaScript. You should be able to encode and decode a word when given a keyword. Read the Wikipedia description here

A quick rundown of the steps:

  1. You take the message you want to encrypt (in this case 'attackatdawn').
message: attackatdawn
  1. You take the keyword you want to encrypt with (in this case 'lemon'), and repeat it so that it is the length as your message.
keyword: lemonlemonle
  1. You add each letter of the message to each letter of the keyword to produce each letter of the ciphertext. For example, for the first letter:
  • message: 'a' is index 0 in the alphabet
  • keyword: 'l' is index 11 in the alphabet
  • ciphertext: letter at index (0 + 11), which is 'l'
ciphertext: lxfopvefrnhr

About

design a vigenère cipher—morning exercise


Languages

Language:JavaScript 94.4%Language:CSS 4.6%Language:HTML 1.0%