File: README.md

package info (click to toggle)
crypto-equality-clojure 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 116 kB
  • sloc: makefile: 22; sh: 7
file content (37 lines) | stat: -rw-r--r-- 817 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# crypto-equality

A very small Clojure library for protecting against
[timing attacks][1] when comparing strings or sequences of bytes.

This is useful for comparing user-supplied values against secrets held
by the application, such as tokens or keys.

[1]: https://en.wikipedia.org/wiki/Timing_attack

## Installation

Add the following dependency to your `project.clj` file:

    [crypto-equality "1.0.0"]

## Usage

Require the `crypto.equality` namespace:

```clojure
(require '[crypto.equality :as crypto])
```

Then use the `eq?` function to compare strings, byte arrays, or any
ordered sequence of integers.

```clojure
(crypto/eq? "foo" "foo") ;; => true
(crypto/eq? "foo" "bar") ;; => false
```

## License

Copyright © 2014 James Reeves

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