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

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

凯撒密码pythin密码_凯撒密码术

發(fā)布時(shí)間:2025/3/11 编程问答 47 豆豆
生活随笔 收集整理的這篇文章主要介紹了 凯撒密码pythin密码_凯撒密码术 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

凱撒密碼pythin密碼

Caesar cipher is one of the well-known techniques used for encrypting the data. Although not widely used due to its simplicity and being more prone to be cracked by any outsider, still this cipher holds much value as it is amongst the firstly developed encryption techniques which gave us the idea of developing the entire encryption and decryption process.

凱撒密碼是用于加密數(shù)據(jù)的眾所周知的技術(shù)之一。 盡管由于其簡(jiǎn)單性而未被廣泛使用,并且更容易被任何外人破解,但該密碼仍然具有很大的價(jià)值,因?yàn)樗亲钤玳_(kāi)發(fā)的加密技術(shù)之一,使我們有了開(kāi)發(fā)整個(gè)加密和解密過(guò)程的想法。

Now, talking about its characteristics and details, Caeser cipher is also known as "shift cipher". This is because, in this technique, we just shift the letters of the plain text to a certain number, (which is determined by the key) in a lexicographic order to obtain the ciphertext. The same number of letters in reverse lexicographic order is shifted back in the decryption process to obtain the plain text back.

現(xiàn)在,談到其特征和細(xì)節(jié), Caeser密碼也被稱為“移位密碼” 。 這是因?yàn)?#xff0c;在這種技術(shù)中,我們只是按照字典順序?qū)⒓兾谋镜淖帜敢苿?dòng)到某個(gè)數(shù)字(由密鑰確定)以獲取密文。 在解密過(guò)程中,將相同數(shù)量的字母按逆序字典順序移回以獲取純文本。

The following key points can be drawn for the Caeser cipher,

可以為Caeser密碼得出以下要點(diǎn),

  • Caesar Cipher is also known as a shift cipher.

    凱撒密碼也被稱為移位密碼。

  • It is a type of symmetric-key cryptography.

    它是一種對(duì)稱密鑰密碼術(shù) 。

  • It follows the mono-alphabetic cipher, being a part of the substitution cipher.

    它遵循單字母密碼,是替代密碼的一部分。

加密過(guò)程 (Encryption Process)

Here, we assume the numbers 0-25 represent the English alphabets in lexicographic order, i.e. from a to z.

在這里,我們假設(shè)數(shù)字0-25代表按字母順序排列的英語(yǔ)字母,即從a到z 。

Suppose, we have number denoting the letters of plain text denoted by 'P', and a key, say 'K' (Note that it is better to choose key within the range of alphabets: 0 to 25).

假設(shè)我們有一個(gè)數(shù)字,表示由'P'表示的純文本字母,一個(gè)鍵稱為'K' (請(qǐng)注意,最好在字母范圍0到25之間選擇鍵)。

Therefore, the encryption on the plain text to convert it into ciphertext is performed as follows,

因此,對(duì)純文本進(jìn)行加密以將其轉(zhuǎn)換為密文的過(guò)程如下:

E (P, K) = ( P + K ) mod 26

解密過(guò)程 (Decryption Process)

Here also, the numbers 0-25 represent the English alphabets in lexicographic order, i.e. from a to z, and we choose the same key 'K' that we used to encrypt our data. Suppose we denote the numbers representing the letters of the ciphertext using 'C'.

同樣,這里的數(shù)字0-25表示按字母順序排列的英語(yǔ)字母,即從a到z ,我們選擇用于加密數(shù)據(jù)的相同密鑰“ K” 。 假設(shè)我們用'C'表示代表密文字母的數(shù)字。

The decryption of the ciphertext to convert it back into plain text is performed as follows,

解密密文以將其轉(zhuǎn)換回純文本的過(guò)程如下:

D (C, K) = ( C - K ) mod 26

示例問(wèn)題 (Example Problem)

Given Plain text: 'HELLO'Key: 3Convert the given plain text into ciphertext:Solution:We write all the numbers associated with every letter of the plain text:H : 7E : 4L : 11O : 14Therefore, applying the Caeser cipher for each letter:E(H,3) = ( 7 + 3 ) mod 26= 10 = KE(E, 3) = ( 4 + 3) mod 26= 7 = HE(L, 3) = ( 11 + 3) mod 26= 14 = OE(O, 3) = ( 14 + 3) mod 26= 7 = RTherefore, the ciphertext that we get for the word 'HELLO' is 'KHOOR'.

Note: You can cross-check your answer by applying the decryption process over the ciphertext, and if it comes back to be the same as the plain text, then it means that our answer is correct.

注意:您可以通過(guò)對(duì)密文應(yīng)用解密過(guò)程來(lái)交叉檢查您的答案,如果它與純文本相同,則表明我們的答案是正確的。

翻譯自: https://www.includehelp.com/cryptography/caesar-cipher.aspx

凱撒密碼pythin密碼

總結(jié)

以上是生活随笔為你收集整理的凯撒密码pythin密码_凯撒密码术的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。