Giter Club home page Giter Club logo

vigenere-example-rust's Introduction

Vigenère Cipher Example for Rust

Simple code that implements basic Vigenère Cipher alghoritm in Rust


How is it built?

It is built using a simple pseudo-code example for implementing Vigenère cipher alghoritm. You can see it below:

m <-- length of key
for index, character in plaintext:
    ciphertext[index] <-- (character + key[index % m]) % 26
return ciphertext

However, it is made more complex in order to not encrypt the spaces and by doing so, to make encryption of whole sentences possible. Since the v0.2.0 decryption is also supported.

Limitations

This program is a very simple example of Vigenère cipher alghoritm, so it takes only uppercase English letters and spaces for plaintext or ciphertext and uppercase English letters for a key. Any other symbol will not be encrypted correctly.

The output

Plaintext: HELLO WORLD
Key: KEY
Ciphertext: RIJVS UYVJN
Decrypted ciphertext: HELLO WORLD

To change the values and the output, clone this repo and change the main function as you want in main.rs.

vigenere-example-rust's People

Contributors

danielprog39 avatar

Watchers

 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.