Giter VIP home page Giter VIP logo

crypto's Introduction

Let's implement some cryptographic algorithms for fun! This project is just for fun. Obviously don't use any of this code in any security-critical application!

For now, AES-128, AES-192, and AES-256 are implemented; ECB and CBC modes are supported.

Compiling

The supplied makefile is for the Windows NMAKE utility. Running nmake will produce aes.exe.

Running

Run aes.exe from the command line:

aes.exe [options] inputFile outputFile

Required options include:

  • -k [key file] Provides the file containing AES key. The file must contain exactly 16, 24, or 32 bytes.
  • -e or -d Indicates whether to encrypt (-e) or decrypt (-d) the input file.

Optional arguments include:

  • -m [mode] Indicates what mode of operation to use for AES encryption. Valid modes are cbc and ecb, with the default being cbc. The mode is specified in the header of an encrypted file, so this option is ignored when -d is specified.
  • -f Force. Overwrites output file if it already exists.
  • -v Verbose. More about the status of the encryption/decryption will be written to cout.
  • -t Test. Instead of encrypting/decrypting a file, run tests to verify that aes.exe is working correctly.

For example, to encrypt a file secrets.txt to a file encryptedSecrets.bin, using an AES key in the file key.bin, run:

aes.exe -e -k key.bin secrets.txt encryptedSecrets.bin

Testing

Before running the tests with aes.exe -t, the test files must be generated in the testFiles folder. This folder contains vectors.txt, which contains AES test vectors published by NIST. To expand these test vectors into files used by aes.exe -t, run maketests.bat in the testFiles folder.

Roadmap

As my leisure time permits, here are my future tasks for this project:

  • Implement other AES modes of operation.
  • Derive AES keys from passwords rather than using a key read from a file.
  • Implement other cryptographic algorithms.

crypto's People

Contributors

aschurman 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.