Skip to content
constant time comparison
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/constance
test/constance
.gitignore
.travis.yml
LICENSE
README.md
deps.edn
pom.xml
project.clj

README.md

constance

A clojure library offering constant time comparison functions, to avoid timing attacks. If you're interested in the purpose of this library, I'd recommend reading this: http://codahale.com/a-lesson-in-timing-attacks/

Build Status

Usage

You'll need to get the following artifacts:

[spootnik/constance "0.5.3"]

Exposed functions

(constant-string= "foo" "bar")
;; false
(constant-string= "foo" "foo")
;; true
(constant= (.getBytes "h") (.getBytes "a"))
;; false

Additionally, two aliases now exist:

(=== "foo" "bar")
(b=== (.getBytes "h") (.getBytes "a"))

License

Copyright © 2014, 2015 Pierre-Yves Ritschard

Distributed under the MIT License

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.