<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Gea-Suan Lin&#039;s BLOG &#187; Network</title> <atom:link href="http://blog.gslin.org/archives/category/computer/network/feed/" rel="self" type="application/rss+xml" /><link>http://blog.gslin.org</link> <description>幹壞事是進步最大的原動力</description> <lastBuildDate>Sat, 11 Feb 2012 22:15:31 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/><cloud
domain='blog.gslin.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' /> <item><title>換回 Firefox&#8230;</title><link>http://blog.gslin.org/archives/2012/02/12/2824/%e6%8f%9b%e5%9b%9e-firefox/</link> <comments>http://blog.gslin.org/archives/2012/02/12/2824/%e6%8f%9b%e5%9b%9e-firefox/#comments</comments> <pubDate>Sat, 11 Feb 2012 22:15:31 +0000</pubDate> <dc:creator>Gea-Suan Lin</dc:creator> <category><![CDATA[Browser]]></category> <category><![CDATA[Computer]]></category> <category><![CDATA[Firefox]]></category> <category><![CDATA[GoogleChrome]]></category> <category><![CDATA[Murmuring]]></category> <category><![CDATA[Network]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[WWW]]></category> <category><![CDATA[chrome]]></category> <category><![CDATA[firefox]]></category> <category><![CDATA[google]]></category><guid
isPermaLink="false">http://blog.gslin.org/?p=2824</guid> <description><![CDATA[Tweet 用 Google Chrome 用一陣子了，回頭來看看 Firefox 發展的如何&#8230; 在 Location bar 輸入網址還是鈍鈍的問題還是沒解，不過很明顯感覺速度跟 Chrome 差不多了&#8230; 裝了一卡車套件，用一陣子看看吧 :o]]></description> <content:encoded><![CDATA[<div
class="bottomcontainerBox" style=""><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <iframe
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.gslin.org%2Farchives%2F2012%2F02%2F12%2F2824%2F%25e6%258f%259b%25e5%259b%259e-firefox%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div><div
style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <g:plusone size="medium" href="http://blog.gslin.org/archives/2012/02/12/2824/%e6%8f%9b%e5%9b%9e-firefox/"></g:plusone></div><div
style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <a
href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.gslin.org/archives/2012/02/12/2824/%e6%8f%9b%e5%9b%9e-firefox/"  data-text="換回 Firefox&#8230;" data-count="horizontal" data-via="gslin">Tweet</a></div></div><div
style="clear:both"></div><div
style="padding-bottom:4px;"></div><p>用 <a
href="http://www.google.com/chrome">Google Chrome</a> 用一陣子了，回頭來看看 <a
href="http://www.mozilla.com/firefox/">Firefox</a> 發展的如何&#8230; 在 Location bar 輸入網址還是鈍鈍的問題還是沒解，不過很明顯感覺速度跟 Chrome 差不多了&#8230;</p><p>裝了一卡車套件，用一陣子看看吧 :o</p> ]]></content:encoded> <wfw:commentRss>http://blog.gslin.org/archives/2012/02/12/2824/%e6%8f%9b%e5%9b%9e-firefox/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Google Chrome Extension 內攔截所有的 url request&#8230;</title><link>http://blog.gslin.org/archives/2012/02/08/2821/google-chrome-extension-%e5%85%a7%e6%94%94%e6%88%aa%e6%89%80%e6%9c%89%e7%9a%84-url-request/</link> <comments>http://blog.gslin.org/archives/2012/02/08/2821/google-chrome-extension-%e5%85%a7%e6%94%94%e6%88%aa%e6%89%80%e6%9c%89%e7%9a%84-url-request/#comments</comments> <pubDate>Wed, 08 Feb 2012 03:43:43 +0000</pubDate> <dc:creator>Gea-Suan Lin</dc:creator> <category><![CDATA[Browser]]></category> <category><![CDATA[Computer]]></category> <category><![CDATA[GoogleChrome]]></category> <category><![CDATA[Murmuring]]></category> <category><![CDATA[Network]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[WWW]]></category> <category><![CDATA[chrome]]></category> <category><![CDATA[extension]]></category> <category><![CDATA[google]]></category> <category><![CDATA[referer]]></category><guid
isPermaLink="false">http://blog.gslin.org/?p=2821</guid> <description><![CDATA[Tweet 之前寫了一個處理 Referer header 的 extension，使用 chrome.experimental.webRequest.onBeforeSendHeaders.addListener 攔截所有的 url 然後處理 Referer header。 之前只需要在 manifest.json 裡面加上 experimental 就可以使用，但是前陣子發現失效。剛剛在「onBeforeSendHeaders listeners aren&#8217;t triggering」這個 issue 裡面找到解法：現在需要多加上 &#60;all_urls&#62; 這組權限。]]></description> <content:encoded><![CDATA[<div
class="bottomcontainerBox" style=""><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <iframe
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.gslin.org%2Farchives%2F2012%2F02%2F08%2F2821%2Fgoogle-chrome-extension-%25e5%2585%25a7%25e6%2594%2594%25e6%2588%25aa%25e6%2589%2580%25e6%259c%2589%25e7%259a%2584-url-request%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div><div
style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <g:plusone size="medium" href="http://blog.gslin.org/archives/2012/02/08/2821/google-chrome-extension-%e5%85%a7%e6%94%94%e6%88%aa%e6%89%80%e6%9c%89%e7%9a%84-url-request/"></g:plusone></div><div
style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <a
href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.gslin.org/archives/2012/02/08/2821/google-chrome-extension-%e5%85%a7%e6%94%94%e6%88%aa%e6%89%80%e6%9c%89%e7%9a%84-url-request/"  data-text="Google Chrome Extension 內攔截所有的 url request&#8230;" data-count="horizontal" data-via="gslin">Tweet</a></div></div><div
style="clear:both"></div><div
style="padding-bottom:4px;"></div><p>之前寫了一個處理 <code>Referer</code> header 的 extension，使用 <code>chrome.experimental.webRequest.onBeforeSendHeaders.addListener</code> 攔截所有的 url 然後處理 <code>Referer</code> header。</p><p>之前只需要在 <code>manifest.json</code> 裡面加上 <code>experimental</code> 就可以使用，但是前陣子發現失效。剛剛在「<a
href="https://code.google.com/p/chromium/issues/detail?id=101275">onBeforeSendHeaders listeners aren&#8217;t triggering</a>」這個 issue 裡面找到解法：現在需要多加上 <code>&lt;all_urls&gt;</code> 這組權限。</p> ]]></content:encoded> <wfw:commentRss>http://blog.gslin.org/archives/2012/02/08/2821/google-chrome-extension-%e5%85%a7%e6%94%94%e6%88%aa%e6%89%80%e6%9c%89%e7%9a%84-url-request/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>The Pirate Bay (海盜灣) 從 Torrent 檔下載換成 Magnet URI (磁力連結)</title><link>http://blog.gslin.org/archives/2012/01/15/2815/the-pirate-bay-%e6%b5%b7%e7%9b%9c%e7%81%a3-%e5%be%9e-torrent-%e6%aa%94%e4%b8%8b%e8%bc%89%e6%8f%9b%e6%88%90-magnet-uri-%e7%a3%81%e5%8a%9b%e9%80%a3%e7%b5%90/</link> <comments>http://blog.gslin.org/archives/2012/01/15/2815/the-pirate-bay-%e6%b5%b7%e7%9b%9c%e7%81%a3-%e5%be%9e-torrent-%e6%aa%94%e4%b8%8b%e8%bc%89%e6%8f%9b%e6%88%90-magnet-uri-%e7%a3%81%e5%8a%9b%e9%80%a3%e7%b5%90/#comments</comments> <pubDate>Sun, 15 Jan 2012 12:42:44 +0000</pubDate> <dc:creator>Gea-Suan Lin</dc:creator> <category><![CDATA[Computer]]></category> <category><![CDATA[Murmuring]]></category> <category><![CDATA[Network]]></category> <category><![CDATA[P2P]]></category> <category><![CDATA[WWW]]></category> <category><![CDATA[bay]]></category> <category><![CDATA[link]]></category> <category><![CDATA[magnet]]></category> <category><![CDATA[p2p]]></category> <category><![CDATA[pirate]]></category> <category><![CDATA[the]]></category> <category><![CDATA[thepiratebay]]></category><guid
isPermaLink="false">http://blog.gslin.org/?p=2815</guid> <description><![CDATA[Tweet The Pirate Bay 將把 torrent 檔下載方式換成磁力連結：「The Pirate Bay Will Stop Serving Torrents」。 Magnet URI 下載 BitTorrent 檔案其實只是多了一個抓 torrent 檔的步驟：首先先從 Magnet URI 內取得 SHA1 值，然後透過 DHT 抓到 torrent 檔的 metadata，然後後面就可以照舊進行&#8230; 至於 DHT 的初次建立，除了可以透過中央式的 router.utorrent.com 取得外，也可以透過其他 torrent 檔案下載所提供的 tracker 找到節點。在取得一批節點後，透過 PEX &#8230; <a
href="http://blog.gslin.org/archives/2012/01/15/2815/the-pirate-bay-%e6%b5%b7%e7%9b%9c%e7%81%a3-%e5%be%9e-torrent-%e6%aa%94%e4%b8%8b%e8%bc%89%e6%8f%9b%e6%88%90-magnet-uri-%e7%a3%81%e5%8a%9b%e9%80%a3%e7%b5%90/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<div
class="bottomcontainerBox" style=""><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <iframe
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.gslin.org%2Farchives%2F2012%2F01%2F15%2F2815%2Fthe-pirate-bay-%25e6%25b5%25b7%25e7%259b%259c%25e7%2581%25a3-%25e5%25be%259e-torrent-%25e6%25aa%2594%25e4%25b8%258b%25e8%25bc%2589%25e6%258f%259b%25e6%2588%2590-magnet-uri-%25e7%25a3%2581%25e5%258a%259b%25e9%2580%25a3%25e7%25b5%2590%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div><div
style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <g:plusone size="medium" href="http://blog.gslin.org/archives/2012/01/15/2815/the-pirate-bay-%e6%b5%b7%e7%9b%9c%e7%81%a3-%e5%be%9e-torrent-%e6%aa%94%e4%b8%8b%e8%bc%89%e6%8f%9b%e6%88%90-magnet-uri-%e7%a3%81%e5%8a%9b%e9%80%a3%e7%b5%90/"></g:plusone></div><div
style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <a
href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.gslin.org/archives/2012/01/15/2815/the-pirate-bay-%e6%b5%b7%e7%9b%9c%e7%81%a3-%e5%be%9e-torrent-%e6%aa%94%e4%b8%8b%e8%bc%89%e6%8f%9b%e6%88%90-magnet-uri-%e7%a3%81%e5%8a%9b%e9%80%a3%e7%b5%90/"  data-text="The Pirate Bay (海盜灣) 從 Torrent 檔下載換成 Magnet URI (磁力連結)" data-count="horizontal" data-via="gslin">Tweet</a></div></div><div
style="clear:both"></div><div
style="padding-bottom:4px;"></div><p><a
href="https://thepiratebay.org/">The Pirate Bay</a> 將把 torrent 檔下載方式換成磁力連結：「<a
href="http://torrentfreak.com/the-pirate-bay-will-stop-serving-torrents-120112/">The Pirate Bay Will Stop Serving Torrents</a>」。</p><p><a
href="https://zh.wikipedia.org/wiki/%E7%A3%81%E5%8A%9B%E9%93%BE%E6%8E%A5">Magnet URI</a> 下載 <a
href="http://www.bittorrent.org/">BitTorrent</a> 檔案其實只是多了一個抓 torrent 檔的步驟：首先先從 Magnet URI 內取得 SHA1 值，然後透過 <a
href="https://zh.wikipedia.org/wiki/%E5%88%86%E6%95%A3%E5%BC%8F%E9%9B%9C%E6%B9%8A%E8%A1%A8">DHT</a> 抓到 torrent 檔的 metadata，然後後面就可以照舊進行&#8230; 至於 DHT 的初次建立，除了可以透過中央式的 <code>router.utorrent.com</code> 取得外，也可以透過其他 torrent 檔案下載所提供的 tracker 找到節點。在取得一批節點後，透過 <a
href="https://en.wikipedia.org/wiki/Peer_exchange">PEX</a> 交換出更多的節點。</p><p>DHT + PEX 的技術逐漸成熟 (愈來愈多程式支援)，然後是最大的 torrent site 採用。之後的 public torrent site 應該都會改朝這個方向走&#8230;</p> ]]></content:encoded> <wfw:commentRss>http://blog.gslin.org/archives/2012/01/15/2815/the-pirate-bay-%e6%b5%b7%e7%9b%9c%e7%81%a3-%e5%be%9e-torrent-%e6%aa%94%e4%b8%8b%e8%bc%89%e6%8f%9b%e6%88%90-magnet-uri-%e7%a3%81%e5%8a%9b%e9%80%a3%e7%b5%90/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>儲存密碼的方式</title><link>http://blog.gslin.org/archives/2012/01/09/2814/%e5%84%b2%e5%ad%98%e5%af%86%e7%a2%bc%e7%9a%84%e6%96%b9%e5%bc%8f/</link> <comments>http://blog.gslin.org/archives/2012/01/09/2814/%e5%84%b2%e5%ad%98%e5%af%86%e7%a2%bc%e7%9a%84%e6%96%b9%e5%bc%8f/#comments</comments> <pubDate>Mon, 09 Jan 2012 14:08:02 +0000</pubDate> <dc:creator>Gea-Suan Lin</dc:creator> <category><![CDATA[Computer]]></category> <category><![CDATA[Murmuring]]></category> <category><![CDATA[Network]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[crypto]]></category> <category><![CDATA[hash]]></category> <category><![CDATA[key]]></category> <category><![CDATA[password]]></category> <category><![CDATA[plaintext]]></category> <category><![CDATA[security]]></category><guid
isPermaLink="false">http://blog.gslin.org/?p=2814</guid> <description><![CDATA[Tweet 主要是參考「Cryptographic Right Answers」這篇給的建議： Password handling: As soon as you receive a password, hash it using scrypt or PBKDF2 and erase the plaintext password from memory. Do NOT store users&#8217; passwords. Do NOT hash them with MD5. Use a real &#8230; <a
href="http://blog.gslin.org/archives/2012/01/09/2814/%e5%84%b2%e5%ad%98%e5%af%86%e7%a2%bc%e7%9a%84%e6%96%b9%e5%bc%8f/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<div
class="bottomcontainerBox" style=""><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <iframe
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.gslin.org%2Farchives%2F2012%2F01%2F09%2F2814%2F%25e5%2584%25b2%25e5%25ad%2598%25e5%25af%2586%25e7%25a2%25bc%25e7%259a%2584%25e6%2596%25b9%25e5%25bc%258f%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div><div
style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <g:plusone size="medium" href="http://blog.gslin.org/archives/2012/01/09/2814/%e5%84%b2%e5%ad%98%e5%af%86%e7%a2%bc%e7%9a%84%e6%96%b9%e5%bc%8f/"></g:plusone></div><div
style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <a
href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.gslin.org/archives/2012/01/09/2814/%e5%84%b2%e5%ad%98%e5%af%86%e7%a2%bc%e7%9a%84%e6%96%b9%e5%bc%8f/"  data-text="儲存密碼的方式" data-count="horizontal" data-via="gslin">Tweet</a></div></div><div
style="clear:both"></div><div
style="padding-bottom:4px;"></div><p>主要是參考「<a
href="http://www.daemonology.net/blog/2009-06-11-cryptographic-right-answers.html">Cryptographic Right Answers</a>」這篇給的建議：</p><blockquote><p>Password handling: As soon as you receive a password, hash it using scrypt or PBKDF2 and erase the plaintext password from memory.<br
/> Do NOT store users&#8217; passwords. Do NOT hash them with MD5. Use a real key derivation algorithm. PBKDF2 is the most official standard; but scrypt is stronger.<br
/> Please keep in mind that even if YOUR application isn&#8217;t particularly sensitive, your users are probably re-using passwords which they have used on other, more sensitive, websites &#8212; so if you screw up how you store your users&#8217; passwords, you might end up doing them a lot of harm.</p></blockquote><p>其中 scrypt 是作者自己發展的演算法，這邊看看就好。</p><p>你可以用 <a
href="https://en.wikipedia.org/wiki/PBKDF2">PBKDF2</a> (<a
href="https://tools.ietf.org/html/rfc2898">RFC 2898</a>)。這邊假設的前提是，你不需要常常重複計算使用者的密碼是否正確。在這個前提下，我們可以把演算法弄得很複雜，而且很耗時，要複雜到用硬體加速也無法產生實質上有效的攻擊。</p><p>如果你對密碼學這個領域並不熟，<a
href="http://www.daemonology.net/">Colin Percival</a> 這篇文章可以拿來當做起點，文章裡面告訴你，某些類型的問題會用某些工具解決。</p> ]]></content:encoded> <wfw:commentRss>http://blog.gslin.org/archives/2012/01/09/2814/%e5%84%b2%e5%ad%98%e5%af%86%e7%a2%bc%e7%9a%84%e6%96%b9%e5%bc%8f/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>自己編 rTorrent 與 libTorrent&#8230;</title><link>http://blog.gslin.org/archives/2012/01/08/2813/%e8%87%aa%e5%b7%b1%e7%b7%a8-rtorrent-%e8%88%87-libtorrent/</link> <comments>http://blog.gslin.org/archives/2012/01/08/2813/%e8%87%aa%e5%b7%b1%e7%b7%a8-rtorrent-%e8%88%87-libtorrent/#comments</comments> <pubDate>Sat, 07 Jan 2012 17:46:16 +0000</pubDate> <dc:creator>Gea-Suan Lin</dc:creator> <category><![CDATA[Computer]]></category> <category><![CDATA[Linux]]></category> <category><![CDATA[Murmuring]]></category> <category><![CDATA[Network]]></category> <category><![CDATA[OS]]></category> <category><![CDATA[P2P]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[libtorrent]]></category> <category><![CDATA[rtorrent]]></category> <category><![CDATA[ubuntu]]></category><guid
isPermaLink="false">http://blog.gslin.org/?p=2813</guid> <description><![CDATA[Tweet Ubuntu 提供的 rTorrent 比較舊，11.04 上面只有 0.8.6 可以用，11.10 則是 0.8.7。目前最新的 stable 是 0.8.9，有支援 magnet uri&#8230; 找了 launchpad 上面有沒有人做，看起來是沒有 :/ 因為不想影響到系統舊版的 libTorrent 與 rTorrent，所以裝在自己的 home directory 下。 先安裝 libTorrent，用 ./configure --prefix=/home/gslin/foo 之後用 make 編完後 make install 就可以了，有缺軟體的部份會跳訊息出來，用 apt-get 補上 -dev 版本後再繼續安裝。 &#8230; <a
href="http://blog.gslin.org/archives/2012/01/08/2813/%e8%87%aa%e5%b7%b1%e7%b7%a8-rtorrent-%e8%88%87-libtorrent/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<div
class="bottomcontainerBox" style=""><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <iframe
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.gslin.org%2Farchives%2F2012%2F01%2F08%2F2813%2F%25e8%2587%25aa%25e5%25b7%25b1%25e7%25b7%25a8-rtorrent-%25e8%2588%2587-libtorrent%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div><div
style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <g:plusone size="medium" href="http://blog.gslin.org/archives/2012/01/08/2813/%e8%87%aa%e5%b7%b1%e7%b7%a8-rtorrent-%e8%88%87-libtorrent/"></g:plusone></div><div
style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <a
href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.gslin.org/archives/2012/01/08/2813/%e8%87%aa%e5%b7%b1%e7%b7%a8-rtorrent-%e8%88%87-libtorrent/"  data-text="自己編 rTorrent 與 libTorrent&#8230;" data-count="horizontal" data-via="gslin">Tweet</a></div></div><div
style="clear:both"></div><div
style="padding-bottom:4px;"></div><p><a
href="http://www.ubuntu.com/">Ubuntu</a> 提供的 <a
href="http://libtorrent.rakshasa.no/">rTorrent</a> 比較舊，11.04 上面只有 0.8.6 可以用，11.10 則是 0.8.7。目前最新的 stable 是 0.8.9，有支援 magnet uri&#8230; 找了 launchpad 上面有沒有人做，看起來是沒有 :/</p><p>因為不想影響到系統舊版的 libTorrent 與 rTorrent，所以裝在自己的 home directory 下。</p><p>先安裝 libTorrent，用 <code>./configure --prefix=/home/gslin/foo</code> 之後用 <code>make</code> 編完後 <code>make install</code> 就可以了，有缺軟體的部份會跳訊息出來，用 apt-get 補上 -dev 版本後再繼續安裝。</p><p>再來是 rTorrent，首先要注意的是要裝 libncursesw5-dev，也就是有 wide character support 的版本，不然顯示 UTF-8 會有問題 (實際在磁碟上的檔名不會有問題，但顯示會有問題)，接著用 <code>libtorrent_CFLAGS="-I/home/gslin/foo/include" libtorrent_LIBS="-L/home/gslin/foo/lib -ltorrent" ./configure --prefix=/home/gslin/foo</code> 指定 libtrorrent 所在位置，然後用 <code>make</code> 編完後 <code>make install</code>。</p><p>接下來用 <code>~/foo/rtorrent</code> 執行，應該就會是新版的 rTorrent 了&#8230;</p> ]]></content:encoded> <wfw:commentRss>http://blog.gslin.org/archives/2012/01/08/2813/%e8%87%aa%e5%b7%b1%e7%b7%a8-rtorrent-%e8%88%87-libtorrent/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>請更新 HP 印表機的韌體&#8230;</title><link>http://blog.gslin.org/archives/2012/01/07/2811/%e8%ab%8b%e6%9b%b4%e6%96%b0-hp-%e5%8d%b0%e8%a1%a8%e6%a9%9f%e7%9a%84%e9%9f%8c%e9%ab%94/</link> <comments>http://blog.gslin.org/archives/2012/01/07/2811/%e8%ab%8b%e6%9b%b4%e6%96%b0-hp-%e5%8d%b0%e8%a1%a8%e6%a9%9f%e7%9a%84%e9%9f%8c%e9%ab%94/#comments</comments> <pubDate>Sat, 07 Jan 2012 15:08:06 +0000</pubDate> <dc:creator>Gea-Suan Lin</dc:creator> <category><![CDATA[Computer]]></category> <category><![CDATA[Hardware]]></category> <category><![CDATA[Murmuring]]></category> <category><![CDATA[Network]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[exploit]]></category> <category><![CDATA[firmware]]></category> <category><![CDATA[hp]]></category> <category><![CDATA[printer]]></category> <category><![CDATA[remote]]></category> <category><![CDATA[security]]></category><guid
isPermaLink="false">http://blog.gslin.org/?p=2811</guid> <description><![CDATA[Tweet HP 發了安全通告「HPSBPI02728 SSRT100692 rev.2 &#8211; Certain HP Printers and HP Digital Senders, Remote Firmware Update Enabled by Default」，在安全通告內列出的印表機都有安全問題，「允許遠端安裝未經授權的印表機韌體」，攻擊者可以遠端直接安裝有木馬的韌體： A potential security vulnerability has been identified with certain HP printers and HP digital senders. The vulnerability could be exploited remotely &#8230; <a
href="http://blog.gslin.org/archives/2012/01/07/2811/%e8%ab%8b%e6%9b%b4%e6%96%b0-hp-%e5%8d%b0%e8%a1%a8%e6%a9%9f%e7%9a%84%e9%9f%8c%e9%ab%94/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<div
class="bottomcontainerBox" style=""><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <iframe
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.gslin.org%2Farchives%2F2012%2F01%2F07%2F2811%2F%25e8%25ab%258b%25e6%259b%25b4%25e6%2596%25b0-hp-%25e5%258d%25b0%25e8%25a1%25a8%25e6%25a9%259f%25e7%259a%2584%25e9%259f%258c%25e9%25ab%2594%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div><div
style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <g:plusone size="medium" href="http://blog.gslin.org/archives/2012/01/07/2811/%e8%ab%8b%e6%9b%b4%e6%96%b0-hp-%e5%8d%b0%e8%a1%a8%e6%a9%9f%e7%9a%84%e9%9f%8c%e9%ab%94/"></g:plusone></div><div
style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <a
href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.gslin.org/archives/2012/01/07/2811/%e8%ab%8b%e6%9b%b4%e6%96%b0-hp-%e5%8d%b0%e8%a1%a8%e6%a9%9f%e7%9a%84%e9%9f%8c%e9%ab%94/"  data-text="請更新 HP 印表機的韌體&#8230;" data-count="horizontal" data-via="gslin">Tweet</a></div></div><div
style="clear:both"></div><div
style="padding-bottom:4px;"></div><p><a
href="http://www.hp.com/">HP</a> 發了安全通告「<a
href="http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?objectID=c03102449&#038;jumpid=em_alerts_us-us_Dec11_xbu_all_all_1514802_101529_printersandmultifunctionscanners-copiers-faxes_critical_000_0">HPSBPI02728 SSRT100692 rev.2 &#8211; Certain HP Printers and HP Digital Senders, Remote Firmware Update Enabled by Default</a>」，在安全通告內列出的印表機都有安全問題，「允許遠端安裝未經授權的印表機韌體」，攻擊者可以遠端直接安裝有木馬的韌體：</p><blockquote><p>A potential security vulnerability has been identified with certain HP printers and HP digital senders. The vulnerability could be exploited remotely to install unauthorized printer firmware.</p></blockquote><p>另外可以參考 <a
href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-4161">CVE-2011-4161</a> 的說明：</p><blockquote><p>The default configuration of the HP CM8060 Color MFP with Edgeline; Color LaserJet 3xxx, 4xxx, 5550, 9500, CMxxxx, CPxxxx, and Enterprise CPxxxx; Digital Sender 9200c and 9250c; LaserJet 4xxx, 5200, 90xx, Mxxxx, and Pxxxx; and LaserJet Enterprise 500 color M551, 600, M4555 MFP, and P3015 enables the Remote Firmware Update (RFU) setting, which allows remote attackers to execute arbitrary code by using a session on TCP port 9100 to upload a crafted firmware update.</p></blockquote><p>能更新的就想辦法更新吧，無法更新的看看有沒有辦法處理 port 9100&#8230;</p> ]]></content:encoded> <wfw:commentRss>http://blog.gslin.org/archives/2012/01/07/2811/%e8%ab%8b%e6%9b%b4%e6%96%b0-hp-%e5%8d%b0%e8%a1%a8%e6%a9%9f%e7%9a%84%e9%9f%8c%e9%ab%94/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Akamai 買下 Cotendo&#8230;</title><link>http://blog.gslin.org/archives/2011/12/22/2810/akamai-%e8%b2%b7%e4%b8%8b-cotendo/</link> <comments>http://blog.gslin.org/archives/2011/12/22/2810/akamai-%e8%b2%b7%e4%b8%8b-cotendo/#comments</comments> <pubDate>Thu, 22 Dec 2011 13:23:56 +0000</pubDate> <dc:creator>Gea-Suan Lin</dc:creator> <category><![CDATA[CDN]]></category> <category><![CDATA[Computer]]></category> <category><![CDATA[Murmuring]]></category> <category><![CDATA[Network]]></category> <category><![CDATA[WWW]]></category> <category><![CDATA[akamai]]></category> <category><![CDATA[cdn]]></category> <category><![CDATA[cotendo]]></category><guid
isPermaLink="false">http://blog.gslin.org/?p=2810</guid> <description><![CDATA[Tweet Akaiami 的新聞稿先出來了：「December 22, 2011 &#8211; Akamai to Acquire Cotendo」，Cotendo 的只有在 Twitter 上看到官方帳號提到 Akamai 的新聞稿。 併購的金額在： Under terms of the agreement, Akamai will acquire all of the outstanding equity of Cotendo in exchange for a net cash payment of approximately &#8230; <a
href="http://blog.gslin.org/archives/2011/12/22/2810/akamai-%e8%b2%b7%e4%b8%8b-cotendo/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<div
class="bottomcontainerBox" style=""><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <iframe
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.gslin.org%2Farchives%2F2011%2F12%2F22%2F2810%2Fakamai-%25e8%25b2%25b7%25e4%25b8%258b-cotendo%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div><div
style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <g:plusone size="medium" href="http://blog.gslin.org/archives/2011/12/22/2810/akamai-%e8%b2%b7%e4%b8%8b-cotendo/"></g:plusone></div><div
style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <a
href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.gslin.org/archives/2011/12/22/2810/akamai-%e8%b2%b7%e4%b8%8b-cotendo/"  data-text="Akamai 買下 Cotendo&#8230;" data-count="horizontal" data-via="gslin">Tweet</a></div></div><div
style="clear:both"></div><div
style="padding-bottom:4px;"></div><p><a
href="http://www.akamai.com/">Akaiami</a> 的新聞稿先出來了：「<a
href="http://www.akamai.com/html/about/press/releases/2011/press_122211.html">December 22, 2011 &#8211; Akamai to Acquire Cotendo</a>」，<a
href="http://www.cotendo.com/">Cotendo</a> 的只有在 <a
href="http://twitter.com/">Twitter</a> 上看到官方帳號提到 Akamai 的新聞稿。</p><p>併購的金額在：</p><blockquote><p>Under terms of the agreement, Akamai will acquire all of the outstanding equity of Cotendo in exchange for a net cash payment of approximately $268 million</p></blockquote><p>上個月月底的時候就有消息了：「<a
href="http://techcrunch.com/2011/11/27/akamai-cotendo/">Akamai Reportedly Buying Rival Cotendo For Up To $350 Million</a>」，不過一直都是謠傳而已&#8230;</p><p>Cotendo 的產品在 Akamai 裡面都有對應的產品，這次併購看起來比較像是減少競爭對手，或是買專利&#8230;</p> ]]></content:encoded> <wfw:commentRss>http://blog.gslin.org/archives/2011/12/22/2810/akamai-%e8%b2%b7%e4%b8%8b-cotendo/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>把 Google Plus 的數字 icon 藏起來&#8230;</title><link>http://blog.gslin.org/archives/2011/12/21/2808/%e6%8a%8a-google-plus-%e7%9a%84%e6%95%b8%e5%ad%97-icon-%e8%97%8f%e8%b5%b7%e4%be%86/</link> <comments>http://blog.gslin.org/archives/2011/12/21/2808/%e6%8a%8a-google-plus-%e7%9a%84%e6%95%b8%e5%ad%97-icon-%e8%97%8f%e8%b5%b7%e4%be%86/#comments</comments> <pubDate>Wed, 21 Dec 2011 14:56:31 +0000</pubDate> <dc:creator>Gea-Suan Lin</dc:creator> <category><![CDATA[Browser]]></category> <category><![CDATA[Computer]]></category> <category><![CDATA[Firefox]]></category> <category><![CDATA[GoogleChrome]]></category> <category><![CDATA[Murmuring]]></category> <category><![CDATA[Network]]></category> <category><![CDATA[Social]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[google]]></category> <category><![CDATA[greasemonkey]]></category> <category><![CDATA[plus]]></category> <category><![CDATA[script]]></category> <category><![CDATA[test]]></category> <category><![CDATA[yahoo]]></category><guid
isPermaLink="false">http://blog.gslin.org/?p=2808</guid> <description><![CDATA[Tweet 那個紅色的數字 icon 還蠻妨礙工作的，到 userscripts.org 上翻一翻，果然有人有寫過了 (雖然是沒幾天前)：「Go Away! Google Plus」。 PS：隨便丟字進去測試的時候，發現 &#8220;test&#8221; 第五名是 tw.yahoo.com，這是怎麼了&#8230;？]]></description> <content:encoded><![CDATA[<div
class="bottomcontainerBox" style=""><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <iframe
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.gslin.org%2Farchives%2F2011%2F12%2F21%2F2808%2F%25e6%258a%258a-google-plus-%25e7%259a%2584%25e6%2595%25b8%25e5%25ad%2597-icon-%25e8%2597%258f%25e8%25b5%25b7%25e4%25be%2586%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div><div
style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <g:plusone size="medium" href="http://blog.gslin.org/archives/2011/12/21/2808/%e6%8a%8a-google-plus-%e7%9a%84%e6%95%b8%e5%ad%97-icon-%e8%97%8f%e8%b5%b7%e4%be%86/"></g:plusone></div><div
style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <a
href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.gslin.org/archives/2011/12/21/2808/%e6%8a%8a-google-plus-%e7%9a%84%e6%95%b8%e5%ad%97-icon-%e8%97%8f%e8%b5%b7%e4%be%86/"  data-text="把 Google Plus 的數字 icon 藏起來&#8230;" data-count="horizontal" data-via="gslin">Tweet</a></div></div><div
style="clear:both"></div><div
style="padding-bottom:4px;"></div><p>那個紅色的數字 icon 還蠻妨礙工作的，到 <a
href="http://userscripts.org/">userscripts.org</a> 上翻一翻，果然有人有寫過了 (雖然是沒幾天前)：「<a
href="http://userscripts.org/scripts/show/120626">Go Away! Google Plus</a>」。</p><p>PS：隨便丟字進去測試的時候，發現 &#8220;<a
href="https://www.google.com/search?q=test">test</a>&#8221; 第五名是 tw.yahoo.com，這是怎麼了&#8230;？</p> ]]></content:encoded> <wfw:commentRss>http://blog.gslin.org/archives/2011/12/21/2808/%e6%8a%8a-google-plus-%e7%9a%84%e6%95%b8%e5%ad%97-icon-%e8%97%8f%e8%b5%b7%e4%be%86/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>gitolite 的 hook&#8230;</title><link>http://blog.gslin.org/archives/2011/12/19/2805/gitolite-%e7%9a%84-hook/</link> <comments>http://blog.gslin.org/archives/2011/12/19/2805/gitolite-%e7%9a%84-hook/#comments</comments> <pubDate>Sun, 18 Dec 2011 19:17:25 +0000</pubDate> <dc:creator>Gea-Suan Lin</dc:creator> <category><![CDATA[Computer]]></category> <category><![CDATA[Murmuring]]></category> <category><![CDATA[Network]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[git]]></category> <category><![CDATA[gitolite]]></category> <category><![CDATA[hook]]></category> <category><![CDATA[script]]></category><guid
isPermaLink="false">http://blog.gslin.org/?p=2805</guid> <description><![CDATA[Tweet 弄了整個週末的 gitolite，總算是把 hook 搞定。 簡單的說，修改完 ~/.gitolite/hooks/common/ 裡的 hook script 後，需要下 gl-setup 指令，這個指令會把現在所有的 git repository 內的 hook script 再 symbolic link 一次。 另外，gitolite 的環境變數可能會影響 git 本身執行 (我是在 git pull -v 更新某個目錄下的 git repository 時失敗)，這時可以用 /usr/bin/env -i /usr/local/bin/git 確保 git 執行時不會被環境變數影響&#8230; &#8230; <a
href="http://blog.gslin.org/archives/2011/12/19/2805/gitolite-%e7%9a%84-hook/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<div
class="bottomcontainerBox" style=""><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <iframe
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.gslin.org%2Farchives%2F2011%2F12%2F19%2F2805%2Fgitolite-%25e7%259a%2584-hook%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div><div
style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <g:plusone size="medium" href="http://blog.gslin.org/archives/2011/12/19/2805/gitolite-%e7%9a%84-hook/"></g:plusone></div><div
style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <a
href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.gslin.org/archives/2011/12/19/2805/gitolite-%e7%9a%84-hook/"  data-text="gitolite 的 hook&#8230;" data-count="horizontal" data-via="gslin">Tweet</a></div></div><div
style="clear:both"></div><div
style="padding-bottom:4px;"></div><p>弄了整個週末的 <a
href="https://github.com/sitaramc/gitolite">gitolite</a>，總算是把 hook 搞定。</p><p>簡單的說，修改完 <code>~/.gitolite/hooks/common/</code> 裡的 hook script 後，需要下 <code>gl-setup</code> 指令，這個指令會把現在所有的 git repository 內的 hook script 再 symbolic link 一次。</p><p>另外，gitolite 的環境變數可能會影響 <a
href="http://git-scm.com/">git</a> 本身執行 (我是在 <code>git pull -v</code> 更新某個目錄下的 git repository 時失敗)，這時可以用 <code>/usr/bin/env -i /usr/local/bin/git</code> 確保 git 執行時不會被環境變數影響&#8230;</p><p>gitolite 看起來是個好東西，不過光是靠官方的文件要搞定頗累&#8230; (週末都在 <a
href="http://stackoverflow.com/">Stack Overflow</a> 上度過)</p> ]]></content:encoded> <wfw:commentRss>http://blog.gslin.org/archives/2011/12/19/2805/gitolite-%e7%9a%84-hook/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>如果要自己寫 TOTP 的幾個要看的東西&#8230;</title><link>http://blog.gslin.org/archives/2011/12/18/2804/%e5%a6%82%e6%9e%9c%e8%a6%81%e8%87%aa%e5%b7%b1%e5%af%ab-totp-%e7%9a%84%e5%b9%be%e5%80%8b%e8%a6%81%e7%9c%8b%e7%9a%84%e6%9d%b1%e8%a5%bf/</link> <comments>http://blog.gslin.org/archives/2011/12/18/2804/%e5%a6%82%e6%9e%9c%e8%a6%81%e8%87%aa%e5%b7%b1%e5%af%ab-totp-%e7%9a%84%e5%b9%be%e5%80%8b%e8%a6%81%e7%9c%8b%e7%9a%84%e6%9d%b1%e8%a5%bf/#comments</comments> <pubDate>Sun, 18 Dec 2011 09:38:22 +0000</pubDate> <dc:creator>Gea-Suan Lin</dc:creator> <category><![CDATA[Computer]]></category> <category><![CDATA[Murmuring]]></category> <category><![CDATA[Network]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Security]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[authenticator]]></category> <category><![CDATA[cpan]]></category> <category><![CDATA[google]]></category> <category><![CDATA[hotp]]></category> <category><![CDATA[oath]]></category> <category><![CDATA[otp]]></category> <category><![CDATA[qrcode]]></category> <category><![CDATA[totp]]></category><guid
isPermaLink="false">http://blog.gslin.org/?p=2804</guid> <description><![CDATA[Tweet 整理下來： HOTP: An HMAC-Based One-Time Password Algorithm TOTP: Time-Based One-Time Password Algorithm KeyUriFormat &#8211; google-authenticator &#8211; The format of URIs containing encoded keys &#8211; Two-step verification &#8211; Google Project Hosting 有玩過 HMAC 的人，讀這些文件應該不難&#8230; TOTP 在預設的情況下，其實就是 HMAC-SHA-1 後取後面 32bits，然後轉成數字取 100000 &#8230; <a
href="http://blog.gslin.org/archives/2011/12/18/2804/%e5%a6%82%e6%9e%9c%e8%a6%81%e8%87%aa%e5%b7%b1%e5%af%ab-totp-%e7%9a%84%e5%b9%be%e5%80%8b%e8%a6%81%e7%9c%8b%e7%9a%84%e6%9d%b1%e8%a5%bf/">Continue reading <span
class="meta-nav">&#8594;</span></a>]]></description> <content:encoded><![CDATA[<div
class="bottomcontainerBox" style=""><div
style="float:left; width:85px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <iframe
src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fblog.gslin.org%2Farchives%2F2011%2F12%2F18%2F2804%2F%25e5%25a6%2582%25e6%259e%259c%25e8%25a6%2581%25e8%2587%25aa%25e5%25b7%25b1%25e5%25af%25ab-totp-%25e7%259a%2584%25e5%25b9%25be%25e5%2580%258b%25e8%25a6%2581%25e7%259c%258b%25e7%259a%2584%25e6%259d%25b1%25e8%25a5%25bf%2F&amp;layout=button_count&amp;show_faces=false&amp;width=85&amp;action=like&amp;font=verdana&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width=85px; height:21px;" allowTransparency="true"></iframe></div><div
style="float:left; width:80px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <g:plusone size="medium" href="http://blog.gslin.org/archives/2011/12/18/2804/%e5%a6%82%e6%9e%9c%e8%a6%81%e8%87%aa%e5%b7%b1%e5%af%ab-totp-%e7%9a%84%e5%b9%be%e5%80%8b%e8%a6%81%e7%9c%8b%e7%9a%84%e6%9d%b1%e8%a5%bf/"></g:plusone></div><div
style="float:left; width:95px;padding-right:10px; margin:4px 4px 4px 4px;height:30px;"> <a
href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.gslin.org/archives/2011/12/18/2804/%e5%a6%82%e6%9e%9c%e8%a6%81%e8%87%aa%e5%b7%b1%e5%af%ab-totp-%e7%9a%84%e5%b9%be%e5%80%8b%e8%a6%81%e7%9c%8b%e7%9a%84%e6%9d%b1%e8%a5%bf/"  data-text="如果要自己寫 TOTP 的幾個要看的東西&#8230;" data-count="horizontal" data-via="gslin">Tweet</a></div></div><div
style="clear:both"></div><div
style="padding-bottom:4px;"></div><p>整理下來：</p><ul><li><a
href="http://tools.ietf.org/html/rfc4226">HOTP: An HMAC-Based One-Time Password Algorithm</a></li><li><a
href="http://tools.ietf.org/html/rfc6238">TOTP: Time-Based One-Time Password Algorithm</a></li><li><a
href="http://code.google.com/p/google-authenticator/wiki/KeyUriFormat">KeyUriFormat &#8211; google-authenticator &#8211; The format of URIs containing encoded keys &#8211; Two-step verification &#8211; Google Project Hosting</a></li></ul><p>有玩過 <a
href="https://en.wikipedia.org/wiki/HMAC">HMAC</a> 的人，讀這些文件應該不難&#8230;</p><p>TOTP 在預設的情況下，其實就是 HMAC-SHA-1 後取後面 32bits，然後轉成數字取 100000 的餘數，而 TOTP 文件是架構在 HOTP 的定義上，把時間切齊 (預設 30secs) 變成整數丟進去攪和，然後特地交代要處理 2038 年超過 Int32 的 case XDDD</p><p>最後 <a
href="http://www.google.com/">Google</a> 那份文件是要輸出 QR code 讓手機可以讀的方式，建議不要用網路服務產生 QR code (因為有 secret key 啊)，寧可自己抓 library 建一個用&#8230;</p><p>另外 Google Authenticator 一堆東西都只能用預設值 (Currently, the XXX is ignored by the Google Authenticator implementations.)，所以也沒什麼好選的，就拿預設值吧&#8230; :o</p><p>Server side 的話，至少我在 <a
href="http://www.cpan.org/">CPAN</a> 上面看到 <a
href="http://search.cpan.org/dist/Authen-OATH/">Authen-OATH</a> 可以用了，用起來也很簡單 :o</p> ]]></content:encoded> <wfw:commentRss>http://blog.gslin.org/archives/2011/12/18/2804/%e5%a6%82%e6%9e%9c%e8%a6%81%e8%87%aa%e5%b7%b1%e5%af%ab-totp-%e7%9a%84%e5%b9%be%e5%80%8b%e8%a6%81%e7%9c%8b%e7%9a%84%e6%9d%b1%e8%a5%bf/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: blog.gslin.org @ 2012-02-12 12:57:08 -->
