n1analytics / javallier

A Java library for Paillier partially homomorphic encryption.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to encrypt negative number using CLI

mpnd opened this issue · comments

commented

I've been trying to encrypt a negative number using CLI without any success.

The help menu states the following:

Note if you are passing a negative number to encrypt, you will
need to include a "--" between the public key and your plaintext.

I've tried various ways to include "--" in the command but none of them work. What I've tried so far:
./javallier encrypt -o encrNeg1.json defaultkeypair.pub -- "-1"
./javallier encrypt -o encrNeg1.json defaultkeypair.pub "--" "-1"
./javallier encrypt -o encrNeg1.json defaultkeypair.pub -- -1
./javallier encrypt -o encrNeg1.json defaultkeypair.pub "---1"

All of these return:

Parsing failed. Reason: Unrecognized option

commented

The main issue here (and in #35) is the command line binary generated by sbt stage. The issue does not occur when the command line binary is generated using sbt assembly.