Commit graph

536 commits

Author SHA1 Message Date
Peter Taoussanis
e554dbb1c5 Fix tests path 2020-07-24 17:09:58 +02:00
Peter Taoussanis
1855c50d9b Dynamic-var housekeeping
Also toyed with:

  - Possibility single var derefs at `freeze`/`thaw` call.
    Abandoned since big change, and slower with opts destructuring.

  - Possibility of consolidating all config into a single var.
    Abandoned since breaking, and slower with opts destructuring.
2020-07-24 12:06:04 +02:00
Peter Taoussanis
809bcdc649 Bump deps 2020-07-23 12:22:27 +02:00
Peter Taoussanis
721b0fb4eb [#120] Update freezable? to cover nil 2020-07-23 12:22:27 +02:00
Peter Taoussanis
7aa6425159 [#127] Add utils: freeze-to-string, thaw-from-string (@piotr-yuxuan) 2020-07-23 12:22:27 +02:00
Peter Taoussanis
f1c71b58d8 [Crypto] Use enc/srng 2020-07-23 12:22:27 +02:00
Peter Taoussanis
649e140889 [Crypto] Add rand-long [n] arity 2019-03-30 13:42:46 +01:00
Peter Taoussanis
ee31c1c64b v2.15.0-RC1 2019-02-16 10:37:51 +01:00
Peter Taoussanis
7ea7bc5247 Bump misc deps 2019-02-16 10:36:19 +01:00
Peter Taoussanis
f955ed9b7e [#116] Update lz4 lib: 1.3->1.5 (@johnmcconnell)
The Maven group had changed, so didn't notice newer versions were
available. Changelog at https://github.com/lz4/lz4-java/blob/master/CHANGES.md#150.
2019-01-19 10:50:37 +01:00
Peter Taoussanis
4dc1e121e9 v2.15.0-alpha9 2019-01-06 14:21:30 +01:00
Peter Taoussanis
23276ac910 [#101] NB Change default encryption from AES-CBC to AES-GCM
Why?

  - AES-GCM is faster and can be more secure, Ref. https://goo.gl/Dsc9mL, etc.
  - AES-GCM is an authenticated[1] encryption mechanism, providing
    automatic integrity checks. This is relevant to [#101].

What's the issue with #101?

  - We    compress then encrypt    on freeze ; Reverse would make compression useless
  - So we decrypt  then decompress on thaw

Attempting CBC decryption with the wrong password will often but not
*always* throw. Meaning it's possible for decompression could be
attempted with a junk ba. And this can cause some decompressors to
fail in a destructive way, including large allocations (DDoS) or even
taking down the JVM in extreme cases.

Possible solutions?

  - We could add our own HMAC, etc.
  - And/or we could use something like AES-GCM which offers built-in
    integrity and will throw an AEADBadTagException on failure.

There may indeed be reasons [2,3,4] to consider adding a custom HMAC -
and that's still on the cards for later.

But in the meantime, the overall balance of pros/cons seems to lean
in the direction of choosing AES-GCM as a reasonable default.

Note that the change in this commit is done in a backward-compatible
way using Nippy's versioned header: new payloads will be written using
AES-GCM by default. But old payloads already written using AES-CBC will
continue to be read using that scheme.

References
  [1] https://en.wikipedia.org/wiki/Authenticated_encryption
  [2] https://www.daemonology.net/blog/2009-06-24-encrypt-then-mac.html
  [3] https://blog.cryptographyengineering.com/2011/12/04/matt-green-smackdown-watch-are-aead/
  [4] HMAC vs AEAD integrity,           https://crypto.stackexchange.com/q/24379
  [5] AES-GCM vs HMAC-SHA256 integrity, https://crypto.stackexchange.com/q/30627
2019-01-06 14:13:34 +01:00
Peter Taoussanis
ae8baa639d [Crypto] Misc housekeeping, prep for next release 2019-01-06 12:24:29 +01:00
Peter Taoussanis
b0c7a0f8c7 [Crypto] Rename some arguments for extra clarity 2019-01-06 12:24:29 +01:00
Peter Taoussanis
7f9b075ba7 [#114] PR housekeeping 2019-01-06 12:24:29 +01:00
Isak Sky
abb55da29e [#113 #114] Support object arrays (@isaksky) 2019-01-06 12:24:29 +01:00
Peter Taoussanis
d2252d8e21 Bump deps 2019-01-06 12:24:29 +01:00
Peter Taoussanis
5a705ca79e v2.15.0-alpha4 2018-10-07 09:39:28 +02:00
Peter Taoussanis
cfc904799b [Crypto] Rename prng->srng
Better reflects the fact that the source of randomness is now
actually conditional (e.g. via InstanceStrong).
2018-10-07 09:38:48 +02:00
Peter Taoussanis
90f0ff9315 [Crypto] sha512-key-ba: support utf8 *or* ba keys
Minor convenience.
2018-10-06 13:52:45 +02:00
Peter Taoussanis
c83572f0a8 [#112] PR housekeeping 2018-10-06 10:22:13 +02:00
Isak Sky
67dde8d7bd [#83 #112] Add support for deftype (@isaksky) 2018-10-06 09:57:35 +02:00
Isak Sky
192666c09e [#83 #113] Add URI support (@isaksky) 2018-10-06 09:50:24 +02:00
Peter Taoussanis
972c637ff4 v2.15.0-alpha3 2018-09-23 19:39:59 +02:00
Peter Taoussanis
e16c64c4f4 [Crypto] Add secure rand-nth fn 2018-09-23 19:38:51 +02:00
Peter Taoussanis
f6c17a7411 [Crypto] Tune prng re-seeding frequency 2018-09-15 22:20:27 +02:00
Peter Taoussanis
bfc65f0970 v2.15.0-alpha2 2018-09-15 12:01:07 +02:00
Peter Taoussanis
d7993bb469 [Crypto] Add more hashing fns
Specifically:

  - `sha512-ba` (without key salting, etc.)
  - `sha256-ba`
  - `murmur3` (Clojure 1.6+)
2018-09-15 11:56:40 +02:00
Peter Taoussanis
82bb2f0104 [Crypto] Randomness improvements
Specifically:

  - Now use blocking `getInstanceStrong` when available (Java 8+)
  - Now auto reseed prng after every ~10k calls (slower but safer)
  - [BREAKING] Support arbitrary random-bytes fn
  - Added new `rand-x` fns (double, long, bool, gauss)
2018-09-15 11:36:03 +02:00
Peter Taoussanis
7fa1d3686c v2.15.0-alpha1 2018-09-08 19:38:41 +02:00
Peter Taoussanis
868a8f65de [Encryption] Rewrite encryption ns to build off new crypto ns 2018-09-08 19:28:02 +02:00
Peter Taoussanis
2dec26fd95 [Encryption] Add a new (private, alpha) taoensso.nippy.crypto ns with low-level utils
Specifically:
  - Exposes ability to use arb crypto algorithm
  - Exposes ability to use arb key function
  - Supports explicit salts (incl. variable salt length)
  - Supports arbitrary key length (e.g. AES 256)
  - Defaults to AES/GCM/NoPadding algorithm
2018-09-08 19:28:02 +02:00
Peter Taoussanis
2812ffa6e5 [Encryption] Housekeeping, no behavioural changes 2018-09-08 15:10:51 +02:00
Peter Taoussanis
6a63950455 Bump deps 2018-09-08 14:58:12 +02:00
Peter Taoussanis
4448d2f2ab README: mark v2.14.0 as stable 2018-05-05 17:40:29 +02:00
Peter Taoussanis
b3a78fa30e v2.14.0 2017-12-21 11:05:06 +01:00
Peter Taoussanis
99748d9c0b Bump deps 2017-12-21 10:47:30 +01:00
Peter Taoussanis
2272d5ea57 [#104] Micro-optimization: remove unnecessary runtime 'if' in extend-freeze macro (@scramjet) 2017-12-21 10:47:30 +01:00
Peter Taoussanis
1a8a44286a [#93] Pickup record redefinitions at REPL, etc. (@smee) 2017-12-21 10:12:33 +01:00
Peter Taoussanis
0819ede2c1 CHANGELOG typo 2017-02-13 18:12:34 +01:00
Peter Taoussanis
e57057e6c4 v2.13.0 2017-02-13 17:59:18 +01:00
Peter Taoussanis
ded6cc034f [#91] Add convenience utils for freeze/thaw to/from files
Suggested by @Engelberg (thanks Mark!).

Also seems to be a common question online, e.g.:
http://stackoverflow.com/q/23018870
2017-02-13 17:52:19 +01:00
Peter Taoussanis
ffa4b494b3 Bump deps 2017-02-13 17:00:56 +01:00
Peter Taoussanis
a0ca70c9dc v2.13.0-RC1 2016-12-17 12:15:17 +01:00
Peter Taoussanis
a41c391889 Bump deps 2016-12-17 11:56:46 +01:00
Peter Taoussanis
bc33489dce Bump 1-byte cache count: 5->8 2016-10-28 16:52:05 +07:00
Peter Taoussanis
bc5f045979 Revert experimental semi-auto key caching 2016-10-28 16:37:54 +07:00
Peter Taoussanis
7c8acfe663 Experimental: optional semi-auto key caching 2016-10-28 16:36:04 +07:00
Peter Taoussanis
4aa1a3b871 ns form housekeeping 2016-10-28 10:25:46 +07:00
Peter Taoussanis
56b3f5c365 Update docs for v2.12.2 hotfix 2016-10-17 15:54:53 +07:00