Code Monkey home page Code Monkey logo

digital-signature-elgamal's Introduction

--------------------------------------
  ____                  _       ____  
 / ___|_ __ _   _ _ __ | |_ ___|___ \ 
| |   | '__| | | | '_ \| __/ _ \ __) |
| |___| |  | |_| | |_) | || (_) / __/ 
 \____|_|   \__, | .__/ \__\___|_____|
            |___/|_|                  
--------------------------------------
Ciaran McNally - Assignment 2 - 16/12/2013
This tool was developed as a solution to my second Cryptography assignment.

--/For help/--
./run.sh -help

--/Example Run/--
./run.sh -go -f Crypto.zip
This would generate all our signatures & value files
for inspection.

./run.sh -v -f Crypto.zip
This would verify the file specified using the
generated files with created with the last command.


--/Files Generated/--
r.hex -             File containing r signature value in hex
s.hex -             File containing s signature value in hex
privatekey-x.hex -  Private key
publickey-y.hex -   Public key

--/Default Files/--
README -        This file!
argparser.jar - Used in assignment to parse cmd-line arguments.
Crypto2.java -  File containing assignment solution code
run.sh -        This compiles & sets the classpath, runs
                accepting additional cmd-line arguments.
generator-g -   Provided Generator hex g
prime-mod-p -   Provided Prime hex p

--/Notes and Problems/--
I had a problem where the output of my multiplicative inverse
was negative number. After some googling a suggestion I found
was to mod the number again which resulted in a successful
verification.

I threw an Arithmetic Exception that matched the one thrown by
the original modInverse BigInteger function, as I developed my
code using this first and thought it would would be a good fit. 
This exception is thrown when no inverse exists. I catch it and
try again. Likewise if our s = 0;

I spent a full day debugging my mod_inverse function, I was getting 
a null exception error and found it difficult to locate as it was
within my recursive function. I Eventually realised I simply didn't 
initialise one of my variables :( Fixed now!


--/HELP OUTPUT/--
Usage: ./run.sh <params>
Ciaran McNally
Make sure the files 'prime-mod-p' and 'generator-g' are in your dir.
Options include:

-help,-?                displays help information
-go                     Run assignment and generate our values...
-f,-file <string>       File to encrypt
-v,-verify              Verify correct encryption.

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.