Giter Site home page Giter Site logo

spongycastlecryptodemo's Introduction

SpongyCastleCryptoDemo

A simple Android implementation of an AES encryption/decryption using SpongyCastle's API. This app implements the following technologies:

  1. AES symmetric encryption with CBC mode of operation
  2. 256-bit keys are randomly generated
  3. PKCS7 Padding

Please note some current caveats with the application:

  1. The app currently cannot accept ciphertext as input. To skirt around this issue, I made the app store the latest ciphertext in a variable, so if you want to decrypt the ciphertext, just press the "Decrypt" button, and the app will decrypt the recently stored ciphertext. The issue stems from the reality that once the ciphertext is converted from a byte array into its hexadecimal string form (what is displayed on-screen), it is nearly impossible to perform the reverse operation without accidentally modifying the value of the ciphertext. Until I can find a way around this problem, you will have to settle for the compromised solution.

  2. There is currently no means of key validation. I will probably use a hash-check solution for this feature once I come around to implementing it.

  3. There is currently no means of validating data that was decrypted with an incorrect key. What happens instead is that a decryption using an incorrect key will return an InvalidCipherTextException that is caught by the application; the app will continue to run normally without crashing. I am pretty sure there is a more elegant solution to handling this problem (most likely related to #2), but that will have to come in a future version.

  4. Key is currently not locally stored. Currently, the key and the IV are generated together after every button press. I will make sure to separate these two functions in a future update.

This application was tested on the following devices:

  1. An Android Virtual Device running Android 4.2.2
  2. A GSM Samsung Galaxy Nexus running Android 4.2.2

*This application requires a physical or virtual devices running at least Android 4.0.3.

spongycastlecryptodemo's People

Contributors

wizfactor avatar

Watchers

James Cloos avatar  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.