Classical code-single table cipher system

Source: Internet
Author: User

If the same plaintext letter in a different position in the clear text is the same as the corresponding ciphertext in the ciphertext, it is called a single-table cryptosystem.

Representative single-table password:

1. Shift or add password

2. Multiplier or multiplication password

3. Affine password

4. Key phrase password

Here is an example:

1. Addition Cipher algorithm:

P=c=k=zm (zm∈{0,1,..., m-1})

Ek (x) =x+k (mod m) =y∈c

Dk (y) =y-k (mod m) =x∈p

When k=3, the cipher algorithm is the Caesar password.

E3 (1) =1+3 (mod 26) =4 1 for a,4 on behalf of D, so the plaintext A is encrypted to D

D3 (4) =4-3 (mod 26) =1 so the ciphertext D, decrypted into plaintext a

This algorithm is susceptible to only ciphertext attack, the algorithm shows that the probability of the key is M, if it is an English alphabet, only 26 letters, then just try 25 (not including 0, because M=0 is the plaintext) key, you can crack the algorithm.

2. Multiplication cipher algorithm

P=c=zm

K={a∈zm | (A, m) =1}

Ea (x) =ax (mod m) =y∈c

Da (y) =a-1y (mod m) =x∈p

(A-1 is a multiplication inverse for m)

When M=26,

P=c=z26,

k={a∈z26 | (A, 26) =1},

Ea (x) =ax (mod) =y∈c

Da (y) =a-1y (mod) =x∈p

(A-1 is a multiplication inverse for 26)

When A=9,

Inverse Meta a-1=3

E9 (x) =9x (mod) =y∈c

D9 (y) =3y (mod) =x∈p

Encryption process: Character B, corresponding x=1 y=e9 (x) =9*1 (mod 26) =9 replaced by character J

Decryption process: Character J, corresponding to y=9 x=d9 (x) =9*3 (mod 26) =1 revert to character B

For a multiplier cipher, the crypto transformation is a one-to-one mapping when and only if a and 26 are mutually interdependent.

So a choice of only 11 kinds: 3,5,7,9,11,15,17,19,21,23,25, there are only 11 possible keys!

3. Affine cipher algorithm:

P=c=zm

K={(A, b) ∈zmxzm| ( A,M) =1}

E (b) (x) =ax + b (mod m)

D (A, b) (y) =a-1 (y-b) (mod m)

When A=1, becomes the addition password

When B=0, it becomes the multiplication password

Therefore, the addition password and the multiplication password are the special cases of the affine cipher.

Set (A, B) = (7,3)

7-1=15

If encrypted plaintext: hot, first convert the letter h,o,t into a digital 7,14,19

4. Key phrase cipher algorithm:

A word-based word-exchange-key table

Take Atmosphere as the key

Remove the duplicate letter E

Get atmospher

Place it somewhere in the alphabet.

KLNQUVWXYZatmospherbcdfgij

ABCDEFGHIJKLMNOPQRSTUVWXYZ Original Alphabet

If the plaintext is Apple, then the ciphertext is Kqqbs

If the plaintext letter is not associated with the substituted ciphertext, then the entire word changer is the key, when the key space is 26! , it is almost impossible to decipher by means of poor lifting.

Classical code-single table cipher system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.