<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Michael Muratov</title><link>https://michaelmuratov.com/categories/security/</link><description>Recent content on Michael Muratov</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Thu, 18 Sep 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://michaelmuratov.com/categories/security/index.xml" rel="self" type="application/rss+xml"/><item><title>Tech Conference Resources</title><link>https://michaelmuratov.com/blog/artifacts/notes/tech-conference-resources/</link><pubDate>Thu, 18 Sep 2025 00:00:00 +0000</pubDate><guid>https://michaelmuratov.com/blog/artifacts/notes/tech-conference-resources/</guid><description>&lt;p&gt;A curated index of conference video archives by track. Channel links go to the full playlists page; year links go directly to a specific event.&lt;/p&gt;
&lt;p&gt;In 2026 the conferences worth your attention are the ones that answer three questions: where is the hardware going, what are attackers actually doing right now, and where are the hyperscalers taking the default infrastructure stack. The most useful sessions increasingly cut across all three. Most major US conferences offer virtual or on-demand passes at 40–50% of the in-person price; keynotes from AWS, Google, and Microsoft are typically free.&lt;/p&gt;</description><content:encoded><![CDATA[<p>A curated index of conference video archives by track. Channel links go to the full playlists page; year links go directly to a specific event.</p>
<p>In 2026 the conferences worth your attention are the ones that answer three questions: where is the hardware going, what are attackers actually doing right now, and where are the hyperscalers taking the default infrastructure stack. The most useful sessions increasingly cut across all three. Most major US conferences offer virtual or on-demand passes at 40–50% of the in-person price; keynotes from AWS, Google, and Microsoft are typically free.</p>
<hr>
<h3 id="ai--tech">AI &amp; Tech</h3>
<p>In 2026, watch GTC for the inference scaling and edge deployment roadmap. Whatever NVIDIA announces there shows up in production tooling 12–18 months later. At Build, I/O, and DevDay, the signal is agent framework maturity: how much of the scaffolding developers are hand-rolling today is getting absorbed into the platform. The academic conferences (NeurIPS, ICML, ICLR) are a longer time horizon and the papers published there become commercial products in two to three years, worth tracking if you want to get ahead of the next capability wave. Note that their year links go to paper listing pages, not video playlists; recorded talks are on SlidesLive or each conference&rsquo;s virtual portal.</p>
<table>
  <thead>
      <tr>
          <th>Channel</th>
          <th>Conference</th>
          <th>Years</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><a href="https://www.youtube.com/@AppleDeveloper/playlists">Apple</a></td>
          <td>WWDC</td>
          <td><a href="https://developer.apple.com/videos/">2020–2025</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@GoogleDevelopers/playlists">Google</a></td>
          <td>Google I/O</td>
          <td><a href="https://www.youtube.com/playlist?list=PLOU2XLYxmsIJEQRQDtuYKVUmxYvRfWN5m">2025</a> · <a href="https://www.youtube.com/playlist?list=PL590L5WQmH8doPo8OufXavO2Qu4ysZjyl">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/channel/UCrhJmfAGQ5K81XQ8_od1iTg/playlists">Microsoft</a></td>
          <td>Build</td>
          <td><a href="https://www.youtube.com/playlist?list=PLlrxD0HtieHgFYS4DKbJ_xCYNE94ZLJjj">2025</a> · <a href="https://www.youtube.com/playlist?list=PLlrxD0HtieHghp_QCcQ2JiTXY3qO9oPDu">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@MetaDevelopers/playlists">Meta</a></td>
          <td>Connect</td>
          <td><a href="https://www.youtube.com/watch?v=EAZe8wDnAOA&amp;list=PLb0IAmt7-GS2cONiFVhtdKWEsyNkF6uUP">2025</a> · <a href="https://www.youtube.com/playlist?list=PLb0IAmt7-GS2bc5R9ZRFLAS78OXU3PJ6p">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@NVIDIADeveloper/playlists">NVIDIA</a></td>
          <td>GTC</td>
          <td><a href="https://www.youtube.com/playlist?list=PLZHnYvH1qtOYKcOvqqLtmfpLntjXc4LqT">2026</a> · <a href="https://www.youtube.com/playlist?list=PL5B692fm6--tCLg1NBPpsFGsIXOGbpVUa">2025</a> · <a href="https://www.youtube.com/playlist?list=PLn3ukorJv4vs_eN9cN8sXg0bq6CkX9lNy">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@OpenAI/playlists">OpenAI</a></td>
          <td>DevDay</td>
          <td><a href="https://www.youtube.com/playlist?list=PLOXw6I10VTv8-mTZk0v7oy1Bxfo3D2K5o">2025</a> · <a href="https://www.youtube.com/playlist?list=PLOXw6I10VTv_o0ZLpFu2IQyQOho1l-v7y">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@BlenderOfficial/featured">Blender</a></td>
          <td>Blender Conference</td>
          <td><a href="https://www.youtube.com/playlist?list=PLa1F2ddGya_8u-HEvmfCVuS_OImW8HaLd">2025</a> · <a href="https://www.youtube.com/playlist?list=PLa1F2ddGya_-Ymw4YlOjqrdQxiRMJql5x">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@NeurIPSConference/playlists">NeurIPS</a></td>
          <td>NeurIPS</td>
          <td><a href="https://slideslive.com/neurips-2025">2025</a> · <a href="https://slideslive.com/neurips-2024">2024</a> · <a href="https://slideslive.com/neurips-2023">2023</a> · <a href="https://slideslive.com/neurips-2022">2022</a> · <a href="https://slideslive.com/neurips-2021">2021</a> · <a href="https://slideslive.com/neurips-2020">2020</a></td>
      </tr>
      <tr>
          <td><a href="https://icml.cc">ICML</a></td>
          <td>ICML</td>
          <td><a href="https://icml.cc/virtual/2025/papers.html">2025</a> · <a href="https://icml.cc/virtual/2024/papers.html">2024</a> · <a href="https://icml.cc/virtual/2023/papers.html">2023</a> · <a href="https://icml.cc/virtual/2022/papers.html">2022</a> · <a href="https://icml.cc/virtual/2021/papers.html">2021</a> · <a href="https://icml.cc/virtual/2020/papers.html">2020</a></td>
      </tr>
      <tr>
          <td><a href="https://iclr.cc">ICLR</a></td>
          <td>ICLR</td>
          <td><a href="https://iclr.cc/virtual/2025/papers.html">2025</a> · <a href="https://iclr.cc/virtual/2024/papers.html">2024</a> · <a href="https://iclr.cc/virtual/2023/papers.html">2023</a> · <a href="https://iclr.cc/virtual/2022/papers.html">2022</a> · <a href="https://iclr.cc/virtual/2021/papers.html">2021</a> · <a href="https://iclr.cc/virtual/2020/papers.html">2020</a></td>
      </tr>
  </tbody>
</table>
<hr>
<h3 id="security">Security</h3>
<p>The sessions most worth your time in 2026 are about what AI is enabling on the offensive side: automated vulnerability discovery, LLM-driven social engineering at scale, and ML-based identity spoofing that bypasses static MFA. The Black Hat Arsenal track is the best early-warning signal showcasing open-source tools that will be repurposed against production systems. If you can&rsquo;t attend in person, the On-Demand pass (~$1,300–$1,800) covers all recorded Briefings about a week post-event. DEF CON has a youtube playlist which is populated after the conference.</p>
<table>
  <thead>
      <tr>
          <th>Channel</th>
          <th>Conference</th>
          <th>Years</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><a href="https://www.youtube.com/@RSAConference/playlists">RSA Conference</a></td>
          <td>RSA Conference</td>
          <td><a href="https://www.youtube.com/playlist?list=PLeUGLKUYzh_j6tll9I__IX6pg4hDZIvSD">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@AWSEventsChannel">AWS</a></td>
          <td>AWS re:Inforce</td>
          <td><a href="https://www.youtube.com/playlist?list=PL2yQDdvlhXf9XkXzO5bXvtMaio6gAcdmN">2025</a> · <a href="https://www.youtube.com/playlist?list=PL2yQDdvlhXf-a63_o1-mAya81ZwuRkmAu">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@BlackHatOfficialYT/playlists">Black Hat</a></td>
          <td>Black Hat USA</td>
          <td><a href="https://www.youtube.com/playlist?list=PLH15HpR5qRsXtV3t9TlkRZBmIfcIC6THE">2025</a> · <a href="https://www.youtube.com/playlist?list=PLH15HpR5qRsUiLYPNSylDvlskvS_RSzee">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@BlackHatOfficialYT/playlists">Black Hat</a></td>
          <td>Black Hat Asia</td>
          <td><a href="https://www.youtube.com/playlist?list=PLH15HpR5qRsWXApxW0vAsRduq9xa3ifCG">2025</a> · <a href="https://www.youtube.com/watch?v=H-7ZNrpsV50&amp;list=PLH15HpR5qRsWJ70J405J7z1GUYPeCBpXy">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@DEFCONConference/videos">DEF CON</a></td>
          <td>DEF CON</td>
          <td><a href="https://www.youtube.com/playlist?list=PL9fPq3eQfaaBB9HANwjaTlKFuVhRxkdz2">2025</a> · <a href="https://www.youtube.com/playlist?list=PLStO1VqVBvmGyghpuCaosPGtrwVy5Fbqi">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@UsenixOrg/playlists">USENIX Security</a></td>
          <td>USENIX Security</td>
          <td><a href="https://www.youtube.com/playlist?list=PLbRoZ5Rrl5ldYBeWL_T1Ei3uefAy1VtNB">2025</a> · <a href="https://www.youtube.com/playlist?list=PLbRoZ5Rrl5ldQ2K_dpmPKHEyRgyf5JSxd">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@SANSInstitute/playlists">SANS Institute</a></td>
          <td>SANS AI Cybersecurity Summit</td>
          <td><a href="https://www.sans.org/cyber-security-training-events/ai-summit-2026">2026</a></td>
      </tr>
  </tbody>
</table>
<hr>
<h3 id="engineering--cloud">Engineering &amp; Cloud</h3>
<p>In 2026 the hyperscaler keynotes are where you calibrate your architecture assumptions, specifically what AWS Bedrock, Google Gemini integrations, and Azure AI are absorbing that developers currently build themselves. The security implications follow directly: whatever gets built into the platform becomes the new baseline that attackers target. The spring window (late April through late May) clusters Google Cloud Next, the SANS AI Summit, and KCD Toronto within roughly six weeks.</p>
<table>
  <thead>
      <tr>
          <th>Channel</th>
          <th>Conference</th>
          <th>Years</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><a href="https://www.youtube.com/@AWSEventsChannel/playlists">AWS</a></td>
          <td>re:Invent</td>
          <td><a href="https://www.youtube.com/playlist?list=PL2yQDdvlhXf9gdFFBcDPUHAJS7kkIkIet">2025</a> · <a href="https://www.youtube.com/playlist?list=PL2yQDdvlhXf_ZsP25dGLTNbrVSphM2JDl">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@googlecloudtech/playlists">Google Cloud</a></td>
          <td>Google Cloud Next</td>
          <td><a href="https://www.youtube.com/playlist?list=PLIivd44G4vL3f30B0dK_Pz1z15J6Yh48H">2025</a> · <a href="https://www.youtube.com/playlist?list=PLIivdWyY5sqLHU6fh9ozZ7mxsj7GcPjRF">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@GitHub/playlists">GitHub</a></td>
          <td>Universe</td>
          <td><a href="https://www.youtube.com/playlist?list=PL0lo9MOBetEFKNlPHNouEmVeYeyoyGTXC">2025</a> · <a href="https://www.youtube.com/playlist?list=PL0lo9MOBetEF_de7yKAWpnMkTsKH6aJ4P">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@DockerInc">Docker</a></td>
          <td>DockerCon</td>
          <td><a href="https://www.youtube.com/playlist?list=PLkA60AVN3hh_t73mQG7RIvvMRTpm1ompt">2023</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@Kubernetesio/playlists">Kubernetes</a></td>
          <td>KubeCon + CloudNativeCon</td>
          <td><a href="https://www.youtube.com/playlist?list=PLj6h78yzYM2Of6psbKjeZxZIHjycSYoYF">2025</a> · <a href="https://www.youtube.com/playlist?list=PLj6h78yzYM2Pw4mRw4S-1p_xLARMqPkA7">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@GOTO-/playlists">GoTo Conference</a></td>
          <td>Top 10</td>
          <td><a href="https://www.youtube.com/playlist?list=PLEx5khR4g7PJ-PseKvyEdYIg3X6xv045b">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@PyConUS/playlists">PyCon US</a></td>
          <td>PyCon US</td>
          <td><a href="https://www.youtube.com/playlist?list=PL2Uw4_HvXqvb98mQjN0-rYQjdDxJ_hcrs">2025</a> · <a href="https://www.youtube.com/playlist?list=PL2Uw4_HvXqvYhjub9bw4uDAmNtprgAvlJ">2024</a> · <a href="https://www.youtube.com/playlist?list=PL2Uw4_HvXqvY2zhJ9AMUa_Z6dtMGF3gtb">2023</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/channel/UCrhJmfAGQ5K81XQ8_od1iTg/playlists">Microsoft</a></td>
          <td>Ignite</td>
          <td><a href="https://www.youtube.com/playlist?list=PLQXpv_NQsPIDXiR9PcpggZ34mzko_-12C">2025</a> · <a href="https://www.youtube.com/playlist?list=PLQXpv_NQsPID0sNvENCDMADnd1M5aOfv4">2024</a></td>
      </tr>
      <tr>
          <td><a href="https://www.youtube.com/@Databricks/playlists">Databricks</a></td>
          <td>Data + AI Summit</td>
          <td><a href="https://www.youtube.com/playlist?list=PLTPXxbhUt-YWjDg318nmSxRqTgZHIghTl">2025</a> · <a href="https://www.youtube.com/playlist?list=PLTPXxbhUt-YWjq4SDFS3_x0-x5KVT5GkQ">2024</a></td>
      </tr>
  </tbody>
</table>
<hr>
<h3 id="canada">Canada</h3>
<p>Toronto-accessible events where the value is physical attendance without international travel overhead. SecTor is the largest local conference for security professionals and a good place to learn about how the global threat landscape maps onto the Canadian companies. NorthSec is where you go to actually build offensive skills: the 2026 curriculum includes dedicated AI security training tracks covering practical attack and defense with ML. Video archives for Canadian events are inconsistent; check the channel links after each event.</p>
<table>
  <thead>
      <tr>
          <th>Channel</th>
          <th>Conference</th>
          <th>Years</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><a href="https://www.youtube.com/@BlackHatOfficialYT/playlists">Black Hat</a></td>
          <td>SecTor</td>
          <td><a href="http://www.2024.video.sector.ca/">2024</a> · <a href="http://www.2023.video.sector.ca/">2023</a> · <a href="http://www.2022.video.sector.ca/">2022</a> · <a href="http://www.2021.video.sector.ca/">2021</a> · <a href="http://www.2020.video.sector.ca/">2020</a></td>
      </tr>
      <tr>
          <td><a href="https://nsec.io/">NorthSec</a></td>
          <td>NorthSec</td>
          <td><a href="https://www.youtube.com/playlist?list=PLuUtcRxSUZUrW9scJZqhbiuTBwZBJ-Qic">2025</a></td>
      </tr>
      <tr>
          <td><a href="https://www.cncf.io/">CNCF</a></td>
          <td>KCD Toronto</td>
          <td><a href="https://www.youtube.com/playlist?list=PLj6h78yzYM2MXCOWSN9CqqID6OOvF7wxL">2026</a></td>
      </tr>
  </tbody>
</table>
]]></content:encoded></item><item><title>Intro to Image Watermarking</title><link>https://michaelmuratov.com/blog/artifacts/guides/intro-image-watermarking/</link><pubDate>Sun, 25 May 2025 00:00:00 +0000</pubDate><guid>https://michaelmuratov.com/blog/artifacts/guides/intro-image-watermarking/</guid><description>&lt;h3 id="intro-to-image-watermarking"&gt;Intro to Image Watermarking&lt;/h3&gt;
&lt;p&gt;Watermarking is a technique used to embed information into an image, which can be used for various purposes such as copyright protection, authentication, or non-repudiation. In this guide, we will explore the basics of image watermarking and how you can implement it in your projects.&lt;/p&gt;
&lt;h4 id="why-use-watermarking"&gt;Why Use Watermarking?&lt;/h4&gt;
&lt;link href="https://michaelmuratov.com/css/admonitions.min.css" rel="stylesheet" /&gt;
&lt;div class="admonition task"&gt;
&lt;div class="admonition-header"&gt;
&lt;svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"&gt;&lt;path d="M152.1 38.2c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 113C-2.3 103.6-2.3 88.4 7 79s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zm0 160c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 273c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zM224 96c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32zM48 368a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"/&gt;&lt;/svg&gt;
&lt;span&gt;Watermarking serves several purposes:&lt;/span&gt;
&lt;/div&gt;
&lt;div class="admonition-content"&gt;
&lt;p&gt;&lt;strong&gt;Copyright protection:&lt;/strong&gt;&lt;br&gt;
Watermarks can help protect your images from unauthorized use by clearly indicating ownership.&lt;/p&gt;</description><content:encoded><![CDATA[<h3 id="intro-to-image-watermarking">Intro to Image Watermarking</h3>
<p>Watermarking is a technique used to embed information into an image, which can be used for various purposes such as copyright protection, authentication, or non-repudiation. In this guide, we will explore the basics of image watermarking and how you can implement it in your projects.</p>
<h4 id="why-use-watermarking">Why Use Watermarking?</h4>


<link href="/css/admonitions.min.css" rel="stylesheet" />
  <div class="admonition task">
    <div class="admonition-header">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M152.1 38.2c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 113C-2.3 103.6-2.3 88.4 7 79s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zm0 160c9.9 8.9 10.7 24 1.8 33.9l-72 80c-4.4 4.9-10.6 7.8-17.2 7.9s-12.9-2.4-17.6-7L7 273c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l22.1 22.1 55.1-61.2c8.9-9.9 24-10.7 33.9-1.8zM224 96c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32l224 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-224 0c-17.7 0-32-14.3-32-32zM160 416c0-17.7 14.3-32 32-32l288 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0c-17.7 0-32-14.3-32-32zM48 368a48 48 0 1 1 0 96 48 48 0 1 1 0-96z"/></svg>
      <span>Watermarking serves several purposes:</span>
    </div>
      <div class="admonition-content">
        <p><strong>Copyright protection:</strong><br>
Watermarks can help protect your images from unauthorized use by clearly indicating ownership.</p>
<p><strong>Authentication:</strong><br>
Watermarks can be used to verify the authenticity of an image, ensuring that it has not been tampered with.</p>
<p><strong>Branding:</strong><br>
Adding a logo or signature to your images can help promote your brand and increase recognition.</p>
<p><strong>Non-repudiation:</strong><br>
Watermarks can provide proof of ownership or authorship, making it difficult for others to deny their use of the image.</p>
      </div>
  </div><h4 id="basic-techniques-for-watermarking">Basic Techniques for Watermarking</h4>
<h5 id="1-visible-watermarking">1. Visible Watermarking</h5>
<p>One of the simplest methods of watermarking is to alter the pixel values of an image. This is usually done for copyright protection or branding purposes. The watermark can be a logo, text, or any other image that is blended with the original image. This type of watermarking is immediately noticeable and can be readily removed by someone with image editing skills, but it serves as a visible deterrent against unauthorized use.</p>

<div><img src="shutterstock_watermark.jpg" 
		 class="img-preset img-preset-md img-fluid" alt="Prompting Flow">
</div>

<h5 id="2-least-significant-bit-lsb-insertion">2. Least Significant Bit (LSB) Insertion</h5>
<p>Least significant bit insertion is a subset of steganography where a hidden message is imbedded into an image to bypass detection. The simplest method involves modifying the least significant bits (LSBs) of pixel values, which allows for a more robust and imperceptible watermark.</p>

<div><img src="lsb.png" 
		 class="img-preset img-preset-md">
</div>

<h5 id="3-frequency-domain-manipulation">3. Frequency Domain Manipulation</h5>
<p>This method involves transforming the image into the frequency domain using techniques like the Discrete Cosine Transform (DCT) or Discrete Wavelet Transform (DWT). Watermarks can then be embedded in the frequency coefficients, which are not visible to the human eye.</p>
<p>These techniques are more complex but provide better security and robustness against attacks such as cropping, resizing, or compression. We will cover the DWT in a more advanced quide.</p>

<div><img src="dwt.png" 
		 class="img-preset img-preset-md img-fluid">

	<figcaption style="margin:0px;" class="figure-caption">
		https://www.intechopen.com/chapters/18615
	</figcaption>
</div>

<h3 id="least-significant-bit-watermarking">Least Significant Bit Watermarking</h3>
<p>To implement the simplest form of invisible watermarking in your images, you can use the cv2 library in Python to read in the image and modify the last bits of each pixel.</p>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="ln"> 1</span><span class="cl"><span class="kn">import</span> <span class="nn">cv2</span>
</span></span><span class="line"><span class="ln"> 2</span><span class="cl">
</span></span><span class="line"><span class="ln"> 3</span><span class="cl"><span class="k">def</span> <span class="nf">embed_lsb</span><span class="p">(</span><span class="n">image_path</span><span class="p">,</span> <span class="n">message</span><span class="p">,</span> <span class="n">output_path</span><span class="p">):</span>
</span></span><span class="line"><span class="ln"> 4</span><span class="cl">    <span class="n">image</span> <span class="o">=</span> <span class="n">cv2</span><span class="o">.</span><span class="n">imread</span><span class="p">(</span><span class="n">image_path</span><span class="p">)</span>
</span></span><span class="line"><span class="ln"> 5</span><span class="cl">    <span class="n">flat</span> <span class="o">=</span> <span class="n">image</span><span class="o">.</span><span class="n">flatten</span><span class="p">()</span>
</span></span><span class="line"><span class="ln"> 6</span><span class="cl">
</span></span><span class="line"><span class="ln"> 7</span><span class="cl">    <span class="c1"># Convert message to binary</span>
</span></span><span class="line"><span class="ln"> 8</span><span class="cl">    <span class="n">bits</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">([</span><span class="nb">format</span><span class="p">(</span><span class="nb">ord</span><span class="p">(</span><span class="n">i</span><span class="p">),</span> <span class="s1">&#39;08b&#39;</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">message</span><span class="p">])</span> <span class="o">+</span> <span class="s1">&#39;00000000&#39;</span>  <span class="c1"># Null terminator</span>
</span></span><span class="line"><span class="ln"> 9</span><span class="cl">    <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">bits</span><span class="p">)):</span>
</span></span><span class="line"><span class="ln">10</span><span class="cl">        <span class="n">flat</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="n">flat</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">&amp;</span> <span class="o">~</span><span class="mi">1</span><span class="p">)</span> <span class="o">|</span> <span class="nb">int</span><span class="p">(</span><span class="n">bits</span><span class="p">[</span><span class="n">i</span><span class="p">])</span>  <span class="c1"># Set LSB</span>
</span></span><span class="line"><span class="ln">11</span><span class="cl">
</span></span><span class="line"><span class="ln">12</span><span class="cl">    <span class="n">watermarked</span> <span class="o">=</span> <span class="n">flat</span><span class="o">.</span><span class="n">reshape</span><span class="p">(</span><span class="n">image</span><span class="o">.</span><span class="n">shape</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">13</span><span class="cl">    <span class="n">cv2</span><span class="o">.</span><span class="n">imwrite</span><span class="p">(</span><span class="n">output_path</span><span class="p">,</span> <span class="n">watermarked</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">14</span><span class="cl">
</span></span><span class="line"><span class="ln">15</span><span class="cl"><span class="k">def</span> <span class="nf">extract_lsb</span><span class="p">(</span><span class="n">image_path</span><span class="p">):</span>
</span></span><span class="line"><span class="ln">16</span><span class="cl">    <span class="c1"># Load image and flatten to 1D array</span>
</span></span><span class="line"><span class="ln">17</span><span class="cl">    <span class="n">image</span> <span class="o">=</span> <span class="n">cv2</span><span class="o">.</span><span class="n">imread</span><span class="p">(</span><span class="n">image_path</span><span class="p">)</span><span class="o">.</span><span class="n">flatten</span><span class="p">()</span>
</span></span><span class="line"><span class="ln">18</span><span class="cl">    <span class="n">bits</span> <span class="o">=</span> <span class="s2">&#34;&#34;</span>
</span></span><span class="line"><span class="ln">19</span><span class="cl">    <span class="k">for</span> <span class="n">byte</span> <span class="ow">in</span> <span class="n">image</span><span class="p">:</span>
</span></span><span class="line"><span class="ln">20</span><span class="cl">        <span class="n">bits</span> <span class="o">+=</span> <span class="nb">str</span><span class="p">(</span><span class="n">byte</span> <span class="o">&amp;</span> <span class="mi">1</span><span class="p">)</span>  <span class="c1"># Get LSB</span>
</span></span><span class="line"><span class="ln">21</span><span class="cl">
</span></span><span class="line"><span class="ln">22</span><span class="cl">        <span class="c1"># Check every 8 bits for null terminator</span>
</span></span><span class="line"><span class="ln">23</span><span class="cl">        <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">bits</span><span class="p">)</span> <span class="o">%</span> <span class="mi">8</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
</span></span><span class="line"><span class="ln">24</span><span class="cl">            <span class="n">char</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="n">bits</span><span class="p">[</span><span class="o">-</span><span class="mi">8</span><span class="p">:],</span> <span class="mi">2</span><span class="p">))</span>
</span></span><span class="line"><span class="ln">25</span><span class="cl">            <span class="k">if</span> <span class="n">char</span> <span class="o">==</span> <span class="s1">&#39;</span><span class="se">\x00</span><span class="s1">&#39;</span><span class="p">:</span>
</span></span><span class="line"><span class="ln">26</span><span class="cl">                <span class="k">break</span>
</span></span><span class="line"><span class="ln">27</span><span class="cl">
</span></span><span class="line"><span class="ln">28</span><span class="cl">    <span class="c1"># Convert full bitstring to characters (excluding null terminator)</span>
</span></span><span class="line"><span class="ln">29</span><span class="cl">    <span class="n">message</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span>
</span></span><span class="line"><span class="ln">30</span><span class="cl">        <span class="nb">chr</span><span class="p">(</span><span class="nb">int</span><span class="p">(</span><span class="n">bits</span><span class="p">[</span><span class="n">i</span><span class="p">:</span><span class="n">i</span><span class="o">+</span><span class="mi">8</span><span class="p">],</span> <span class="mi">2</span><span class="p">))</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">bits</span><span class="p">)</span><span class="o">-</span><span class="mi">8</span><span class="p">,</span> <span class="mi">8</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">31</span><span class="cl">    <span class="p">)</span>
</span></span><span class="line"><span class="ln">32</span><span class="cl">    <span class="k">return</span> <span class="n">message</span>
</span></span><span class="line"><span class="ln">33</span><span class="cl">
</span></span><span class="line"><span class="ln">34</span><span class="cl"><span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s2">&#34;__main__&#34;</span><span class="p">:</span>
</span></span><span class="line"><span class="ln">35</span><span class="cl">
</span></span><span class="line"><span class="ln">36</span><span class="cl">    <span class="c1"># Example usage</span>
</span></span><span class="line"><span class="ln">37</span><span class="cl">    <span class="n">embed_lsb</span><span class="p">(</span><span class="s2">&#34;image.png&#34;</span><span class="p">,</span> <span class="s2">&#34;Secret Watermark&#34;</span><span class="p">,</span> <span class="s2">&#34;output.png&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">38</span><span class="cl">
</span></span><span class="line"><span class="ln">39</span><span class="cl">    <span class="n">message</span> <span class="o">=</span> <span class="n">extract_lsb</span><span class="p">(</span><span class="s2">&#34;image.png&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">40</span><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="s2">&#34;Extracted message:&#34;</span><span class="p">,</span> <span class="n">message</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">41</span><span class="cl">
</span></span><span class="line"><span class="ln">42</span><span class="cl">    <span class="n">message</span> <span class="o">=</span> <span class="n">extract_lsb</span><span class="p">(</span><span class="s2">&#34;output.png&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">43</span><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="s2">&#34;Extracted message:&#34;</span><span class="p">,</span> <span class="n">message</span><span class="p">)</span></span></span></code></pre></div>
<p>The <code>embed_lsb</code> function will take an image, a message, and an output path to save the watermarked image. The <code>extract_lsb</code> function will read the watermarked image and extract the hidden message. There are simpler was of doing this such as using a dedicated steganography library like <code>stegano</code>, but this example shows how you can implement it from scratch.</p>
<h4 id="stegano-code-example">Stegano Code Example</h4>






<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-python" data-lang="python"><span class="line"><span class="ln"> 1</span><span class="cl"><span class="kn">from</span> <span class="nn">stegano</span> <span class="kn">import</span> <span class="n">lsb</span>
</span></span><span class="line"><span class="ln"> 2</span><span class="cl"><span class="k">def</span> <span class="nf">embed_message</span><span class="p">(</span><span class="n">image_path</span><span class="p">,</span> <span class="n">message</span><span class="p">,</span> <span class="n">output_path</span><span class="p">):</span>
</span></span><span class="line"><span class="ln"> 3</span><span class="cl">    <span class="c1"># Embed the message in the image</span>
</span></span><span class="line"><span class="ln"> 4</span><span class="cl">    <span class="n">watermarked_image</span> <span class="o">=</span> <span class="n">lsb</span><span class="o">.</span><span class="n">hide</span><span class="p">(</span><span class="n">image_path</span><span class="p">,</span> <span class="n">message</span><span class="p">)</span>
</span></span><span class="line"><span class="ln"> 5</span><span class="cl">    <span class="n">watermarked_image</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="n">output_path</span><span class="p">)</span>
</span></span><span class="line"><span class="ln"> 6</span><span class="cl">
</span></span><span class="line"><span class="ln"> 7</span><span class="cl"><span class="k">def</span> <span class="nf">extract_message</span><span class="p">(</span><span class="n">image_path</span><span class="p">):</span>
</span></span><span class="line"><span class="ln"> 8</span><span class="cl">    <span class="c1"># Extract the message from the image</span>
</span></span><span class="line"><span class="ln"> 9</span><span class="cl">    <span class="k">return</span> <span class="n">lsb</span><span class="o">.</span><span class="n">reveal</span><span class="p">(</span><span class="n">image_path</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">10</span><span class="cl">
</span></span><span class="line"><span class="ln">11</span><span class="cl"><span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s2">&#34;__main__&#34;</span><span class="p">:</span>
</span></span><span class="line"><span class="ln">12</span><span class="cl">    <span class="n">embed_message</span><span class="p">(</span><span class="s2">&#34;image.png&#34;</span><span class="p">,</span> <span class="s2">&#34;Secret Watermark&#34;</span><span class="p">,</span> <span class="s2">&#34;watermarked_image.png&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">13</span><span class="cl">    <span class="n">message</span> <span class="o">=</span> <span class="n">extract_message</span><span class="p">(</span><span class="s2">&#34;watermarked_image.png&#34;</span><span class="p">)</span>
</span></span><span class="line"><span class="ln">14</span><span class="cl">    <span class="nb">print</span><span class="p">(</span><span class="s2">&#34;Extracted message:&#34;</span><span class="p">,</span> <span class="n">message</span><span class="p">)</span></span></span></code></pre></div>
<p>This is a much simpler way to achieve the same result and it abstracts away the details of how the LSB is manipulated. The <code>stegano</code> library handles the encoding and decoding of messages in images, making it easier to implement watermarking without needing to understand the underlying pixel manipulation. There are also other modules within stegano that allow for more complex watermarking techniques, such as using different color channels or even embedding multiple messages.</p>
<h3 id="watermarking-example">Watermarking Example</h3>







<div style="
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  row-gap: 0px;
  align-items: start;
">
 


<div><img src="portrait.png" 
		 class="img-preset img-preset-md img-fluid">

	<figcaption style="margin:0px;" class="figure-caption">
		Original Image
	</figcaption>
</div>



<div><img src="watermarked_portrait.png" 
		 class="img-preset img-preset-md img-fluid">

	<figcaption style="margin:0px;" class="figure-caption">
		Watermarked Image
	</figcaption>
</div>



</div>

<h3 id="reading-the-watermark">Reading the Watermark</h3>
<p>To read the watermark from an image, you can reverse the process by extracting the pixel values or frequency coefficients where the watermark was embedded. This can be done using similar libraries and techniques as mentioned above.</p>
<h4 id="using-the-extract_lsb-function">Using the <code>extract_lsb</code> function</h4>


<link href="/css/admonitions.min.css" rel="stylesheet" />
  <div class="admonition success">
    <div class="admonition-header">
      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>
      <span>Results</span>
    </div>
      <div class="admonition-content">
        <p><strong>Original Image Text:</strong><br>
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ</p>
<p><strong>Watermarked Image Text:</strong><br>
Secret Watermark</p>
      </div>
  </div>]]></content:encoded></item></channel></rss>