Git Product home page Git Product logo

aes's Introduction

The second program exercise: Usage of block cyphers

The program was implemented by Nguyen Tien Anh

Description:

The project allows to encrypt and decrypt any type of file by AES Algorithm with CBC mode or CTR mode choices. The file key.txt contains the key which be used for encrypting and decrypting files by AES. This file must be kept secrete. The key size in this project has length 16 bytes (128 bits).

The project includes 4 files:

  1. aes.py contains AES class to encrypt and decrypt file by AES without any mode
  2. cbc_mode.py contains functions to encrypt and decrypt file by AES with CBC mode
  3. ctr_mode.py contains functions to encrypt and decrypt file by AES with CTR mode
  4. main.py contains main function

Requirement:

Python language with version 3.x

Usage:

From terminal type following command line to run:

python3 main.py --type type-crypt --mode mode-to-crypt --file path/to/filename/to/crypt

  1. Change "type-crypt" to "encrypt" if you want to encrypt file, else "decrypt" to decrypt file.
  2. Change "mode-to-crypt" to "cbc" if you want to do crypt file with mode CBC, else "ctr" is mode CTR.
  3. Change "path/to/filename/to/crypt" to file name you want to do crypt

Comparation time to excute between my project with pycrypto library:

  1. My project took 165 seconds to encrypt abc.pptx file (in size 14.3 MB) by AES with CBC mode. The pycrypto library took 0.09 seconds.
  2. My project took 220 seconds to decrypt the above file by AES with CBC mode. The pycrypto library took 0.084 seconds.
  3. My project took 166 seconds to encrypt abc.pptx file (in size 14.3 MB) by AES with CTR mode. The pycrypto library took 0.063 seconds.
  4. My project took 164 seconds to decrypt the above file by AES with CTR mode. The pycrypto library took 0.062 seconds.

==> My project excuted slower than the pycrypto library very much.

Copyright by Nguyen Tien Anh

aes's People

Contributors

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