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

    Join Date
    Jul 2011
    Posts
    142
    Rep Power
    59

    Scrabbled Vigenere Cipher with IV


    It's merely just a fun project and nothing serious, but I like to share
    my idea of a new pen and paper cipher based on the Tabula Recta and
    Scrabble Tiles. Eventually I was inspired by the KISScipher proposed by
    "Nikko" some time ago.


    The main difference of this new approach is that we use the Scrabble
    Tiles to generate a unique keystream which is then applied to the
    plaintext via the classic Tabula Recta.

    Reason for doing so is that we want a pseudo-random keystream which is
    independent of the plaintext in order to avoid any correlation.


    In addition to the before mentioned schemes I add an IV (Initialisation
    Vector) which is used in combination with the pre-shared secret key to
    generate a potentially unique keystream for each message encrypted.

    The idea is to mimic a self-modifying polyalphabetic substitution stream
    cipher like RC4.

    Because it would become quite a fairly lengthy posting I separated the
    three parts and published them elsewhere. Just follow the links for
    details.


    Okay then, let's start with description and example.

    The process itself is split in three parts

    Part 1 - Applying the secret key (debian Pastezone)

    Part 2 - Applying the IV (debian Pastezone)

    Part 3 - Encryption (debian Pastezone)



    Finally comparing the initial against the final internal state reads

    Code:
    .-----------------------------------------------------.
    | R L Q X U B P F Q Z H J V I T O E T S D G O N M P Y |
    .-----------------------------------------------------.
    | V B C W X C R E M I W Y A A K Z S G D F H K J U L N |
    .-----------------------------------------------------.
    
    .-----------------------------------------------------.
    | H C R D M O U N A A K Z F G E F T Z J Q L N R L B W |
    .-----------------------------------------------------.
    | X Q V S U K X J V I T I E H S D G O Y M B Y P P C W |
    .-----------------------------------------------------.


    For decrypting the ciphertext the receiver performs the keysteam
    generation the same way as for encryption, and then apply the ciphertext
    to the Tabula Recta.


    But we can see the pattern A A K Z moving from the bottom to the top
    row. I suppose that it will vanish due to a more extensive shuffle of
    the internal state if the plaintext is longer.

    Or perhaps I should consider a better way for swapping the characters.
    But well, it's just a first idea.

    So the questions regarding a cryptanalysis are

    - If Eve does know the complete plaintext and therefore the keystream
    would she be able to reverse calculate the secret key?

    - And if yes, how could it be done?


    I hope the reader can follow the example and understand the idea behind.

    Also I hope that I did not made too many errors handling this ordeal in
    preparing the step by step example.


    Cheers,
    Karl-Uwe
    Last edited by Karl-Uwe Frank; August 13th, 2017 at 08:58 AM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2011
    Posts
    142
    Rep Power
    59
    This is the improved version of the swapping while encryption of the
    plaintext.

    Perhaps more simple to process and potentially slightly more secure due
    to a more random swap based on each ciphertext character. Also this way
    any pattern should vanish quite fast unlike with the first version.


    You may find a detailed description here

    debian Pastezone
    Last edited by Karl-Uwe Frank; August 16th, 2017 at 04:56 AM.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2011
    Posts
    142
    Rep Power
    59
    Part 2 - Applying the IV (debian Pastezone)

    I like to add the remark that the current way the IV is shuffled into
    the internal state is not sufficiently secure, because Eve can trace the
    position of each of the IV characters quite easily.

    Therefore as an additional step we need a second secret key with which
    the IV is encrypted before applying it into the internal state.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2011
    Posts
    142
    Rep Power
    59
    As we all know a resistance against know plaintext attacks
    is one of the important properties of a good cipher algorithm.

    We must always consider that Eve may has knowledge not only of
    parts but the complete plaintext. In this case she knew the complete
    keystream for a given message. A weak cipher would allow her a
    reverse calculation of the internal state (alphabet permutation)
    and potentially a key retrieval.

    Now lets check how this would become possible with the
    recent cipher design of the algorithm published.

    If we take a closer look at the step-by-step example over here
    debian Pastezone
    we can realise that the first letters of the keystream are effectively
    a large part of the internal states beginning of the bottom row.
    This indicates that the swapping of letters is not correctly designed.

    Well as we know this is the final permutation (internal state) after
    the secret key and the IV were mixed in.

    Code:
    #) final permutation
    
    .-----------------------------------------------------.
    | R L Q X U B P F Q Z H J V I T O E T S D G O N M P Y |
    .-----------------------------------------------------.
    | V B C W X C R E M I W Y A A K Z S G D F H K J U L N |
    .-----------------------------------------------------.
    if we take a further look at the ciphertext at row 995
    and place the keystream (KS) used so far for encryption
    between plaintext (PT) and ciphertext (CT) it's quite
    obvious that the random swapping of letter does not
    have the desired effect of keeping the internal state
    unknown.

    Code:
    .-----------------------------------------------------.
    | J V I O T E T S E G O N M P Y V Q M W X L R D C I W |
    .-----------------------------------------------------.
    | Y A Z Z G S K D F H K J U L N R C Q X U B P F B A H |
    .-----------------------------------------------------.
      | 
      .-----------------------\
                               Y
    PT = T H I S I S M Y H I G H LYSECRETINFORMATION
    KS = V B C W X C R E M I W Y
    CT = O I K O F U D B T Q C F
    
    .-----------------------------------------------------.
    | . . . . . . . . . . . . . . . . . . . . . . . . . . |
    .-----------------------------------------------------.
    | V B C W X C R E M I W Y . . . . . . . . . . . . . . |
    .-----------------------------------------------------.
    What would help preventing this unwanted behaviour?

    Of course a simple change in the swapping order.

    Still we move the keystream letter after applying to the plaintext
    for the lower left position to the upper right - including the necessary
    shift and rollover of letters. But now we take the upper left letter as
    'index pointer' for the first swap.


    Code:
    #-------------------------------------------------------------
    #) perform the encryption of the first plaintext character
    
    .-----------------------------------------------------.
    | R L Q X U B P F Q Z H J V I T O E T S D G O N M P Y |
    .-----------------------------------------------------.
    | V B C W X C R E M I W Y A A K Z S G D F H K J U L N |
    .-----------------------------------------------------.
      | 
      .--.
         |
         V
    PT = T HISISMYHIGHLYSECRETINFORMATION
    CT = O
    
    
    #) now update the internal state by a character swapping
    
      * remove the keystream character from the bottom row
     
    .-----------------------------------------------------.
    | R L Q X U B P F Q Z H J V I T O E T S D G O N M P Y |
    .-----------------------------------------------------.
    |   B C W X C R E M I W Y A A K Z S G D F H K J U L N |
    .-----------------------------------------------------.
      V
    
      * shift the bottom row to the left
     
    .-----------------------------------------------------.
    | R L Q X U B P F Q Z H J V I T O E T S D G O N M P Y |
    .-----------------------------------------------------.
    | B C W X C R E M I W Y A A K Z S G D F H K J U L N   |
    .-----------------------------------------------------.
      V
     
      * place the keystream first character of the top row the end of the bottom row
     
      |
    .-----------------------------------------------------.
    |   L Q X U B P F Q Z H J V I T O E T S D G O N M P Y |
    .-----------------------------------------------------.
    | B C W X C R E M I W Y A A K Z S G D F H K J U L N R |
    .-----------------------------------------------------.
      V                                                 |
    
      * shift the top row to the left
    
    .-----------------------------------------------------.
    | L Q X U B P F Q Z H J V I T O E T S D G O N M P Y   |
    .-----------------------------------------------------.
    | B C W X C R E M I W Y A A K Z S G D F H K J U L N R |
    .-----------------------------------------------------.
      V
    
      * fill in the remaining character V at the end of the top row
    
    .-----------------------------------------------------.
    | L Q X U B P F Q Z H J V I T O E T S D G O N M P Y V |
    .-----------------------------------------------------.
    | B C W X C R E M I W Y A A K Z S G D F H K J U L N R |
    .-----------------------------------------------------.
    
      * search for both characters L (now the first character at the top left side)
      |                                             |
    .-----------------------------------------------------.
    | L Q X U B P F Q Z H J V I T O E T S D G O N M P Y V |
    .-----------------------------------------------------.
    | B C W X C R E M I W Y A A K Z S G D F H K J U L N R |
    .-----------------------------------------------------.
    
      * remove both characters below and above
      |                                             |
    .-----------------------------------------------------.
    | L Q X U B P F Q Z H J V I T O E T S D G O N M   Y V |
    .-----------------------------------------------------.
    |   C W X C R E M I W Y A A K Z S G D F H K J U L N R |
    .-----------------------------------------------------.
      B                                             P
      
      * swap both characters
      |                                             |
    .-----------------------------------------------------.
    | L Q X U B P F Q Z H J V I T O E T S D G O N M B Y V |
    .-----------------------------------------------------.
    | P C W X C R E M I W Y A A K K S G D F H Z J U L N R |
    .-----------------------------------------------------.
    This way the leftmost character in the bottom row which
    is taken as cipherkey for encrypting the next plaintext character
    will be random. And the keystream does not reflect large parts
    of the internal state anymore.

    Additionally the second swap based on the 8th character from
    left of the top row should be performed as well in order to mix
    up the internal state more thoroughly.

    Code:
      * search 8th character from the top left side)
                    |  
    .-----------------------------------------------------.
    | L Q X U B P F Q Z H J V I T O E T S D G O N M B Y V |
    .-----------------------------------------------------.
    | P C W X C R E M I W Y A A K K S G D F H Z J U L N R |
    .-----------------------------------------------------.
    
    
      * search for the second characters Q
        |           |  
    .-----------------------------------------------------.
    | L Q X U B P F Q Z H J V I T O E T S D G O N M B Y V |
    .-----------------------------------------------------.
    | P C W X C R E M I W Y A A K K S G D F H Z J U L N R |
    .-----------------------------------------------------.
    
    
      * remove both characters below
        |           |  
    .-----------------------------------------------------.
    | L Q X U B P F Q Z H J V I T O E T S D G O N M B Y V |
    .-----------------------------------------------------.
    | P   W X C R E   I W Y A A K K S G D F H Z J U L N R |
    .-----------------------------------------------------.
        C           M
    
      * swap both characters
        |           |  
    .-----------------------------------------------------.
    | L Q X U B P F Q Z H J V I T O E T S D G O N M B Y V |
    .-----------------------------------------------------.
    | P M W X C R E C I W Y A A K K S G D F H Z J U L N R |
    .-----------------------------------------------------.

IMN logo majestic logo threadwatch logo seochat tools logo