日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

08:vigenère密码_密码技术:Vigenére密码,Playfair密码,Hill密码

發布時間:2023/12/1 编程问答 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 08:vigenère密码_密码技术:Vigenére密码,Playfair密码,Hill密码 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

08:vigenère密碼

1)Vigenére密碼 (1) Vigenére Cipher)

This technique is an example of Polyalphabetic Substitution technique which uses 26 Caesar ciphers make up the mono-alphabetic substitution rules which follow a count shifting mechanism from 0 to 25. That is, for each plain-text character we have a corresponding substitution known as a key letter.

該技術是使用26個凱撒密碼彌補隨后的計數移動機構從0到25。也就是說,對于我們的相應取代已知為每個純文本字符的單字母替換規則多碼替代技術的一個例子關鍵信 。

To understand this technique we need to take a look on this Vigenére tableau.

要了解此技術,我們需要看一下Vigenére表格 。

The logic for this technique is simple, say for a key letter 't' and plain-text letter 'h', the corresponding cipher-text letter is at the intersection of row titled 't' and column titled 'h' thus for this case we get a ciphertext that would be 'A' based on above table.

這種技術的邏輯很簡單,例如對于一個關鍵字母“ t”和純文本字母“ h” ,相應的密文字母位于標題為“ t”的行與標題為“ h”的列的交點處。情況下,根據上表,我們將得到一個密文“ A” 。

It is clear that for encrypting a plain-text message we must need a key whose length is equal to the size of the plain-text message usually a repeating key is used.

顯然,為了加密純文本消息,我們需要一個長度等于純文本消息大小的密鑰,通常使用重復密鑰。

2)Playfair密碼 (2) Playfair Cipher)

Playfair cipher (aka Playfair square) is a cryptography technique used for manual encryption, it was introduced by Charles Wheatstone in 1854 but it was popularized by Lord Playfair hence his name used.

Playfair密碼(又名Playfair平方)是一種用于手動加密的加密技術,由Charles Wheatstone于1854年提出,但后來被Playfair勛爵推廣,因此使用了他的名字。

The Playfair cipher was used in world war I by the British army and in World war II it was used by Australians. It was because the Playfair cipher is quite fast to use and does not demand any special equipment.

Playfair密碼在第一次世界大戰中被英國軍隊使用,在第二次世界大戰中被澳大利亞人使用。 這是因為Playfair密碼使用起來非常快,并且不需要任何特殊設備。

Playfair technique has 2 major steps:

Playfair技術有兩個主要步驟:

.minHeight{min-height: 250px;}@media (min-width: 1025px){.minHeight{min-height: 90px;}} .minHeight{min-height: 250px;}@media (min-width: 1025px){.minHeight{min-height: 90px;}}

Step 1: Creation and Population of matrix

步驟1:矩陣的創建和填充

This technique uses a 5 x 5 matrix which stores a keyword (or phrase) that becomes the key for encryption or decryption. This involves some set of fixed rule, those are:

該技術使用5 x 5矩陣 ,該矩陣存儲一個關鍵字(或短語),該關鍵字成為加密或解密的密鑰。 這涉及到一些固定規則,它們是:

  • Fill the keyword in the matrix row-wise from left to right, top to down.

    從左到右,從上到下按行在矩陣中填充關鍵字。

  • Remove all repeated letters.

    刪除所有重復的字母。

  • Enter the remaining spaces in the matrix with the rest of the English alphabets (A-Z) that were not a part of our keyword. In this process, combine I and J in the same cell of the table; in other words, if I and J is a part of the keyword disregard both I and J while filling the remaining slots.

    在矩陣中輸入剩余的空格以及不屬于我們關鍵字的其余英文字母( AZ )。 在此過程中,將I和J合并到表的同一單元格中; 換句話說,如果I和J是關鍵字的一部分,則在填充其余插槽時,請同時忽略I和J。

  • Example:

    例:

    Let's take our keyword as 'INCLUDEHELP IS AWESOME'. Then 5 x 5 matrix will look as:

    讓我們將關鍵字設為“ INCLUDEHELP IS AWESOME” 。 然后5 x 5矩陣將如下所示:

    Step 2: Encryption

    步驟2:加密

    This process consist of the following process:

    此過程包括以下過程:

  • The plain-text we want to encrypt need to broke down into a pair of alphabets. For example, if our message is "MY NAME IS POGO", it will become "MY NA ME IS PO GO".

    我們要加密的純文本需要分解為一對字母。 例如,如果我們的消息是“ MY NAME IS POGO” ,它將變成“ MY NA ME IS PO GO” 。

  • If both alphabets are the same (or only left), add an X after the first alphabet in a pair. Encrypt the new pair (after adding X) then continue.

    如果兩個字母相同(或僅向左),則在成對的第一個字母之后添加X。 加密新對(添加X之后 ),然后繼續。

  • If pair appears in the same row of the matrix, replace them with a letter at its right, if it's at the right end of the row then wrapping around the left side of the row.
  • If pair appears in the same column of the matrix, replace them with the alphabet below them. If it's on the bottom then wrapping around the top of the row.

    如果對出現在矩陣的同一列中,請用其下面的字母替換它們。 如果它在底部,則環繞該行的頂部。

  • If the pairis not in the same row or column, replace them with the alphabets in the same row respectively, but at the other pair of cornersof the rectangle defined by the original pair. The order is quite significant here. The first encrypt alphabet of the pair is the one that is present on the same row as the first plaintext alphabet.

    如果該對不在同一行或同一列中,則分別用同一行中的字母代替它們,而應替換為原始對定義的矩形的另一對角。 這里的順序非常重要。 該對中的第一個加密字母是與第一個明文字母在同一行上的字母。

  • Explanation:

    說明:

    "MY NA ME IS PO GO"

    “我不喜歡我”

    So we start with MY now in the above matrix it was not in the same row or column then rule 5 will apply.

    因此,我們從上面的矩陣中的MY開始,因為它不在同一行或同一列中,所以將應用規則5。

    Now we replace 'MY' with the diagonals that are 'KZ'.

    現在我們將對角線KZ替換為MY 。

    Let's move to 'NA' again they are not in the same row or column, rule 5 will apply.

    讓我們再次移至“ NA”(它們不在同一行或同一列中),將應用規則5。

    Now, 'NA' will be replaced with 'UE'.

    現在, “ NA”將被替換為“ UE” 。

    Similarly, "MY NA ME IS PO GO" will become "KZ UE FA LO DS BS".

    類似地, “ MY NA ME IS PO GO”將變為“ KZ UE FA LO DS BS” 。

    For the decryptionprocess, we will just follow the exact opposite steps.

    對于解密過程,我們將遵循完全相反的步驟。

    .minHeight{min-height: 250px;}@media (min-width: 1025px){.minHeight{min-height: 90px;}} .minHeight{min-height: 250px;}@media (min-width: 1025px){.minHeight{min-height: 90px;}}

    3)希爾密碼 (3) Hill Cipher)

    The Hill cipher is based on polygraphic substitution that is it works on multiple letters at the same time, introduced by Lester Hill in 1929. This method related to the matrix theory of mathematics, specifically how to compute the inverse of a matrix.

    希爾密碼是基于多重圖形替換的,它同時處理多個字母,這是萊斯特·希爾(Lester Hill)在1929年提出的。這種方法與數學的矩陣理論有關,特別是如何計算矩陣的逆。

    Let's see how it works:

    讓我們看看它是如何工作的:

  • Every Letter of plain-text will be represented by a number, so that A=0, B=1,...,Z=25.

    每個純文本字母將由一個數字表示,因此A = 0,B = 1,...,Z = 25 。

  • We will make a matrix of the plain-text message using the above knowledge.

    我們將使用以上知識來構成純文本消息的矩陣。

    For example,

    例如,

    'CAT', so C=2, A=0, T=19. Thus our matrix lookslike:

    'CAT' ,因此C = 2,A = 0,T = 19 。 因此我們的矩陣看起來像:

  • Now, we multiply our matrix with randomly chosen keys. The size of the key must be n x n where n is a number of rows of our plain-text matrix.

    現在,我們將矩陣與隨機選擇的鍵相乘。 鍵的大小必須為nxn ,其中n是純文本矩陣的行數。

    For example:

    例如:

  • Now multiply the above matrices,

    現在將上述矩陣相乘,

  • Now we will calculate a mod 26 value of the above matrix, that is remainder after dividing 26.

    現在我們將計算上述矩陣的mod 26值,即除以26后的余數。

  • Translate back number to alphabets, 5=F, 8=I, 13=N. Therefore, our cipher-text is "FIN".

    將數字轉換回字母,即5 = F , 8 = I , 13 = N。 因此,我們的密文為“ FIN” 。

  • For Decryption, take the cipher-text matrix and multiply it with the inverse of our original key matrix:

    對于解密,請采用密文矩陣并將其與原始密鑰矩陣的逆矩陣相乘:

  • 翻譯自: https://www.includehelp.com/cryptography/cryptographic-techniques-vigenére-cipher-playfair-cipher-hill-cipher.aspx

    08:vigenère密碼

    總結

    以上是生活随笔為你收集整理的08:vigenère密码_密码技术:Vigenére密码,Playfair密码,Hill密码的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

    主站蜘蛛池模板: 久草电影在线 | 成人无码av片在线观看 | av在线.com | 又黄又色又爽的视频 | 日韩免费视频一区二区视频在线观看 | 一级淫片免费 | 亚洲精品日韩在线观看 | 国产又粗又黄又爽视频 | 午夜一区二区三区免费观看 | 91成人免费观看 | 三级中文字幕 | 亚洲最大激情网 | 天天干天天色 | 欧美风情第一页 | 国产精品第一页在线观看 | 免费日韩精品 | 黄色高潮视频 | 一区日韩| 亚洲美女福利 | 午夜污污| 色哟哟一区二区 | 久久视频网 | 天天曰 | 亚洲天堂一区二区 | 成年人看的黄色片 | 五月天色视频 | 国产激情视频 | 黄色三级生活片 | 国产高潮流白浆喷水视频 | 亚洲一区二区电影 | 熟妇人妻中文字幕 | 网站一区二区 | 美女福利视频在线 | 亚洲又粗又长 | 人妻av无码一区二区三区 | 四虎在线播放 | 亚洲8888| 天天舔天天爱 | 日本福利片在线观看 | 在线观看欧美日韩 | 韩日精品中文字幕 | mm131美女大尺度私密照尤果 | 91高跟黑色丝袜呻吟在线观看 | 精品一区二区三区无码视频 | 亚洲男女视频在线观看 | 五月天激情小说 | 亚洲v日韩v综合v精品v | 日韩三级免费观看 | 99久久国产综合 | 色01看片网 | 欧美日韩网址 | 老牛嫩草二区三区观影体验 | 亚洲国产一二 | 久久成人人人人精品欧 | av在线免费观看一区 | 丰满少妇一区二区 | www.久久av.com| 天天做天天爱天天爽 | 久久久性色精品国产免费观看 | 成人黄色网址在线观看 | 日韩欧美一区二区三区免费观看 | 久久黄色小说 | 国产网站免费在线观看 | 国产麻豆一区二区三区在线观看 | 激情总合网 | 精久久久久久久 | 极品销魂美女一区二区三区 | 久久久久毛片 | 国产精品白嫩白嫩大学美女 | 韩国欧美三级 | 精品国产无码在线观看 | 日本xxxxxxxxx| 日韩女同互慰一区二区 | 国产极品久久久 | 黄色性情网站 | 国产无遮挡又黄又爽免费网站 | 亚洲尻逼 | 最新版天堂资源在线 | 中国av免费看 | 2019国产在线 | 青青青视频在线 | 天天干天天草天天射 | 真实的中国女人做爰 | 国产真实伦对白全集 | 亚洲成人www| 怡春院视频 | www.中文字幕av | 成人精品福利视频 | 亚洲高清在线视频 | 国产精品无码久久久久久 | 欧美一级黑人 | 黑人精品无码一区二区三区 | 国产精品嫩草69影院 | 色屁屁 | av美女网站| 致命魔术电影高清在线观看 | 日韩少妇诱惑 | 欧美毛片免费看 | 免费91视频 |