Crypto.Data.AFIS

cryptonite-0.20: Cryptography Primitives sink

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unknown
Safe Haskell | None
Language | Haskell2010

Crypto.Data.AFIS

Description

haskell implementation of the Anti-forensic information splitter available in LUKS. http://clemens.endorphin.org/AFsplitter

The algorithm bloats an arbitrary secret with many bits that are necessary for the recovery of the key (merge), and allow greater way to permanently destroy a key stored on disk.

Synopsis

- split :: (ByteArray ba, HashAlgorithm hash, DRG rng) => hash -> rng -> Int -> ba -> (ba, rng)
- merge :: (ByteArray ba, HashAlgorithm hash) => hash -> Int -> ba -> ba

# Documentation

split #

Arguments

:: (ByteArray ba, HashAlgorithm hash, DRG rng) |
=> hash | Hash algorithm to use as diffuser
-> rng | Random generator to use
-> Int | Number of times to diffuse the data.
-> ba | original data to diffuse.
-> (ba, rng) | The diffused data

Split data to diffused data, using a random generator and an hash algorithm.

the diffused data will consist of random data for (expandTimes-1) then the last block will be xor of the accumulated random data diffused by the hash algorithm.

- ---------
- orig -
- ---------
- --------- ---------- --------------
- rand1 - - rand2 - - orig ^ acc -
- --------- ---------- --------------

where acc is : acc(n+1) = hash (n ++ rand(n)) ^ acc(n)

merge #

Arguments

:: (ByteArray ba, HashAlgorithm hash) |
=> hash | Hash algorithm used as diffuser
-> Int | Number of times to un-diffuse the data
-> ba | Diffused data
-> ba | Original data

Merge previously diffused data back to the original data.