HORIZON HASKELLDocslts/ghc-9.14.xb2f3bfd2026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · b2f3bfd · 2026-10-11

Modulecrypton-2.1.7Haskell2010

Crypto.Data.AFIS

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.

  • 4 values
  • Packagecrypton-2.1.7
  • Exports4
  • LanguageHaskell2010
  • LicenceBSD-3-Clause AND MIT AND ISC
  • SourceAFIS.hs
valuesplit
  1. :: (ByteArray ba, HashAlgorithm hash, DRG rng)
  2. => hash

    Hash algorithm to use as diffuser

  3. -> rng

    Random generator to use

  4. -> Int

    Number of times to diffuse the data.

  5. -> ba

    original data to diffuse.

  6. -> (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)

The data has to be at least one byte long and the number of times to diffuse it at least two; anything else raises CryptoError_ParameterInvalid, which trySplit reports as CryptoFailed instead.

valuetrySplit
  1. :: (ByteArray ba, HashAlgorithm hash, DRG rng)
  2. => hash

    Hash algorithm to use as diffuser

  3. -> rng

    Random generator to use

  4. -> Int

    Number of times to diffuse the data.

  5. -> ba

    original data to diffuse.

  6. -> CryptoFailable (ba, rng)

    The diffused data

#

Split data to diffused data, reporting parameters the splitter cannot work with rather than raising.

See split.

valuemerge
  1. :: (ByteArray ba, HashAlgorithm hash)
  2. => hash

    Hash algorithm used as diffuser

  3. -> Int

    Number of times to un-diffuse the data

  4. -> ba

    Diffused data

  5. -> ba

    Original data

#

Merge previously diffused data back to the original data.

The diffused data has to be a non-empty multiple of the number of times it was diffused, and that number at least two -- the same values split accepts. Anything else raises CryptoError_ParameterInvalid, which tryMerge reports as CryptoFailed instead.

valuetryMerge
  1. :: (ByteArray ba, HashAlgorithm hash)
  2. => hash

    Hash algorithm used as diffuser

  3. -> Int

    Number of times to un-diffuse the data

  4. -> ba

    Diffused data

  5. -> CryptoFailable ba

    Original data

#

Merge previously diffused data back to the original data, reporting parameters the merger cannot work with rather than raising.

See merge.