FXC Simple Secret Sharing - clojure library
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc
src/fxc
test/fxc
.codeclimate.yml
.gitignore
.travis.yml
LICENSE.txt
README.md
project.clj

README.md

FXC Simple Secret Sharing

software by Dyne.org

Build Status

Code Climate

Clojars Project

The "FXC" cryptographic protocol is used to split a secret string in multiple parts and to recover it using some of these parts (quorum). An functional application demonstrating its functionality is available at secrets.dyne.org

Simple Secret Sharing is fun

The FXC protocol and its use case (mostly related to social digital currency) are explained in this document Implementation of digital social currency infrastructure (D5.5) produced as part of the research conducted in the D-CENT project.

Usage

(require 'fxc.core)
(def secret (fxc.core/generate :url 32))
(def shares (fxc.core/encode fxc.core/settings secret))
(fxc.core/decode fxc.core/settings shares)

Default configuration settings:

{:salt "La gatta sul tetto che scotta",
 :description "FXC v1 (Simple Secret Sharing, Freecoin component)",
 :protocol "FXC1", :alphabet "ABCDEFGHJKLMNPQRSTUVWXYZ23456789",
 :quorum 3,
 :prime prime4096,
 :type "WEB",
 :total 5,
 :max 1024,
 :length 6,
 :entropy 3.1}

Public functions:

  • Encode
fxc.core/encode
([conf pass])
  Takes a string and returns multiple strings that can be used to
  retrieve the original according to settings.
  • Decode
fxc.core/decode
([conf slices])
  Takes a collection of strings and returns the original secret
  according to the settings.
  • Generate
fxc.core/generate
([type size])
  Generates a random password of type and size. Available types
  are :bytes :base64 :base32 :hex and :url

Acknowledgments

Haarlem's Alphabet textile, from a Vlisco exhibition

Industry standard addressed: Information technology -- Security techniques -- Secret sharing

The Secret Sharing algorithm adopted is based on Shamir's Secret Sharing, references:

  • Shamir, Adi (1979), "How to share a secret", Communications of the ACM 22 (11): 612–613
  • Knuth, D. E. (1997), The Art of Computer Programming, II: Seminumerical Algorithms: 505

The implementation used is by Tim Tiemens with a 4096 cipher prime number. The Integer Compression algorithm used internally is the FastPFOR128 by Daniel Lemire, see: Lemire, D. and Boytsov, L. "Decoding billions of integers per second through vectorization" (2015).

License

FXC is Copyright (C) 2015-2017 by the Dyne.org Foundation

Designed, written and maintained by Denis Roio jaromil@dyne.org

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.