Skip to content

mgaare/cube2-crypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cube2.crypto

cube2.crypto is a small Clojure library for interoperating with Cube 2: Sauerbraten's Auth functionality, based on Elliptic Curve Cryptography.

Morgan Borman has a build of the C++ Sauerbraten library with some useful utility functions here: cube2crypto

Installation

Add the following dependency to your project.clj file:

[sauerworld/cube2.crypto "1.0.0"]

Usage

(ns auth
  (:require [sauerworld.cube2.crypto as crypto]))

;; create private key
(def private-key (crypto/make-privkey)

;; generate public key
(def public-key (crypto/get-pubkey private-key))

;; generate an auth challenge
(def chal (crypto/challenge public-key))

;; generate an answer to the challenge
(def answer (crypto/answer private-key (:challenge chal)))

;; they should match
(= answer (:answer chal))

License

Copyright © 2014 Michael Gaare

Distributed under the Eclipse Public License, the same as Clojure.

About

Clojure library for doing cube2 crypto auth

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published