Krypton Series 4-7

Source: Internet
Author: User

Tags: Overthewire krypton

Level 4:vigenere cipher encryption, can fight word frequency statistics, need to know the password, this problem know the key length 6.


This site explains how to hack vigenere cipher encryption.

Directly copy the ciphertext to the above page, you can guess the password "Frekey".

Use this password to uncover the secret text.

Level 5: Encrypts the same level 4, but does not know the key length.

With the Level 4 decryption site, you can manually specify the key length for testing. You can also use the following Vigenere Cipher Decryption Tool Web page to automatically guess the solution:


The key is: Keylen

Decrypt the text with the key.

Level 6:LFSR Encryption

Inverse encryption algorithm:

Calculation function for Magic value: FLSR cs:reg_2543 initial value is 1.

Public LFSR LFSR proc near var_2= word ptr-2 push RBP mov RBP, RSP mov [rbp+var_2], 0 movzx eax, cs:reg_2543 mov edx, eax and edx, 1 movzx eax, cs:reg_2543 movzx eax, Ax and eax, 2 sar eax, 1 xor eax, edx mov [rbp+var_2], ax movzx eax, Cs:reg_  2543 shr ax, 1 mov edx, eax movzx eax, [rbp+var_2] shl eax, 3 or eax, edx mov cs:reg_2543, ax movzx eax, cs:reg_2543 movzx EAX, ax pop RBP retn LFSR end

the ELF x86_64 program, the encryption algorithm is: C--and capital--- -0x41-+key[i] (0-9 cycles)--+magic--- -0x41 until value -0x1a --+0x41

Clear Text test:

AAAAAAAAAABBBBBBBBBB bbbbbbbbbbaaaaaaaaaa Abababababababababab

Eictdgyiyzluiotjsgyz Fjduehzjzakthnsirfxy Ejcudhyjyakuhosjrgxz

The same characters can be found in different positions, the ciphertext is different, but the same characters are in the same position as the ciphertext. is actually a two-dimensional cipher table of [letter * position].

Decryption can be used in plaintext attacks, generate a 26*20 password table, and then check the table decryption.

You can also use a known algorithm to decrypt the program directly:

#include  <stdio.h>short reg = 1;char* a_en =  "Eictdgyiyzluiotjsgyz"; char* a_pl =  "aaaaaaaaaabbbbbbbbbb";char* b_en =  "FJDUEHZJZAKTHNSIRFXY"; char*  krypton7 =  "Pnuklylwrqkgkbe"; main () {        short  a = 0;        int b, c;         int i, j;        char * key[10];        short magic[20];         for (i=0, j=0; i<20; i++, j++)          {                / Algorithm simulation of/LFSR function                 b  = reg;                b &= 1;                 c = reg;                 c &=  2;                c  = c >> 1;                 a = b ^ c;                 b = reg;                 b = b >> 1;                 c = a;                 c = c << 3;                 a = b | c;//              printf ("magic: %hx\n",  a);                 reg =  a;                magic[ i] = a;                 //Compute key and verify it                  if (j >= 10)                          j = 0;                 key[j] = a_en[i] - a;                 while (key[j] < 0x41)                          key[j] += 0x1A;                 key[j] -= a_pl[i];                 printf ("magic: %hx\tkey[%d]: %hhx\ N ",  a, j, key[j]);        }         //decryption Test         for (i=0, j=0; i<20;  i++, j++)         {            &nbSp;    if (j >= 10)                          j = 0;                 b =  b_en[i] - magic[i];                 while (b < 0x41)                          b += 0x1A;                 b -=  (int)  key[j];                 while (b < 0x41)                          b += 0x1a;                 printf ("%c",  b);         }        printf ("\ n");         //decryption Krypton7        for (I=0, j=0; i<strlen (krypton7 );  i++, j++)         {                 if (j >= 10)                           j = 0;                 b = krypton7[i] - magic[i];                 while (b < 0x41)                          b += 0x1A;                 b -=   (int)  key[j];                 while (b < 0x41)                          b += 0x1A;                 printf ("%c",  b); Jia         }        printf ("\ n");}

This article is from the "Everything is a Dog" blog, please be sure to keep this source

Krypton Series 4-7

Related Article

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: and provide relevant evidence. A staff member will contact you within 5 working days.

Tags Index: