#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2011
    Posts
    144
    Rep Power
    60

    A first prototype draft of the pen&paper stream cipher "zxp-Enigma"


    This is a first prototype draft of the pen&paper stream cipher "zxp-Enigma".

    It is meant as a manually processed stream cipher, but still
    simple to handle.


    Prerequisites:
    --------------
    - several 26 letter English alphabet Scrabble or Bananagram tiles (A-Z)
    - a ruler as large as one complete alphabet
    - an item as counter, a penny for instance
    - a bag for shaking the tiles
    - a Vigenere table (Tabula Recta) of the 26 letter English alphabet
    - pen and paper (optional)


    Actually it is based on the same technique as with my previous
    approach named "zxp". Basically it consist of two mixed up 26 letter
    alphabets lined up in two rows, one above the other which get scrambled
    and mixed constantly.

    From such an "internal state" we calculate the keystream.

    In this prototype draft I am only describing the PRGA (Pseudo Random
    Generation Algorithm). The KSA (Key Schedule Algorithm) will follow soon.
    In fact the PRGA is needed first as it is an essential part of the KSA.

    A first very simplistic example implementation in HTML/JavaScript is
    available here

    zxp-Enigma_v20181026.html

    If you prefer you can download the file and run it locally.

    These are the checksums of zxp-Enigma_v20181026.html

    MD5 0d7ef36eb5d0e3688e0f3a9e06036803
    SHA1 0479890fa59ab9819dc72c9af7033a985c715a52
    SHA256 6a578f4796e57de6e640c143c40e843f600f12e930c91d5fad384adb3c81e061

    For those who prefer an anonymous download:

    * the source code of the HTML/JavaScript zxp-Enigma example
    implementation

    Plain view
    Download version

    The definition as HTML page with some colourisation of the letter swapping

    zxp-Enigma_Definition

    * the zxp-Enigma Definition as colourised HTML page

    Colourised Definition plain view
    Colourised Definition Download



    The mentioned HTML/JavaScript implementation offer tests on the
    generated keystream like


    Chi-squared
    Durbin-Watson statistic
    Shannon's entropy
    Chars per run
    Index of coincidence
    Dependence Chi-squared of consecutive letters
    Letter frequency chart
    N-Gram statistics with variable N-Gram size




    First test showing some quite good results.

    Initial State
    JVIOTETSEGONMPYVQMWXLRDCIWYAZZGSKDFHKJULNRCQXUBPFBAH

    Secret key swap selection
    ZXM

    Keystream length
    600

    Code:
    Tests applied to the letter output with number of characters: 600 
    Chi-squared (less than 34.4 is good) = 18.539 
    Durbin-Watson statistic (should be close to 2.0) = 1.9509 
    Shannon's entropy (should approach 4.7) = 4.6791 
    Chars per run (should be close to 2.0) = 2.0066 
    Index of coincidence (as low as 0.03846 for random, around 0.066 for English text) = 0.0380 
    Dependence Chi-squared of consecutive letters (less than 671 is good) = 626.44

    Code:
    Letter frequency chart 
    
    A =   22 | #####################################--------------------------------------------------------------- 
    B =   17 | #############################----------------------------------------------------------------------- 
    C =   19 | ################################-------------------------------------------------------------------- 
    D =   20 | ##################################------------------------------------------------------------------ 
    E =   21 | ####################################---------------------------------------------------------------- 
    F =   23 | #######################################------------------------------------------------------------- 
    G =   29 | #################################################--------------------------------------------------- 
    H =   20 | ##################################------------------------------------------------------------------ 
    I =   26 | ############################################-------------------------------------------------------- 
    J =   34 | #########################################################------------------------------------------- 
    K =   20 | ##################################------------------------------------------------------------------ 
    L =   27 | #############################################------------------------------------------------------- 
    M =   27 | #############################################------------------------------------------------------- 
    N =   20 | ##################################------------------------------------------------------------------ 
    O =   25 | ##########################################---------------------------------------------------------- 
    P =   21 | ####################################---------------------------------------------------------------- 
    Q =   24 | ########################################------------------------------------------------------------ 
    R =   23 | #######################################------------------------------------------------------------- 
    S =   19 | ################################-------------------------------------------------------------------- 
    T =   22 | #####################################--------------------------------------------------------------- 
    U =   32 | ######################################################---------------------------------------------- 
    V =   18 | ##############################---------------------------------------------------------------------- 
    W =   23 | #######################################------------------------------------------------------------- 
    X =   24 | ########################################------------------------------------------------------------ 
    Y =   23 | #######################################------------------------------------------------------------- 
    Z =   21 | ####################################----------------------------------------------------------------
    Code:
    N-Gram statistics - first 30 results
    
      1    TJ    4    0.67% 
      2    JF    4    0.67% 
      3    GE    4    0.67% 
      4    HA    4    0.67% 
      5    XG    4    0.67% 
      6    UC    4    0.67% 
      7    UM    4    0.67% 
      8    TT    3    0.5% 
      9    TY    3    0.5% 
     10    QF    3    0.5% 
     11    QO    3    0.5% 
     12    AU    3    0.5% 
     13    NM    3    0.5% 
     14    FY    3    0.5% 
     15    GG    3    0.5% 
     16    GI    3    0.5% 
     17    SA    3    0.5% 
     18    XJ    3    0.5% 
     19    BJ    3    0.5% 
     20    UQ    3    0.5% 
     21    UU    3    0.5% 
     22    UV    3    0.5% 
     23    PB    3    0.5% 
     24    VG    3    0.5% 
     25    LS    3    0.5% 
     26    LV    3    0.5% 
     27    LL    3    0.5% 
     28    ZN    3    0.5% 
     29    ZX    3    0.5% 
     30    DP    3    0.5%
    Last edited by Karl-Uwe Frank; November 3rd, 2018 at 05:01 PM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2011
    Posts
    144
    Rep Power
    60
    A crude and simplistic animation that illustrate how "zxp Enigma" works,
    because I think it's easier to see it in action in order to understand how
    to handle it manually.

    The animation is basically a HTML/CSS/JavaScript page which you can run
    in your browser, either online or after download locally by just
    dragging the downloaded file onto your browser.

    The online version is over here

    zxp-Enigma_v20181026-Animation

    Versions for download here

    Plain view
    Download version

    If you like to watch the animation without the text describing each step
    just set the "Keystream animation delay" < 1000 ms.

    Also the "dead swaps" are better colourised now.

    Please keep in mind that a monospace font is required to justify all
    elements properly.

IMN logo majestic logo threadwatch logo seochat tools logo