Menu

Tree [r102] /
 History

HTTPS access


File Date Author Commit
 example 2011-06-22 dan_brumleve [r99] build fixes
 old 2007-08-16 dan_brumleve [r27] sf will you save my old stuff for me in my curr...
 releases 2011-06-22 dan_brumleve [r102] fix srcdist, add new source release
 toxic 2007-08-15 dan_brumleve [r14] reorganize old files
 FAQ 2007-08-12 dan_brumleve [r1] first checkin
 INSTALL 2007-08-12 dan_brumleve [r1] first checkin
 LICENSE 2007-08-12 dan_brumleve [r1] first checkin
 Makefile 2007-08-12 dan_brumleve [r1] first checkin
 Makefile.build 2011-06-22 dan_brumleve [r99] build fixes
 Makefile.common 2011-06-22 dan_brumleve [r99] build fixes
 Makefile.dist 2011-06-22 dan_brumleve [r102] fix srcdist, add new source release
 Makefile.install 2011-06-22 dan_brumleve [r100] fix message
 Makefile.qrspiral 2007-08-19 dan_brumleve [r57] foo
 Makefile.version 2007-08-18 dan_brumleve [r33] readme updates, version bump
 README 2007-08-19 dan_brumleve [r50] readm
 Ulam.png 2007-08-12 dan_brumleve [r1] first checkin
 account.cpp 2011-06-22 dan_brumleve [r101] bug fixes
 account.h 2007-08-16 dan_brumleve [r16] made merge and split work again, sort of
 assert.h 2011-06-22 dan_brumleve [r96] fix build
 authorization.cpp 2007-09-06 dan_brumleve [r95] synchronize method, more renaming
 authorization.h 2007-09-06 dan_brumleve [r95] synchronize method, more renaming
 authorize.h.pl 2007-08-30 dan_brumleve [r92] noninteractive everything
 bank.cpp 2011-06-22 dan_brumleve [r101] bug fixes
 bank.h 2007-08-16 dan_brumleve [r28] more refactoring, +check command
 bankadmin.cpp 2007-08-19 dan_brumleve [r66] work around c_str weird issues
 bankserve.cpp 2011-06-22 dan_brumleve [r96] fix build
 bankshell.cpp 2007-09-06 dan_brumleve [r95] synchronize method, more renaming
 client.cpp 2011-06-22 dan_brumleve [r96] fix build
 client.h 2007-09-06 dan_brumleve [r95] synchronize method, more renaming
 coinflip.cpp 2011-06-22 dan_brumleve [r96] fix build
 command.cpp 2007-08-30 dan_brumleve [r92] noninteractive everything
 command.h 2007-08-30 dan_brumleve [r92] noninteractive everything
 ctx.cpp 2007-08-21 dan_brumleve [r79] typo
 ctx.h 2007-08-30 dan_brumleve [r90] change names
 elgamal.cpp 2007-08-19 dan_brumleve [r66] work around c_str weird issues
 elgamal.h 2007-08-19 dan_brumleve [r58] simplify decrypt
 envelope.cpp 2007-08-31 dan_brumleve [r93] renames
 envelope.h 2007-08-31 dan_brumleve [r93] renames
 execute.cpp 2007-09-06 dan_brumleve [r95] synchronize method, more renaming
 execute.h 2007-09-06 dan_brumleve [r95] synchronize method, more renaming
 flipserve.pl 2011-06-22 dan_brumleve [r96] fix build
 foreach.h 2007-08-31 dan_brumleve [r94] useful
 genpc.cpp 2007-08-31 dan_brumleve [r94] useful
 number.cpp 2007-08-19 dan_brumleve [r66] work around c_str weird issues
 number.h 2007-08-22 dan_brumleve [r86] debug
 positive.cpp 2007-08-30 dan_brumleve [r90] change names
 positive.h 2007-08-30 dan_brumleve [r90] change names
 qrspiral.cpp 2011-06-22 dan_brumleve [r96] fix build
 server.cpp 2011-06-22 dan_brumleve [r96] fix build
 server.h 2007-08-15 dan_brumleve [r12] lots of refactoring, currently in a broken state
 small.cpp 2007-08-30 dan_brumleve [r90] change names
 small.h 2007-08-30 dan_brumleve [r90] change names
 square.cpp 2007-08-30 dan_brumleve [r90] change names
 square.h 2007-08-30 dan_brumleve [r90] change names

Read Me

INTRODUCTION

This is the README For BankOfEuler version 0.9.1.

BankOfEuler is a public domain zero-knowledge banking server.

The BankOfEuler server (bankserve) only sees encrypted values and is
not aware of the actual quantities stored or transferred.  Homomorphic
properties of the encryption allow the server to combine encrypted
values, producing encrypted sums and differences.  When values are
subtracted, interactive proofs are used to convince the server
that the difference is non-negative.

BankOfEuler enables micropayments by ensuring equal scrutiny for every
transaction.

BankOfEuler enables secure games of chance via shared proof construction.
An example coin-flipping application is included.

BankOfEuler is not finished yet.  It contains security holes.  Read the source
code to know more of the whole truth.

BankOfEuler is named in honor of Leonhard Paul Euler (1707-1783), who
discovered the fact that x^phi(n) = 1 mod n.  For more information, see:
http://en.wikipedia.org/wiki/Leonhard_Euler


SYSTEM REQUIREMENTS

BankOfEuler requires:
	gmp-4.2.1	http://ftp.sunet.se/pub/gnu/gmp/gmp-4.2.1.tar.gz
	stunnel-4.20	http://www.stunnel.org/download/stunnel/src/stunnel-4.20.tar.gz
	openssl-0.9.8e	http://www.openssl.org/source/openssl-0.9.8e.tar.gz


COMPILATION

Before compiling, make sure libgmp.so has been installed in the system library path,
or else add the directory containing this file to the LD_LIBRARY_PATH environment
variable.

To build BankOfEuler, type:
	make

bankshell and bankserve will be produced.


INSTALLATION

To install BankOfEuler, type:
	make install

BankOfEuler will be installed in /usr/local/BankOfEuler.  Symbolic links
to bankshell and bankserve will be created in /usr/local/bin.


RUNNING THE SERVER

stunnel must be in your PATH to run bankserve.

To start the BankOfEuler server, type:
	bankserve > bankserve.log &


TESTING THE CLIENT AND SERVER

stunnel must be in your PATH to run bankshell.

"$BANKOFEULER_HOME" in the following section refers to the installation
directory /usr/local/BankOfEuler.  You can copy /usr/local/BankOfEuler to
a new location and set the BANKOFEULER_HOME environment variable to this
directory in order to run multiple bankshell or bankserve instances with
different configurations.  This directory can also be specified on the
command lines of bankshell and bankserve with the "-d" option.

In order to run the following test cases verbatim with the default
installation, you should first type:
	export BANKOFEULER_HOME=/usr/local/BankOfEuler

A $10 value is provided with the default server installation, in
account 0x75.  $BANKOFEULER_HOME/values should contain one directory
which contains one empty file.  In the default server configuration,
$1 = 2^768, and the name of the empty file will be a hash of an
encryption of 10*2^768.  The name of the directory containing the
file is related to the account number 0x75 in the same way.

bankshell manages values in directories named by your Unix username,
located in $BANKOFEULER_HOME/accounts.  The directory structure
and file-naming are the same as the server-side values directory,
with two differences.  Each directory has a ".id" file containing
the decrypted account number, and the files are no longer empty,
but contain decrypted monetary values.

Initially the accounts directory is empty.

To make bankshell aware of the $10 in account 0x75, type:
	bankshell sync -a 0x75 '$10'

Confirm that it is in your account:
	bankshell list -a 0x75

Check that it is still valued by the server:
	bankshell check -a 0x75 '$10'

It should say "0xa000[...] has value".

To split the $10 value into $2 and $8, type:
	bankshell split -a 0x75 '$10' '$2'

$BANKOFEULER_HOME/values/H297c*/ should now contain exactly two empty files.

You should be able see both values in hexadecimal with bankshell list:
	bankshell list -a 0x75

Check that $2 and $8 have value now:
	bankshell check -a 0x75 '$2'
	bankshell check -a 0x75 '$8'

Check that $10 does not:
	bankshell check -a 0x75 '$10'

To merge these values into $10 again:
	bankshell merge -a 0x75 '$2' '$8'

Check that $10 is valuable again:
	bankshell check -a 0x75 '$10'


Now from the $10, let's put $1 in account 1, 42 in account 2, and $3 in each of
accounts 3 and 4, while leaving $1 in account 0x75:
	bankshell split -a 0x75 '$10' -a 1 '$1' -a 2 '$2' -a 3 '$3' -a 4 '$3' -a 0x75
	bankshell list -a 0x75
	bankshell list -a 1
	bankshell list -a 2
	bankshell list -a 3
	bankshell list -a 4

(A real account number should be random and much larger.  As you can see, knowing
an account number allows you to transfer funds from or to it.)

Randomize the low-order bits of our $1 to obscure its value.  This
will split it into a large part and a small part, discarding the
small part.  Neither the server nor an eavesdropper should be able
to tell which part is which.

	bankshell randomize -a 0x75 '$1'

Check that the randomized $10 is valuable:
	bankshell list -a 0x75 |xargs bankshell check -x 0x75

Now bankshell list -a 0x75 should show only one value, starting with "0xfffffffff"
and very close to $10.


DISTRIBUTION

To prepare a source distribution, edit the version in the Makefile and at the
top of this README, and build your distribution by typing:
	make srcdist

BankOfEuler-$(VERSION).src.tar.gz will be built in this directory.


AUTHOR

BankOfEuler was conceived and written by Dan Brumleve <jdb1729@gmail.com>.