SHARE
TWEET

Untitled

a guest Mar 4th, 2020 6 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %AUTOPREVIEW
  2. \documentclass{article}
  3. \usepackage{graphicx}
  4. \usepackage{titlesec}
  5. \usepackage{titling}
  6.  
  7. \renewcommand{\maketitle} {
  8.  \begin{center}
  9.    \huge\bfseries
  10.    \thetitle
  11.  \end{center}
  12. }
  13.  
  14. \titleformat{\section}
  15.            {\large\bfseries}
  16.            {}
  17.            {0em}
  18.            {}[\titlerule]
  19.  
  20. \titleformat{\subsection}
  21.            {\bfseries}
  22.            {}
  23.            {0em}
  24.            {}
  25.  
  26. \begin{document}
  27. \title{LC4 Guide}
  28. \maketitle
  29.  
  30. \section{General Info}
  31. LC4 permits only 36 symbols to be used, they are:
  32.  \begin{center}``\#\_23456789abcdefghijklmnopqrstuvwxyz''\end{center}
  33. You can swap them out for other symbols if you like, but make sure the recipient has a matching set of tiles. Do not modify the numbers on the tiles. The author omitted `1' and `0' to avoid confusion with `l', `I', and `o' in handwriting.
  34.  
  35. LC4 makes use of a marker and a 6x6 grid of tiles, the page containing these should be printed out and cut into evenly sized squares. Doing this without them would be exceedingly tedious. Anything will suffice for a marker, provided it can sit on top of a tile without obscuring it. Because shuffling and manipulating pieces of paper is tedious, it may be worth using these as stickers on scrabble pieces or printing them on card.
  36.  
  37. \section{Preparation}
  38. Do this once per recipient. While the same key+signature can be shared with multiple people, if one of them is compromised then your communication with all others will be too.
  39.  
  40. \subsection{Choose \& Share a Signature with the Recipient}
  41. Signatures aren't anything special, they just can't be known to the adversary. Their only function is to check if the ciphertext was altered during transmission, if it was then the signature will not match what it should be. They should be $\ge10$ symbols long and do not need to be random, but that would make them harder to guess. If the signature is known, it means your messages might be altered during transmission. Secretly share this with the recipient. You will reuse this in future messages with that recipient until it becomes known to the adversary.
  42.  
  43. \subsection{Generate \& Share a Key with the Recipient}
  44. Shuffle the tiles well, a good shuffle \textit{really} matters. Lay them out in a 6x6 square. Read them off left-to-right and top-to-bottom and this is a key. Secretly share this with the person who will recieve your messages. You can reuse this for up to 46,000 messages with the recipient, if used for more messages the probability of the same nonce being generated twice is too high.
  45.  
  46. \pagebreak
  47. \section{Encryption}
  48. Encryption is performed character-by-character, with each character becoming another. The grid and marker's position will be altered each time a single character is encrypted. To encrypt a sequence of characters, encrypt each character in it from left-to-right. We will call the unencrypted character the plaintext character, and the encrypted character the ciphertext character.
  49.  
  50. \begin{enumerate}
  51.  \item \textbf{Find the ciphertext character from the plaintext character according the the marker's tile's numbers\label{pt-to-ct}}
  52.    \begin{enumerate}
  53.    \item Find the plaintext character in the grid.
  54.    \item From that tile, count to the right the number of tiles shown at the right of the tile under the marker. If you reach the end of the row, continue to the leftmost tile of the same row.
  55.    \item From this new position, count down the number of tiles shown at the bottom of the tile under the marker. If you reach the bottom of the column, continue to the topmost tile of the same column.
  56.    \item The tile you have found in this way is the ciphertext character, write it down unless you're encrypting the nonce.
  57.    \end{enumerate}
  58. \item \textbf{Right-rotate the plaintext row} Find the plaintext character in the grid again, shift every tile in that row one position to the right (with the rightmost tile moving to the now-empty leftmost position). This may cause the marker to move, this is ok.
  59. \item \textbf{Down-rotate the ciphertext column} Find the ciphertext character in the grid, shift every tile in that column one position downwards (with the bottommost tile moving to the now-empty topmost position). This may cause the marker to move, this is ok.
  60.  \item \textbf{Move the marker according to the ciphertext tile's numbers} From the tile the marker is currently on, move it right by the number of tiles shown on the right of the ciphertext tile and then down by the number of tiles shown on the bottom of the ciphertext tile. If you reach the end of a row or column, continue counting from the start of the same row or column as before.
  61. \end{enumerate}
  62.  
  63. \section{Decryption}
  64. Decryption is almost the same as encryption, only step \ref{pt-to-ct} differs. Procede as normal, but during step \ref{pt-to-ct} you will know the ciphertext character already and need to find the plaintext character. Find the plaintext character from the ciphertext character according to the marker's tile's numbers by counting left from the ciphertext character the number of tiles shown on the right of the tile under the marker, and then counting up from there the number of tiles shown on the bottom of the tile under the marker. Wrap back to the start of the same row/column as usual if you would otherwise move off the edge.
  65.  
  66. \section{Sending a Message}
  67. \begin{enumerate}
  68.  \item \textbf{Generate a nonce} Shuffle the tiles well, draw one and write it down, place it back into the pile. Repeat until you have $\ge6$ symbols. Do not reuse this.
  69.  \item \textbf{Lay out the grid} Using the key you have previously secretly shared with the recipient, lay out a 6x6 grid from left-to-right and top-to-bottom. Place the marker on the top-left tile.
  70.  \item \textbf{Encrypt the nonce} Don't write down the ciphertext this produces, the point of this step is to mix up the grid.
  71.  \item \textbf{Encrypt the plaintext} Write down the ciphertext this produces.
  72.  \item \textbf{Encrypt the signature} Append the ciphertext this produces to the ciphertext produced in the previous step.
  73.  \item \textbf{Transmit} Transmit the unencrypted nonce, and then the ciphertext. Neither are secret.
  74. \end{enumerate}
  75.  
  76. \section{Recieving a Message}
  77. \begin{enumerate}
  78.  \item \textbf{Lay out the grid} As above.
  79.  \item \textbf{Encrypt the nonce} As above. Note that you encrypt the nonce, not decrypt it, because you already know it. It is transmitted unencrypted and is not secret.
  80.  \item \textbf{Decrypt the ciphertext} Write down the plaintext this produces, this will be the original message followed by the signature.
  81.  \item \textbf{Check that the signature is correct} If the signature is not as expected then discard the message as it was corrupted during transmission.
  82. \end{enumerate}
  83.  
  84. \section{Caveats}
  85. If a plaintext/ciphertext pair is known to the adversary, they can derive your key (still a lot of effort, but doable) and know your signature. Change both.
  86.  
  87. \section{Example}
  88. \textbf{Key} xv7ydq\#opaj\_39rzut8b45wcsgehmiknf26l\\
  89. \textbf{Signature} \#rubberducky\\
  90. \textbf{Nonce} bw6ib7\\
  91. \textbf{Plaintext} this\_is\_a\_test\_of\_lc4\\
  92. \textbf{Ciphertext} r3qicv\_iypnlnywas3\_qn\#rwmtwlwhwuu
  93.  
  94. \pagebreak
  95.  
  96. \begin{figure}
  97.  \includegraphics[width=\textwidth]{all.jpg}
  98. \end{figure}
  99.  
  100. \end{document}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top