Giter VIP home page Giter VIP logo

fe-js-cryptography's Introduction

Cryptographic Functions

Cryptography is the study of decoding and encoding codes and cyphers. In this lab, you'll be writing javascript functions that decode and encode strings of text!

Instructions

Fork and clone this lab, and then cd into the lab directory. Run npm install to install the needed dependencies. Open index.html to see the tests, and follow along with the instructions below to get them to pass.

You'll be writing javascript functions inside of ciphers.js - each function will perform a different cryptographic task.

Caesar Cipher

A Caesar cipher is one of the simplest (and easiest cracked) encryption methods. It is a Substitution Cipher that involves replacing each letter of the secret message with a different letter of the alphabet which is a fixed number of positions further in the alphabet.

For example: "Cat" with a position shift of 3 is: "Fdw"

Write a caesar encryption and decryption function in ciphers.js.

Atbash Cipher

The Atbash cipher is a very specific case of a substitution cipher where the letters of the alphabet are reversed. In otherwords, all As are replaced with Zs, all Bs are replaced with Ys, and so on.

Because reversing the alphabet twice will get you actual alphabet, you can encipher and decipher a message using the exact same algorithm - so only one function needed here!

Plaintext: This is a secret message
Ciphertext: Gsrh rh z hvxivg nvhhztv

Keyword Cipher

The Keyword cipher is identical to the Caesar Cipher with the exception that the substitution alphabet used can be represented with a keyword (In this case, KEYWORD).

To create a substitution alphabet from a keyword, you first write down the alphabet. Below this you write down the keyword (omitting duplicate letters) followed by the remaining unused letters of the alphabet.

ABCDEFGHIJKLMNOPQRSTUVWXYZ
KEYWORDABCFGHIJLMNPQSTUVXZ

To encipher a plaintext message, you convert all letters from the top row to their corresponding letter on the bottom row (A to K, B to E, etc).

fe-js-cryptography's People

Contributors

dfenjves avatar

Watchers

ela avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.