MyNixOS website logo
Description

Generator and verifier for steganographic numbers.

`stego-uuid` allows one to mark 128-bit UUIDs. If created from a random 64-bit number, the whole 128-bit UUID will look random to everyone, except those who know the secret detection key.

stego-uuid

A generator and verifier for steganographic numbers that look random

The standard use of this package is to generate a 64-bit number and use this, along with a secret key, as input to the marking function.

Example:


secretHi = KeyHi64 12345  -- secret key hi  64 bits
secretLo = KeyLo64 67890  -- secret key low 64 bits

main :: IO ()
main = do

  putStrLn "Is this marked?"
  r  <- randomIO :: IO Word64           -- get 64-bit random number
  let x = mark secretHi secretLo r      -- produce marked 128-bit UUID
  print x                               
  print (isMarked secretHi secretLo x)  -- True

Security considerations

This is a poor man's MAC. We use SHA256 to generate the second half of the UUID from the 64-bit random looking input and the secret key. The small number of bits limits the security.

We will start getting collisions on the 64-bit random number after about 2^32 numbers are used. But this just means we will be providing the function with the same input, so the same output will be produced.

False Negatives

This is zero. If you produced the number with the mark function, this number will always be detected with isMarked as long as you provide the correct key.

False positives

This is false detection. We worry about a UUID that was not generated using mark but is detected as marked by isMarked. (A malicious adversary can always replay any UUIDs known as marked. Thus, we will consider only new UUIDs.)

Assuming SHA256 is a perfect pseudo-random function, its truncated output, i.e. the last 64 bits of the UUID, does not leak any information about the secret key. Given a fixed secret key, for any 64-bit input (corresponding to the the first half of the UUID), there is a unique 64-bit output (corresponding to the second half of the UUID). There is only one such output per 64-bit input. So, the probability of finding such input from a random draw is 2^(-64). The adversary would have more than a 1/2 chance of finding it after 2^63 guesses.

Information leakage

The adversary can only know a UUID is marked if it is able to differentiate the output of truncated SHA256 from a pseudo-random function. I am unaware of any significant results in doing so. The key is 128-bits in length, so going through all possible values is currently unfeasible.

Metadata

Version

1.0.0.0

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows