verificatum / verificatum-vmn

The first implementation of a fully distributed provably secure and universally verifiable mix-net based on the El Gamal cryptosystem.
https://www.verificatum.org
Other
11 stars 4 forks source link

Trouble running the VMN on Ubuntu 22.04.3 VM #17

Closed noiseight closed 5 months ago

noiseight commented 10 months ago

Hello, in the context of a voting protocol I would like to shuffle and decrypt some ElGamal ciphertexts. I do not need the all mixnet stuff as I would only have one server operating, but I heard about Verificatum and I figured I would give it a go.

I installed Oracle VM VirtualBox and started a new VM with a Linux environment (Ubuntu 22.04.3 Jammy Jellyfish) and religiously followed the steps provided at verificatum.org to build, install and make check gmpmee, vcr, vecj, vmgi and vmn, in the correct order. (Everything was ok.) However, when I type the command vmni -h, I have the following error:

Exception in thread "main" com.verificatum.protocol.ProtocolError: Failed to add default value!
    at com.verificatum.protocol.com.BullBoardBasicHTTPGen.addDefault(BullBoardBasicHTTPGen.java:135)
    at com.verificatum.protocol.com.BullBoardBasicHTTPWGen.addDefault(BullBoardBasicHTTPWGen.java:85)
    at com.verificatum.protocol.ProtocolBBGen.addDefault(ProtocolBBGen.java:116)
    at com.verificatum.protocol.elgamal.ProtocolElGamalGen.addDefault(ProtocolElGamalGen.java:204)
    at com.verificatum.protocol.ProtocolGen.defaultPrivateInfo(ProtocolGen.java:362)
    at com.verificatum.ui.info.InfoTool.main(InfoTool.java:979)
Caused by: com.verificatum.ui.info.InfoException: Value out of domain! Value does not match expression! (http://vm-VirtualBox:8040 is not urlport)
    at com.verificatum.ui.info.Info.addValue(Info.java:188)
    at com.verificatum.protocol.com.BullBoardBasicHTTPGen.addDefault(BullBoardBasicHTTPGen.java:130)
    ... 5 more
Caused by: com.verificatum.ui.info.InfoException: Value does not match expression! (http://vm-VirtualBox:8040 is not urlport)
    at com.verificatum.ui.info.NetField.validate(NetField.java:94)
    at com.verificatum.ui.info.NetField.parse(NetField.java:101)
    at com.verificatum.ui.info.Info.addValue(Info.java:186)
    ... 6 more

I have found an old issue where you say that we should change http://vm-VirtualBox:8040 to a valid ip but I have no clue about how to do that. Did I miss a step in the configuration or the installation?

Also, I tried to run the demo to get a better understanding about how the all thing works. I followed the step provided at http://verificatum.org/html/install_vmn.html#ubuntu_22.04.1 but when I type the command ./info_files I have an error which is very similar to the one above.

I hope this message finds you well, thank you in advance.

PS: Fun fact, when I type wget https://www.verificatum.org/files/verificatum-vmn-3.1.0-full.tar.gz, I get the error

--2023-12-20 16:34:25--  https://www.verificatum.org/files/verificatum-vmn-3.1.0-full.tar.gz
Resolving www.verificatum.org (www.verificatum.org)... 194.237.215.196
Connecting to www.verificatum.org (www.verificatum.org)|194.237.215.196|:443... connected.
OpenSSL: error:0A00018A:SSL routines::dh key too small
Unable to establish SSL connection.

(I could go around it by dropping the s of the https.)

EDDIT : I tried the installation from scratch on a new VM. After the installation of vmn, the result of make check says:

----------------------------------------------------------------------

 EXECUTING TEST SEQUENCE

 You can execute a test separately using the "vtest" command. Use 
 "vtest -h" to learn how this command can be invoked, e.g., to
 implement and run your own tests.

 com.verificatum.protocol.elgamal.TestProtocolElGamalRear
 ----------------------------------------------------------------------
 constructOutputElement... done.

 com.verificatum.protocol.hvzk.TestPoSCBasicTW
 ----------------------------------------------------------------------
 acceptingTranscript... done.
 rejectingTranscript... done.

 EXECUTED 3 TESTS SUCCESSFULLY.

EXECUTING DEMO SEQUENCE (12 classes)

com.verificatum.protocol.distr.DemoPlainKeys
com.verificatum.protocol.secretsharing.DemoPedersen
com.verificatum.protocol.secretsharing.DemoPedersenSequential
com.verificatum.protocol.distr.DemoIndependentGenerator
com.verificatum.protocol.distr.DemoDKG
com.verificatum.protocol.elgamal.DemoDistrElGamal
com.verificatum.protocol.coinflip.DemoCoinFlipPRingSource
com.verificatum.protocol.distr.DemoIndependentGeneratorsI
com.verificatum.protocol.mixnet.DemoShufflerElGamal
com.verificatum.protocol.hvzk.DemoPoSCTW
com.verificatum.protocol.mixnet.DemoPermutationCommitment
com.verificatum.protocol.mixnet.DemoMixNetElGamal

Please be patient. Each demo executes a multiparty protocol, so it takes 
a while to complete.

Demo:  Classname:
--------------------------------------------------------
   1   com.verificatum.protocol.distr.DemoPlainKeys... done.
   2   com.verificatum.protocol.secretsharing.DemoPedersen... done.
   3   com.verificatum.protocol.secretsharing.DemoPedersenSequential... done.
   4   com.verificatum.protocol.distr.DemoIndependentGenerator... done.
   5   com.verificatum.protocol.distr.DemoDKG... done.
   6   com.verificatum.protocol.elgamal.DemoDistrElGamal... done.
   7   com.verificatum.protocol.coinflip.DemoCoinFlipPRingSource... done.
   8   com.verificatum.protocol.distr.DemoIndependentGeneratorsI... done.
   9   com.verificatum.protocol.mixnet.DemoShufflerElGamal... done.
  10   com.verificatum.protocol.hvzk.DemoPoSCTW... done.
  11   com.verificatum.protocol.mixnet.DemoPermutationCommitment... done.
  12   com.verificatum.protocol.mixnet.DemoMixNetElGamal... done.

EXECUTED 12 DEMOS SUCCESSFULLY.

###########################################################################

           CHECKING COMMAND-LINE EXECUTION OF MIX-NET

 Please be very patient. This check may take a long time. It iterates
 through a large number of different configurations of the mix-net and
 for each configuration we use the mix-net to mix ciphertexts, to
 shuffle ciphertexts without decrypting, and to decrypt ciphertexts
 without shuffling. Keep in mind that a mix-net is a multiparty
 protocol.

###########################################################################

Parameters of check: threshold1

NO_MIXSERVERS=1
THRESHOLD=1
MAX_NO_CIPHERTEXTS=
FORCED_MAX_NO_CIPHERTEXTS=
NO_CIPHERTEXTS=100
PGROUP=ECqPGroup(P-224)::00000000020100000020636f6d2e766572696669636174756d2e61726974686d2e4543715047726f75700100000005502d323234
CORRECTNESS=noninteractive
WIDTH=
KEYWIDTH=
FORCED_WIDTH=
INTER=native
HASH=STANDARD
SIG=
PRG=SHA-256
RAND=RandomDevice(/dev/urandom)::00000000020100000023636f6d2e766572696669636174756d2e63727970746f2e52616e646f6d446576696365010000000c2f6465762f7572616e646f6d
ARRAYS=file

Cleaning up data from previous demos... done.
Generate info files... 
  Making directories of servers.... done.
  Generating protocol stub file...Exception in thread "main" com.verificatum.protocol.ProtocolError: Failed to add default value!
    at com.verificatum.protocol.com.BullBoardBasicHTTPGen.addDefault(BullBoardBasicHTTPGen.java:135)
    at com.verificatum.protocol.com.BullBoardBasicHTTPWGen.addDefault(BullBoardBasicHTTPWGen.java:85)
    at com.verificatum.protocol.ProtocolBBGen.addDefault(ProtocolBBGen.java:116)
    at com.verificatum.protocol.elgamal.ProtocolElGamalGen.addDefault(ProtocolElGamalGen.java:204)
    at com.verificatum.protocol.ProtocolGen.defaultPrivateInfo(ProtocolGen.java:362)
    at com.verificatum.ui.info.InfoTool.main(InfoTool.java:979)
Caused by: com.verificatum.ui.info.InfoException: Value out of domain! Value does not match expression! (http://vm-VirtualBox:8040 is not urlport)
    at com.verificatum.ui.info.Info.addValue(Info.java:188)
    at com.verificatum.protocol.com.BullBoardBasicHTTPGen.addDefault(BullBoardBasicHTTPGen.java:130)
    ... 5 more
Caused by: com.verificatum.ui.info.InfoException: Value does not match expression! (http://vm-VirtualBox:8040 is not urlport)
    at com.verificatum.ui.info.NetField.validate(NetField.java:94)
    at com.verificatum.ui.info.NetField.parse(NetField.java:101)
    at com.verificatum.ui.info.Info.addValue(Info.java:186)
    ... 6 more

Most recent command executed at
Party 1 failed with exit code 1.

Demo command failed! Aborting.
verificatum commented 10 months ago

Sorry for the delay. I have been completely floored by Covid.

Each platform has its own way to deal with ports, and firewalls may have an impact, so I am not sure what is wrong with your VirtualBox setup (and I have never used VirtualBox). The code is written to be modular and robust, so you can replace the HTTP server with your own if you like, you can change those port numbers, etc. There are too many ways to do it to even try to cover in a manual.

A good way to set things up is to do it: locally, pseudo-locally (loopback), and then remotely in that order, orchestrated from a single laptop with key-based SSH login to the servers for minimum hassle. When this is working you know how to set it up on your platform and you really should do it from scratch again with hardened machines if you are setting it up for a real application. Then you try to virtualize if you prefer that. Now you know that any problem is an issue in how you virtualize, or its interaction with VMN. This is easier to trouble shoot.

It is interesting that wget behaves differently than browsers. Thank you for mentioning it!

Good luck and feel free to contact me at douglas@verificatum.com !

feliper-botelho commented 8 months ago

i made it work by changing my hostname it was something-something-XXX

try this hostnamectl set-hostname localhost

then build vmn again