Help to programmatically and mathematics to C! (Please pay freereply)

xiaoxiao2021-03-06  92

Help to programming masters and mathematics masters! (Please pay free / reply)

Help to programming masters and mathematics masters! (This will pay freely)

The younger brother read a book in Germany, and the professor had a card with an addendum, about the "vigenère-cipher" problem, that is, the Di Qiong Neval cipher method, the proposition is as follows:

Ciphertext is known to "wgpkykvrythhdxsl", key length and content I don't know, I know clear text contains characters "Sind", selecting the right way to guess the key. Use the C language to write the program.

(The younger brother asked the classmates, saying that you can try with the exhaustion, such as A, B, C ... AA, AB, AC ... AAA, AAB, AAC ..., etc. Forget, I can't picked up for a while, so I would like to help, write a program, thank you.) Annex 2 appendix, there is a need to understand this encryption mechanism and programmed assistance.

Appendix 1: The Principle of the Encryption of the Vioja Netecation Method. Appendix 2: The encryption process of "Vi Jones Cipher Method" C language program, the younger brother rewritten, compiled and verified correct.

*********************************************************** *************

Appendix 1: Vi Jones password method is composed of multiple sets of alphabet alternative cryptography, let us first observe the following table, the lower line of the top line of Vi Jones is the original letter, followed by the second The sixteen sets of password letters, each set is moving it backwards behind the letter. Each key letter corresponds to a row of ciphertext with it. Each row of ciphertext and the top text of the top line constitute a CDM of the Caesar password, a total of 26 lines of secret, so there are 26 transformation tables, they represent "post-moving 1", "post-moving 2 "..." post-moving 26 "Caesar password.

For example, now use House as a keyword, in order, in order, in order to re-encrypt the text new generation, it is the ciphertext encrypted by the Violi nerocode method (detailed table) . In short, it is (明文 key) and 26 models = Cipheet.

Keyword H O U S EH O U S E H O U Found N E W G E N E R A T I O N Ciplet U S q y i u s L s x P c h

It can be seen that in its clear text, it is also n, which can be encrypted into U and H, and in ciphertext, it is also S, but represents E and A two words, respectively.

In this way, it is largely eliminated the threat of the frequency analysis method in the form of a single set of alphabetical cryptography, which has become very difficult to break, and have been maintained for more than 300 years.

Its mathematical model is:

ZG = zk zs mod 26: key: C O d E C O D E C O D E C O D EZS: 2 14 3 4 2 14 3 4 2 14 3 4 2 14 3 4 Found: P O L Y a L P h zk: 15 14 11 24 0 11 15 7 0 1 4 19 8 18 2 7 ZG: 17 2 14 2 2 25 18 11 2 15 7 23 10 6 5 11 Cipheet: R C O C C C Z S L C P h x k g f L

*********************************************************** ************* Appendix 2: C Program of the encryption process #include

MAIN () {

INT N = 0, i = 0, j = 0, k = 0; char Word_s [27] = "AbcdefghijklmnopqrStuvwxyz", Passwd [129], Message [257]; char * word = word_s, * p = passwd, * m = Message; Printf ("Cleartext:"); scanf ("% s", m); Printf ("keyword:"); scanf ("% s", p); Printf ("CODETEXT:");

While (p [n]! = '/ 0') {n = n 1;} while (m [i]! = '/ 0') {while (p [i% n]! = word [j]) {J = J 1;} while (m [i]! = Word [k]) {k = k 1;}

Printf ("% C", Word [(J K)% 26]); i = i 1; j = 0; k = 0;

}

Return 0;

}

转载请注明原文地址:https://www.9cbs.com/read-96707.html

New Post(0)