查看“︁ROT13”︁的源代码
←
ROT13
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{refimprove|time=2015-04-28T12:18:51+00:00}} {{noteTA |G1=IT }} [[File:ROT13 table with example.svg|right|thumbnail|320px|ROT13透過與其成對的13個字母一對一置換,如<tt>HELLO</tt>變成<tt>URYYB</tt>(或者將之解碼,<tt>URYYB</tt>再度變回<tt>HELLO</tt>)。]] '''ROT13'''('''迴轉13位''',{{lang-en|rotate by 13 places}},有時也記為'''ROT-13''')是一種簡易的[[替換式密碼]]。ROT13是一種在英文[[网络论坛|網路論壇]]用作隱藏[[劇情透露|八卦]](spoiler)、[[妙句]]、謎題解答以及某些[[髒話]]的工具,目的是逃過版主或管理员的匆匆一瞥。ROT13被描述成「雜誌[[字謎]]上下顛倒解答的[[Usenet]]對等體」。(Usenet equivalent of a magazine printing the answer to a quiz upside down.)<ref>{{cite web | language=en |first=Bruce|last=Horrocks|url=http://groups.google.com/groups?selm=UZ36hgCSoh%24%2BEwqG%40nodomain.nodomain.us |title=UCSM Cabal Circular #207-a |accessdate=2007-09-17 |date=28 June 2003 |work=Usenet group uk.comp.sys.mac }}</ref> ROT13 也是過去在[[古罗马|古羅馬]]開發的[[凱撒密碼|凱撒加密]]的一種變體。 ROT13是它自己本身的[[反函數|逆反]];也就是說,要還原ROT13,套用加密同樣的演算法即可得,故同樣的操作可用再加密與解密。該演算法並沒有提供真正的[[密码学|密碼學上]]的保全,故它不應該被套用在需要保全的用途上。它常常被當作弱加密範例的典型。ROT13激勵了廣泛的線上書信撰寫與字母遊戲,且它常於[[新聞群組]]對話中被提及。 == 描述 == 套用ROT13到一段文字上僅僅只需要檢查字元字母順序並取代它在13位之後的對應[[字母系統|字母]],有需要超過時則重新繞回26英文字母開頭即可<ref name="schneier">{{cite book | language=en |last=Schneier |first=Bruce |authorlink= Bruce Schneier |editor= |others= |title=Applied Cryptography | url=https://archive.org/details/appliedcryptogra00schn_328 |edition=Second|year=1996|publisher=John Wiley & Sons |isbn= 0-471-11709-9|pages=[https://archive.org/details/appliedcryptogra00schn_328/page/n10 11] }}</ref>。 <tt>A</tt>換成<tt>N</tt>、<tt>B</tt>換成<tt>O</tt>、依此類推到<tt>M</tt>換成<tt>Z</tt>,然後序列反轉:<tt>N</tt>換成<tt>A</tt>、<tt>O</tt>換成<tt>B</tt>、最後<tt>Z</tt>換成<tt>M</tt>。只有這些出現在[[英文字母]]裡頭的字元受影響;[[數字]]、[[符号|符號]]、[[空白字元]]以及所有其他字元都不變。因為只有在英文字母表裡頭只有26個,並且26 = 2 × 13,ROT13函數是它自己的[[反函數|逆反]]:<ref name="schneier"/> :對任何字元 ''x'': <math>\mbox{ROT}_{13}(\mbox{ROT}_{13}(x))=\mbox{ROT}_{26}(x)=x</math>。 換句話說,兩個連續的ROT13應用函式會回復原始文字(在[[数学|數學]]上,這有時稱之為[[對合]](involution);在密碼學上,這叫做[[對等加密]](reciprocal cipher))。 轉換可以利用[[查找表]]完成,如下例所示: {| style="margin-left:auto; margin-right:auto" class="wikitable" |- | <tt>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz</tt> |- | <tt>NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm</tt> |} 例如,下面的英文笑話,精華句為ROT13所隱匿: How can you tell an extrovert from an introvert at [[美国国家安全局|NSA]]? Va gur ryringbef, gur rkgebireg ybbxf ng gur BGURE thl'f fubrf. 透過ROT13表格轉換整片文字,該笑話的解答揭露如下: Ubj pna lbh gryy na rkgebireg sebz na vagebireg ng AFN? In the elevators, the extrovert looks at the OTHER guy's shoes. 第二次ROT13函數將轉回原始文字。 == 用途 == ROT13過去在1980年代早期的net.jokes[[新聞群組]]裡使用<ref>早期ROT13的使用可從[[Google USENET]]存檔資料回溯至1982年10月8日當日張貼<tt>net.jokes</tt>新聞群組的帖子 [http://groups.google.com/groups?selm=bnews.desoto.299][http://groups.google.com/groups?selm=bnews.utcsrgv.596]。</ref>。它被用來隱藏某些可能侮辱到特定讀者的笑話、隱晦某個謎題的答案或八卦性的內容。<ref name="schneier"/><ref name="jargon">{{cite web |language=en |date=2003-12-29 |first=Eric S. (ed.) |last=Raymond |authorlink=Eric S. Raymond |url=http://www.catb.org/~esr/jargon/html/R/rot13.html |title=ROT13 |accessdate=2007-09-19 |work=The Jargon File, 4.4.7 |archive-date=2014-06-11 |archive-url=https://www.webcitation.org/6QFlzxlPy?url=http://www.catb.org/~esr/jargon/html/R/rot13.html |dead-url=no }}</ref>。之所以選一次13個字母的位移而不是其他值(例如原本凱撒加密裡的3字母位移)乃因13位這個值剛剛好加密解密都是一樣,故只要一行命令就可以簡潔的滿足兩者需要<ref name="jargon"/>。ROT13一般是[[新聞閱讀軟體]]內建支援的功能<ref name="jargon"/>。電子郵件位址有時也以ROT13編碼以躲過較不複雜的[[垃圾郵件機器人]]耳目。<ref>{{cite web|language=en|last1=Ferner|first1=Matt|title=How to Hide Email Addresses From Spam Bots|url=http://www.practicalecommerce.com/articles/2434-How-to-Hide-Email-Addresses-From-Spam-Bots|publisher=PracticalEcommerce|accessdate=12 June 2014|archive-date=2016-05-08|archive-url=https://web.archive.org/web/20160508030142/http://www.practicalecommerce.com/articles/2434-How-to-Hide-Email-Addresses-From-Spam-Bots|dead-url=no}}</ref> ROT13是凱撒密碼[[加密|加密演算法]]的特例。西元前一世紀[[尤利烏斯·凱撒]]發明凱薩加密法<ref>{{cite book | language=en |last=Kahn |first=David |authorlink=David Kahn |coauthors= |title=The Codebreakers: The Story of Secret Writing | year=1967 | url=https://archive.org/details/codebreakersstor0000kahn |publisher=Macmillan |location=New York |isbn=0-684-83130-9 }}</ref>。{{Fact|更具體的例子是[[伐蹉衍那加密]](Vatsyayana cipher),該密碼描述了《[[欲经]]》整本經文。|time=2015-04-27T16:47:27+00:00}} ROT13並不意圖用在重視[[保密|機密]]性的場合。固定位移的使用意味著該加密實際上並沒有[[金鑰 (密碼學)|金鑰]],而且解碼不需要對ROT13實際上的使用有較深了解。即使沒有ROT13使用的知識,該演算法也相當容易透過[[频率分析|頻率分析]]破解<ref name="schneier"/>。正因為其完全不適合真正的機密用途,ROT13已經變成了一種警句,用來影射任何顯著的弱[[加密]]體-{系}-;例如批評家可能會這樣說:「56位元[[資料加密標準|DES]]這些日子以來只比ROT13要好一點。」另外,作為對真正術語像“雙重DES”的嘲諷,半路殺出的術語“雙重ROT13”、“ROT26”、“2ROT13”、以及玩笑性質的學術論文「關於2ROT13加密演算法」<ref>{{cite web|language=en|title=On the 2ROT13 Encryption Algorithm|format=PDF|date=2004-09-25|url=http://www.pruefziffernberechnung.de/Originaldokumente/2rot13.pdf|publisher=Prüfziffernberechnung in der Praxis|accessdate=2007-09-20|archive-date=2014-06-11|archive-url=https://www.webcitation.org/6QFm0l1cd?url=http://www.pruefziffernberechnung.de/Originaldokumente/2rot13.pdf|dead-url=no}}</ref> 都閃爍著幽默的心思。因為套用ROT13到已經加密過的ROT13文字,將會打回原形;也就是說,ROT26等於沒有加密。延伸下去,三重ROT13(用來取笑其對比的 3DES)等同於1次ROT13而已。 於1999年12月,人們發現[[網景通訊家]]利用ROT13作為其儲存email密碼的不安全體-{系}-。<ref>{{cite web|language=en|author=Hollebeek, Tim|coauthors=Viega, John|url=http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.15.9271|publisher=Reliable Software Technologies|title=Bad Cryptography in the Netscape Browser: A Case Study|accessdate=2007-09-20|archive-date=2014-09-04|archive-url=https://web.archive.org/web/20140904231019/http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.15.9271|dead-url=no}}</ref>。在2001年,俄羅斯程式設計師[[狄米區·史蓋里亞羅夫]](Dimitry Sklyarov)展示[[eBook]]販賣商[[New Paradigm Research Group]](NPRG)使用ROT13來對它們的文件加密;據推測NPRG可能把ROT13玩具樣本——跟著[[Adobe Systems|Adobe]] eBook[[软件开发工具包]]一起提供——用錯在重大加密體-{系}-上。<ref>{{cite web|language=en|first=Bruce|last=Perens|authorlink=Bruce Perens|url=http://www.zdnet.com/news/dimitry-sklyarov-enemy-or-friend/116424|title=Dimitry Sklyarov: Enemy or friend?|date=2001-09-01|accessdate=2007-09-20|publisher=[[ZDNet News]]|archive-date=2014-06-11|archive-url=https://www.webcitation.org/6QFm2CHqL?url=http://www.zdnet.com/news/dimitry-sklyarov-enemy-or-friend/116424|dead-url=no}}</ref>[[Windows XP]]也在某些注册表键上使用ROT13。<ref>{{cite web|language=en|first=Vic|last=Ferri|title=The Count Keys in the Windows Registry|url=http://www.personal-computer-tutor.com/abc3/v29/vic29.htm|publisher=ABC: All 'Bout Computers|date=2007-01-04|accessdate=2007-09-20|archive-url=https://web.archive.org/web/20071022093414/http://personal-computer-tutor.com/abc3/v29/vic29.htm|archive-date=2007-10-22|dead-url=yes}}</ref> == 字母遊戲與網路文化 == {| class="wikitable" style="float:right; margin:0 0 1em 1em; text-align:center;" |- | colspan="2" | <tt>abcdefghijklmnopqrstuvwxyz</tt><br /><tt>NOPQRSTUVWXYZABCDEFGHIJKLM</tt> |- | <tt>aha</tt> ↔ <tt>nun</tt> || <tt>ant</tt> ↔ <tt>nag</tt> |- | <tt>balk</tt> ↔ <tt>onyx</tt> || <tt>bar</tt> ↔ <tt>one</tt> |- | <tt>barf</tt> ↔ <tt>ones</tt> || <tt>be</tt> ↔ <tt>or</tt> |- | <tt>bin</tt> ↔ <tt>ova</tt> || <tt>ebbs</tt> ↔ <tt>roof</tt> |- | <tt>envy</tt> ↔ <tt>rail</tt> || <tt>er</tt> ↔ <tt>re</tt> |- | <tt>errs</tt> ↔ <tt>reef</tt> || <tt>flap</tt> ↔ <tt>sync</tt> |- | <tt>fur</tt> ↔ <tt>she</tt> || <tt>gel</tt> ↔ <tt>try</tt> |- | <tt>gnat</tt> ↔ <tt>tang</tt> || <tt>irk</tt> ↔ <tt>vex</tt> <!-- Nice ones: --> |- | <tt>clerk</tt> ↔ <tt>pyrex</tt> || <tt>purely</tt> ↔ <tt>cheryl</tt> |- | <tt>PNG</tt> ↔ <tt>cat</tt> || <tt>SHA</tt> ↔ <tt>fun</tt> |- | <tt>furby</tt> ↔ <tt>sheol</tt> || <tt>terra</tt> ↔ <tt>green</tt> |- | <tt>what</tt> ↔ <tt>Jung</tt> || <tt>URL</tt> ↔ <tt>hey</tt> |- | <tt>purpura</tt> ↔ <tt>Chechen</tt> || <tt>shone</tt> ↔ <tt>FUBAR</tt> |} ROT13為[[字母遊戲]]提供了良機。許多字經過ROT13轉換後,會產生另一個字。[[英语|英文]]裡字最長的範例是一組7個字母的字 <tt>abjurer</tt> 與 <tt>nowhere</tt>;另一組七字母的是<tt>chechen</tt> 與 <tt>purpura</tt>。其他字的範例如表中所示。<ref>{{cite web|language=en|url=http://www.furrfu.org/rot13words.html|last=De Mulder|first=Tom|title=ROT13 Words|accessdate=2007-09-19|work=Furrfu!|archive-date=2014-06-11|archive-url=https://www.webcitation.org/6QFm0Exa7?url=http://www.furrfu.org/rot13words.html|dead-url=no}}</ref> 1989年[[国际C语言混乱代码大赛]](IOCCC)收錄了一個來自[[布來恩·衛斯里]](Brian Westley)的作品。衛斯里的[[计算机程序]]可被ROT13編解碼,並且仍舊正確的通過[[編譯器|編譯]]。該程式主要是進行ROT13編碼,或者反過來解碼其輸入。<ref>{{cite web | language = en | url = http://www.ioccc.org/1989/westley.c | title = westley.c | work = [[国际C语言混乱代码大赛|IOCCC]] | year = 1989 | first = Brian | last = Westley | accessdate = 2007-08-13 | archive-url = https://www.webcitation.org/68FrQ350H?url=http://www.ioccc.org/1989/westley.c | archive-date = 2012-06-08 | dead-url = yes }}</ref> 新聞群組alt.folklore.urban創造了生字:<tt>furrfu</tt>,該字是常用狀聲辭「噓」(sheesh)的ROT13編碼。「<tt>Furrfu</tt>」在1992年中期首度出現。當時在alt.folklore.urban新聞群組裡許多[[現代傳說|都會傳奇]]的眾多水帖裡,新手過度使用「Sheesh!」而遭到某些發帖人抱怨,而這些新手對此所作的回應。<ref>{{cite web |language=en |url=http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?furrfu |title=Furrfu |publisher=[[Foldoc]] |date=1995-10-25 |accessdate=2007-08-13 |deadurl=yes |archiveurl=https://web.archive.org/web/20051129194640/http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?furrfu |archivedate=2005-11-29 }}</ref> == 變體 == {{anchor|ROT47}} ROT47是ROT13的衍生物,它除了打亂基本字母外,也對數字與常見符號做處理。除了使用<tt>A–Z</tt>系列外,ROT47使用範圍較廣的[[ASCII]]字符集。具體而言,所有7-bit可列印字元,除空白以外,從十進位 33 '<tt>!</tt>' 到 126 '<tt>~</tt>'都被毫無保留的用來做47位循環。使用較廣的字母集原意是產生比ROT13更徹底的亂碼,不過因為ROT47無差別地將數字與符號混合導入,導致這種方式較容易看出某串文字被動過手腳。 ROT47的範例:<br /> <tt>[[the quick brown fox jumps over the lazy dog|The Quick Brown Fox Jumps Over The Lazy Dog]].</tt><br /> ...加密成為...<br /> <tt>%96 "F:4< qC@H? u@I yF>AD ~G6C %96 {2KJ s@8]</tt> [[程序设计]]裡標準的[[GNU C 函式庫]]包含了一個[[子程序|函式]] —'''<tt>memfrob()</tt>'''<ref>{{cite web|language=en|url=http://www.gnu.org/software/libc/manual/html_node/Trivial-Encryption.html|date=2006-12-03|title=5.10 Trivial Encryption|work=The GNU C Library Reference Manual|publisher=[[自由软件基金会]]|accessdate=2007-09-20|archive-date=2014-06-11|archive-url=https://www.webcitation.org/6QFm51TRO?url=http://www.gnu.org/software/libc/manual/html_node/Trivial-Encryption.html|dead-url=no}}</ref>— 它與ROT13有類似的效果,儘管該函式使用對象是任意雙位元組資料。<tt>memfrob()</tt>透過每個[[位元]]與[[二进制|雙位元]]模板00101010([[42]])做[[互斥]](XOR)運算合併。這個效果是一種簡單的[[互斥|XOR]]操作。與ROT13相似, <tt>memfrob()</tt>也是自我逆反的,故提供的保全程度好不到哪裡去。 == 參見 == * [[密码分析]] == 注釋與參考資料 == {{reflist}} == 外部連結 == <!-- DO NOT ADD ANY MORE IMPLEMENTATIONS --> * ROT5 與 ROT13 [http://rot13.de/ 線上轉換器]{{Wayback|url=http://rot13.de/ |date=20081212073710 }}(不用[[JavaScript]]) * [https://web.archive.org/web/20081003231752/http://www.miranda.org/~jkominek/rot13/ 各種程式語言版本的ROT13軟體] — 包括[[Secure Shell|SSH]]補丁讓它加入ROT13支援,以及對映的密碼分析工具,用來自動分別ROT13文字與純文字。 * [http://www.mxcz.net/tools/rot13.aspx 在線的ROT13加密解密工具]{{Wayback|url=http://www.mxcz.net/tools/rot13.aspx |date=20100804071619 }}。 {{Cryptography navbox|classical}} [[Category:古典密码]] [[Category:网络文化]]
该页面使用的模板:
Template:Anchor
(
查看源代码
)
Template:Cite book
(
查看源代码
)
Template:Cite web
(
查看源代码
)
Template:Cryptography navbox
(
查看源代码
)
Template:Fact
(
查看源代码
)
Template:Lang-en
(
查看源代码
)
Template:NoteTA
(
查看源代码
)
Template:Refimprove
(
查看源代码
)
Template:Reflist
(
查看源代码
)
Template:Wayback
(
查看源代码
)
返回
ROT13
。
导航菜单
个人工具
登录
命名空间
页面
讨论
不转换
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
工具
链入页面
相关更改
页面信息