{"slug": "cryptographic-watermarking-for-llm-outputs-with-resk-mark", "title": "Cryptographic Watermarking for LLM Outputs with resk-mark", "summary": "A developer introduced resk-mark, an open-source tool that embeds cryptographic watermarks into LLM-generated text by biasing token sampling with a secret key. The watermark survives rewording and truncation, enabling provenance verification with a public key. The project aims to provide accountable AI deployment through a simple pip install.", "body_md": "Cryptographic Watermarking for LLM Outputs with resk-mark\n\nLinks:\n\n```\n                   __                              __  \n   ________  _____/ /__      ____ ___  ____ ______/ /__\n  / ___/ _ \\/ ___/ //_/_____/ __ `__ \\/ __ `/ ___/ //_/\n / /  /  __(__  ) ,< /_____/ / / / / / /_/ / /  / ,<   \n/_/   \\___/____/_/|_|     /_/ /_/ /_/\\__,_/_/  /_/|_|\n```\n\nEvery company deploying LLMs in production faces the same question: once a model generates text, how do you prove it came from your system?\n\nPrompts like \"say you are an AI\" are trivially removable. Post-hoc detectors are unreliable and adversarial. And once text leaves your system — forwarded, copied, pasted into a ticket — you have zero visibility.\n\nresk-mark solves this by embedding a cryptographic watermark directly into the token generation process. The output reads naturally, but carries a verifiable signature that survives rewording and truncation.\n\nresk-mark hooks into the language model's sampling process. Before generation, the caller provides a secret key. During sampling, the library biases the probability distribution toward tokens that encode that key's signature:\n\n``` python\nfrom reskmark import WatermarkEncoder, verify\n\nencoder = WatermarkEncoder(secret_key=\"your-key-here\")\nmodel = AutoModelForCausalLM.from_pretrained(\"mistralai/Mistral-7B\")\n\n# Wrap the generate call\noutput = encoder.generate(\n    model,\n    \"Explain the concept of zero-knowledge proofs.\",\n    max_length=200,\n)\n\nprint(output)\n# \"Zero-knowledge proofs are a cryptographic method where...\"\n# Reads naturally - watermark is invisible\n\n# Later - verify provenance\nis_authentic, confidence = verify(output, public_key=\"corresponding-pub-key\")\nprint(f\"Authentic: {is_authentic}, confidence: {confidence:.2f}\")\n```\n\nThe AI industry is moving toward provenance standards. Governments are drafting regulations. Enterprises need evidence, not trust.\n\nA tool like resk-mark gives you:\n\n```\npip install reskmark\n```\n\nText watermarking for LLMs is not a nice-to-have. It is the foundation for accountable AI deployment. resk-mark brings it from academic papers into a single pip install.\n\nTry it. Audit the code. Break the watermark. That is how open-source security should work.", "url": "https://wpnews.pro/news/cryptographic-watermarking-for-llm-outputs-with-resk-mark", "canonical_source": "https://dev.to/resk/cryptographic-watermarking-for-llm-outputs-with-resk-mark-14c", "published_at": "2026-07-08 09:55:25+00:00", "updated_at": "2026-07-08 09:58:40.473143+00:00", "lang": "en", "topics": ["large-language-models", "ai-safety", "ai-policy", "ai-tools", "ai-research"], "entities": ["resk-mark", "Mistral-7B", "Mistral AI"], "alternates": {"html": "https://wpnews.pro/news/cryptographic-watermarking-for-llm-outputs-with-resk-mark", "markdown": "https://wpnews.pro/news/cryptographic-watermarking-for-llm-outputs-with-resk-mark.md", "text": "https://wpnews.pro/news/cryptographic-watermarking-for-llm-outputs-with-resk-mark.txt", "jsonld": "https://wpnews.pro/news/cryptographic-watermarking-for-llm-outputs-with-resk-mark.jsonld"}}