<?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>Secure-Coding on Debimate</title><link>https://debimate.jp/tags/secure-coding/</link><description>Recent content in Secure-Coding on Debimate</description><image><title>Debimate</title><url>https://debimate.jp/images/default-ogp.webp</url><link>https://debimate.jp/images/default-ogp.webp</link></image><generator>Hugo -- 0.166.0</generator><language>ja-JP</language><lastBuildDate>Thu, 12 Nov 2026 10:59:31 +0900</lastBuildDate><atom:link href="https://debimate.jp/tags/secure-coding/index.xml" rel="self" type="application/rss+xml"/><item><title>Side-Channel Attack - 計算にかかった時間から秘密を読む</title><link>https://debimate.jp/notes/security/side-channel-attack/</link><pubDate>Tue, 10 Nov 2026 00:00:00 +0000</pubDate><guid>https://debimate.jp/notes/security/side-channel-attack/</guid><description>&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;if&lt;/span&gt; token &lt;span style="color:#f92672"&gt;==&lt;/span&gt; expected:
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;return&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;ok&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;上記のコードは、受け取ったトークンが正しいかを判定する処理です。返す結果は常に正しく、不一致なら拒否します。しかし、文字列の比較が先頭から 1 文字ずつ進み、違う文字を見つけた所で止まる実装なら、先頭の何文字が一致したかによって応答の時間が変わります。攻撃者は答えを教えてもらえなくても、時間を測れば 1 文字ずつ当てられます。&lt;/p&gt;</description></item></channel></rss>