Deniability Utilities

vernamveil.forge_plausible_fx(cypher, cyphertext, decoy_message, max_obfuscate_attempts=1000)

Generates a fake keystream and seed to plausibly decrypt a cyphertext to a decoy message.

This function enables plausible deniability: it lets you demonstrate that an encrypted file could plausibly contain a harmless message, by generating the necessary cryptographic parameters to make the decryption appear valid. The original encryption remains secure, but you can provide a decoy message and matching decryption parameters to anyone demanding access, without revealing the true content.

Return type:

tuple[FX, bytes]

Parameters:
  • cypher (VernamVeil) – The VernamVeil instance used for encryption.

  • cyphertext (bytes or bytearray or memoryview) – The encrypted cyphertext.

  • decoy_message (bytes or bytearray or memoryview) – The decoy message to forge the keystream for.

  • max_obfuscate_attempts (int) – The maximum number of attempts to find a valid obfuscated decoy message. Defaults to 1,000.

Returns:

A tuple containing the plausible fx function and the fake seed.

Return type:

tuple[FX, bytes]

Raises:

ValueError – If the decoy message cannot plausibly fit the cyphertext length given the cypher parameters.