Code Monkey home page Code Monkey logo

aekee's Introduction

aeKee

Simple client-side Javascript only PBKDF2->AES->HMAC and back encryption/decryption implementation.

Makes use of, with thanks, portions of both CryptoJS and SaltThePass:

https://github.com/brix/crypto-js (used for all cryptographic functionality)

https://github.com/nicjansma/saltthepass.js (used to generate random IV)

Uses the same encryption/decryption algorithm as used at https://aekee.com for secure vaults, password generator and secure notes.

Does not use jQuery.

Runs in all modern browsers (that have been tested so far). Does not require an internet connection.

Download using the big green button above and to the right of this document (if you're currently viewing this here: https://github.com/aekee/aeKee) and open aekee.html in a 'modern' browser. Ideally Chrome or Firefox, 2017+ version.

Initial pre-loaded ciphertext decrypts with passphrase 'aekee'.

Live demo: https://aekee.com/ol/aekee.html

Encryption follows this protocol (decryption reverses it, decoding the HMAC first - if this fails, decryption ceases at that point.)

  1. Generate a random IV using SaltThePass.

  2. Perform around 10,000 iterations of PBKDF2 on the entered passphrase using the IV as a salt (number of iterations dependent partly on a simple sum of the ascii character values in the passphrase) to generate a key 'K'.

  3. Split the key into two halves. Encryption Ke and Km.

  4. Encrypt the plaintext with AES in CBC mode, padding with PKCS#7 using the IV, and Ke as key.

  5. Concatenate the IV and encrypted data and generate a SHA-256 HMAC of this using Km as key.

  6. The final output is then the concatenation of the IV, the encrypted data and the HMAC. The IV and HMAC are of known length so can easily be extracted ready for decryption when needed.

Credit to Thomas Pornin for providing the inspiration for some of the above algorithm here: https://security.stackexchange.com/questions/63132/when-to-use-hmac-alongside-aes

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.