From f935a11479e308fed1ab4cc51665509a73312671 Mon Sep 17 00:00:00 2001 From: Trevor Xiao Date: Wed, 21 Apr 2021 19:34:14 -0400 Subject: Add card mapping description to the README --- README.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/README.md b/README.md index 94e33e4..d3a2a5c 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,65 @@ To run (hand-run) the encryption/decryption, you will also need some kind of a marker (e.g. a small shiny stone, bolt nut or similar kind of well-shaped trash). +#### Alternative playing-card-compatible board + +The following board can be used so that characters and offsets can be easily +mapped to playing cards, similar to the Solitaire cipher [2]. This could be +more innocuous and easily explainable to the secret police than a set of +peculiar numbered tiles. + + +``` +0 a b c d e f +g h i j k l m +n o p q r s t +u v w x y z . +, - + * / : ? +! ' ( ) _ 1 2 +3 4 5 6 7 8 9 +``` + +With this layout, the following mapping to playing cards is used: + +| Character | Card | Index | Character | Card | Index | Character | Card | Index | Character | Card | Index | +|-----------|------|-------|-----------|------|-------|-----------|------|-------|-----------|------|-------| +| a | A♦ | 1 | n | A♣ | 14 | . | A♥ | 27 | 1 | A♠ | 40 | +| b | 2♦ | 2 | o | 2♣ | 15 | , | 2♥ | 28 | 2 | 2♠ | 41 | +| c | 3♦ | 3 | p | 3♣ | 16 | - | 3♥ | 29 | 3 | 3♠ | 42 | +| ... | | | ... | | | ... | | | ... | | | +| j | 10♦ | 10 | w | 10♣ | 23 | ' | 10♥ | 39 | 7 | 7♠ | 46 | +| k | J♦ | 11 | x | j♣ | 24 | ( | j♥ | 39 | 8 | 8♠ | 47 | +| l | Q♦ | 12 | y | Q♣ | 25 | ) | Q♥ | 39 | 9 | 9♠ | 48 | +| m | K♦ | 13 | z | K♣ | 26 | _ | K♥ | 39 | 0 | 10♠ | 49 (0) | + +The (x, y) offset is calculated from the index with the usual modular +arithmetic: `x = index % 7` and `y = index / 7`. + +Note that the offset can be easily calculated from a given card: take the +order of the suit (0-3), multiply by 13, and add the card number (11-13 for +face cards, 1 for the Ace) to get the index. The offset can then be calculated +from the index. + +Alphanumeric characters can be easily mapped to cards as well, with letters +mapping to Diamonds or Clubs, and numbers mapping to Spades (and optionally +a Joker). All of the special characters are mapped to the Hearts, though +coming up with a mnemonic for the mapping of each special character to each +Heart is left as an exercise for the reader. + +For LC4, the following board could be used: + +``` +# a b c d e +f g h i j k +l m n o p q +r s t u v w +x y z _ 2 3 +4 5 6 7 8 9 +``` + +The "Hearts" suit would be ommitted from the card mappin table. `#` and `_` +would map to the Joker/10♠ and A♠, respectively. + ## How-To You may as well see the paper [1], there are also pictures. This is somewhat more concentrated: @@ -199,3 +258,4 @@ text after several characters. ## References [1] *Kaminsky, Alan. "ElsieFour: A Low-Tech Authenticated Encryption Algorithm For Human-to-Human Communication." IACR Cryptology ePrint Archive 2017 (2017): 339.* +[2] *Schneier, Bruce. ["The Solitaire Encryption Algorith"](https://www.schneier.com/academic/solitaire/). -- cgit v1.2.3 From 0583120ba857234cbaf608435c4428d0da605417 Mon Sep 17 00:00:00 2001 From: Trevor Xiao Date: Wed, 21 Apr 2021 20:04:17 -0400 Subject: Clean up description a bit --- README.md | 64 +++++++++++++++++++++++++++++++-------------------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index d3a2a5c..284f39e 100644 --- a/README.md +++ b/README.md @@ -66,46 +66,43 @@ trash). #### Alternative playing-card-compatible board The following board can be used so that characters and offsets can be easily -mapped to playing cards, similar to the Solitaire cipher [2]. This could be -more innocuous and easily explainable to the secret police than a set of -peculiar numbered tiles. +mapped to playing cards, similar to the Solitaire cipher [2]. Using playing +cards could be more innocuous and easily explainable to the secret police than +a set of peculiar numbered tiles. ``` 0 a b c d e f g h i j k l m n o p q r s t -u v w x y z . -, - + * / : ? -! ' ( ) _ 1 2 +u v w x y z _ +. , - + * / : +? ! ' ( ) 1 2 3 4 5 6 7 8 9 ``` With this layout, the following mapping to playing cards is used: -| Character | Card | Index | Character | Card | Index | Character | Card | Index | Character | Card | Index | -|-----------|------|-------|-----------|------|-------|-----------|------|-------|-----------|------|-------| -| a | A♦ | 1 | n | A♣ | 14 | . | A♥ | 27 | 1 | A♠ | 40 | -| b | 2♦ | 2 | o | 2♣ | 15 | , | 2♥ | 28 | 2 | 2♠ | 41 | -| c | 3♦ | 3 | p | 3♣ | 16 | - | 3♥ | 29 | 3 | 3♠ | 42 | -| ... | | | ... | | | ... | | | ... | | | -| j | 10♦ | 10 | w | 10♣ | 23 | ' | 10♥ | 39 | 7 | 7♠ | 46 | -| k | J♦ | 11 | x | j♣ | 24 | ( | j♥ | 39 | 8 | 8♠ | 47 | -| l | Q♦ | 12 | y | Q♣ | 25 | ) | Q♥ | 39 | 9 | 9♠ | 48 | -| m | K♦ | 13 | z | K♣ | 26 | _ | K♥ | 39 | 0 | 10♠ | 49 (0) | - -The (x, y) offset is calculated from the index with the usual modular -arithmetic: `x = index % 7` and `y = index / 7`. - -Note that the offset can be easily calculated from a given card: take the -order of the suit (0-3), multiply by 13, and add the card number (11-13 for -face cards, 1 for the Ace) to get the index. The offset can then be calculated -from the index. - -Alphanumeric characters can be easily mapped to cards as well, with letters -mapping to Diamonds or Clubs, and numbers mapping to Spades (and optionally -a Joker). All of the special characters are mapped to the Hearts, though -coming up with a mnemonic for the mapping of each special character to each +| **Character** | Card | Index | **Character** | Card | Index | **Character** | Card | Index | **Character** | Card | Index | +|-----------|------|-------|-----------|------|-------|-----------|------|-------|-----------|------|--------| +| a | A♦ | 1 | n | A♣ | 14 | _ | A♥ | 27 | 1 | A♠ | 40 | +| b | 2♦ | 2 | o | 2♣ | 15 | . | 2♥ | 28 | 2 | 2♠ | 41 | +| c | 3♦ | 3 | p | 3♣ | 16 | , | 3♥ | 29 | 3 | 3♠ | 42 | +| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | +| j | 10♦ | 10 | w | 10♣ | 23 | ! | 10♥ | 39 | 7 | 7♠ | 46 | +| k | J♦ | 11 | x | J♣ | 24 | ' | J♥ | 39 | 8 | 8♠ | 47 | +| l | Q♦ | 12 | y | Q♣ | 25 | ( | Q♥ | 39 | 9 | 9♠ | 48 | +| m | K♦ | 13 | z | K♣ | 26 | ) | K♥ | 39 | 0 | 10♠ | 49 (0) | + +The (x, y) offset can be calculated by first determining the index: take the +number of the suit (0-3), multiply by 13, and add the card number (using 1 for +the Ace, 11-13 for face cards). Then, determine the offset from the index +using the usual modular arithmetic: `x = index % 7` and `y = index / 7`. + +Alphanumeric characters can be easily mapped to cards, with letters mapping to +Diamonds or Clubs and numbers mapping to Spades (note that Spades face cards +are ommitted). All of the special characters are mapped to the Hearts, though +coming up with a mnemonic for the mapping of each special character to each Heart is left as an exercise for the reader. For LC4, the following board could be used: @@ -119,8 +116,9 @@ x y z _ 2 3 4 5 6 7 8 9 ``` -The "Hearts" suit would be ommitted from the card mappin table. `#` and `_` -would map to the Joker/10♠ and A♠, respectively. +The "Hearts" suit would be ommitted from the card mapping table, and the index +of each of the Spades would be decreased by 13 to compensate. `#` and `_` +would map to 10♠ and A♠, respectively. ## How-To @@ -257,5 +255,5 @@ text after several characters. ## References -[1] *Kaminsky, Alan. "ElsieFour: A Low-Tech Authenticated Encryption Algorithm For Human-to-Human Communication." IACR Cryptology ePrint Archive 2017 (2017): 339.* -[2] *Schneier, Bruce. ["The Solitaire Encryption Algorith"](https://www.schneier.com/academic/solitaire/). +[1] *Kaminsky, Alan. "ElsieFour: A Low-Tech Authenticated Encryption Algorithm For Human-to-Human Communication." IACR Cryptology ePrint Archive 2017 (2017): 339.* +[2] *Schneier, Bruce. ["The Solitaire Encryption Algorithm"](https://www.schneier.com/academic/solitaire/).* -- cgit v1.2.3 From 513f8312a22db2ae1e194e633a41b60dd2b2206a Mon Sep 17 00:00:00 2001 From: Trevor Xiao Date: Wed, 21 Apr 2021 20:44:30 -0400 Subject: Update lc4 script to include playing card tables --- lc4.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/lc4.py b/lc4.py index 03043a4..4a17c93 100644 --- a/lc4.py +++ b/lc4.py @@ -54,9 +54,10 @@ import argparse version = "v2.8.1 (2018-07-24)" # define alphabet -letters6 = "#_23456789abcdefghijklmnopqrstuvwxyz" -letters7 = "_abcdefghijklmnopqrstuvwxyz.0123456789,-+*/:?!'()" - +letters6 = "#_23456789abcdefghijklmnopqrstuvwxyz" +letters6card = "#abcdefghijklmnopqrstuvwxyz_23456789" +letters7 = "_abcdefghijklmnopqrstuvwxyz.0123456789,-+*/:?!'()" +letters7card = "0abcdefghijklmnopqrstuvwxyz_.,-+*/:?!'()123456789" def missing_letters(s,t): return ''.join(sorted(set(c for c in s if c not in t))) @@ -333,6 +334,8 @@ if __name__ == '__main__': mgroup1.add_argument("-6", "--lc4", help="use ElsieFour cipher (6x6 table) (default)", action="store_true") mgroup1.add_argument("-7", "--ls47", help="use LS47 cipher (7x7 table)", action="store_true") + parser.add_argument("-pc", "--playingcard", help="Use the \"playing card\" character tables (default: standard tables)", action="store_true") + mgroup2 = parser.add_mutually_exclusive_group() mgroup2.add_argument("-ks", "--keystring", metavar="STRING", help="use STRING as key") mgroup2.add_argument("-kf", "--keyfile", metavar="FILE", help="read key from FILE") @@ -375,10 +378,16 @@ if __name__ == '__main__': if args.ls47: size = 7 - letters = letters7 + if args.playingcard: + letters = letters7card + else: + letters = letters7 else: size = 6 - letters = letters6 + if args.playingcard: + letters = letters6card + else: + letters = letters6 tiles = list(zip(letters, [(x // size, x % size) for x in range(size * size)])) -- cgit v1.2.3 From 00f89c47c7963c8873bee38a1d003d1cec443c5c Mon Sep 17 00:00:00 2001 From: Trevor Xiao Date: Wed, 21 Apr 2021 20:50:08 -0400 Subject: Fix whitespace --- README.md | 1 - lc4.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 284f39e..1d24595 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,6 @@ mapped to playing cards, similar to the Solitaire cipher [2]. Using playing cards could be more innocuous and easily explainable to the secret police than a set of peculiar numbered tiles. - ``` 0 a b c d e f g h i j k l m diff --git a/lc4.py b/lc4.py index 4a17c93..5a2785f 100644 --- a/lc4.py +++ b/lc4.py @@ -59,6 +59,7 @@ letters6card = "#abcdefghijklmnopqrstuvwxyz_23456789" letters7 = "_abcdefghijklmnopqrstuvwxyz.0123456789,-+*/:?!'()" letters7card = "0abcdefghijklmnopqrstuvwxyz_.,-+*/:?!'()123456789" + def missing_letters(s,t): return ''.join(sorted(set(c for c in s if c not in t))) -- cgit v1.2.3 From 8e4e169a395257be63a80d732e6d127a53ea9976 Mon Sep 17 00:00:00 2001 From: Trevor Terris Date: Thu, 22 Apr 2021 08:51:04 -0400 Subject: Moved alternative board to a new "modifications" section --- README.md | 114 ++++++++++++++++++++++++++++++++------------------------------ 1 file changed, 58 insertions(+), 56 deletions(-) diff --git a/README.md b/README.md index 1d24595..1568b5f 100644 --- a/README.md +++ b/README.md @@ -63,62 +63,6 @@ To run (hand-run) the encryption/decryption, you will also need some kind of a marker (e.g. a small shiny stone, bolt nut or similar kind of well-shaped trash). -#### Alternative playing-card-compatible board - -The following board can be used so that characters and offsets can be easily -mapped to playing cards, similar to the Solitaire cipher [2]. Using playing -cards could be more innocuous and easily explainable to the secret police than -a set of peculiar numbered tiles. - -``` -0 a b c d e f -g h i j k l m -n o p q r s t -u v w x y z _ -. , - + * / : -? ! ' ( ) 1 2 -3 4 5 6 7 8 9 -``` - -With this layout, the following mapping to playing cards is used: - -| **Character** | Card | Index | **Character** | Card | Index | **Character** | Card | Index | **Character** | Card | Index | -|-----------|------|-------|-----------|------|-------|-----------|------|-------|-----------|------|--------| -| a | A♦ | 1 | n | A♣ | 14 | _ | A♥ | 27 | 1 | A♠ | 40 | -| b | 2♦ | 2 | o | 2♣ | 15 | . | 2♥ | 28 | 2 | 2♠ | 41 | -| c | 3♦ | 3 | p | 3♣ | 16 | , | 3♥ | 29 | 3 | 3♠ | 42 | -| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | -| j | 10♦ | 10 | w | 10♣ | 23 | ! | 10♥ | 39 | 7 | 7♠ | 46 | -| k | J♦ | 11 | x | J♣ | 24 | ' | J♥ | 39 | 8 | 8♠ | 47 | -| l | Q♦ | 12 | y | Q♣ | 25 | ( | Q♥ | 39 | 9 | 9♠ | 48 | -| m | K♦ | 13 | z | K♣ | 26 | ) | K♥ | 39 | 0 | 10♠ | 49 (0) | - -The (x, y) offset can be calculated by first determining the index: take the -number of the suit (0-3), multiply by 13, and add the card number (using 1 for -the Ace, 11-13 for face cards). Then, determine the offset from the index -using the usual modular arithmetic: `x = index % 7` and `y = index / 7`. - -Alphanumeric characters can be easily mapped to cards, with letters mapping to -Diamonds or Clubs and numbers mapping to Spades (note that Spades face cards -are ommitted). All of the special characters are mapped to the Hearts, though -coming up with a mnemonic for the mapping of each special character to each -Heart is left as an exercise for the reader. - -For LC4, the following board could be used: - -``` -# a b c d e -f g h i j k -l m n o p q -r s t u v w -x y z _ 2 3 -4 5 6 7 8 9 -``` - -The "Hearts" suit would be ommitted from the card mapping table, and the index -of each of the Spades would be decreased by 13 to compensate. `#` and `_` -would map to 10♠ and A♠, respectively. - ## How-To You may as well see the paper [1], there are also pictures. This is somewhat more concentrated: @@ -198,6 +142,8 @@ stays the same. Grab a bag full of tiles and randomly draw them one by one. Key is the 49-item permutation of them. +## Modifications + ### Key expansion from a password Remembering 49-position random permutation that includes weird characters is @@ -252,6 +198,62 @@ This works because the cipher output is message-dependent: Having a wrong bit somewhere in the middle causes avalanche effect and erases any meaning from the text after several characters. +### Alternative playing-card-compatible board + +The following board can be used so that characters and offsets can be easily +mapped to playing cards, similar to the Solitaire cipher [2]. Using playing +cards could be more innocuous and easily explainable to the secret police than +a set of peculiar numbered tiles. + +``` +0 a b c d e f +g h i j k l m +n o p q r s t +u v w x y z _ +. , - + * / : +? ! ' ( ) 1 2 +3 4 5 6 7 8 9 +``` + +With this layout, the following mapping to playing cards is used: + +| **Character** | Card | Index | **Character** | Card | Index | **Character** | Card | Index | **Character** | Card | Index | +|-----------|------|-------|-----------|------|-------|-----------|------|-------|-----------|------|--------| +| a | A♦ | 1 | n | A♣ | 14 | _ | A♥ | 27 | 1 | A♠ | 40 | +| b | 2♦ | 2 | o | 2♣ | 15 | . | 2♥ | 28 | 2 | 2♠ | 41 | +| c | 3♦ | 3 | p | 3♣ | 16 | , | 3♥ | 29 | 3 | 3♠ | 42 | +| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | +| j | 10♦ | 10 | w | 10♣ | 23 | ! | 10♥ | 39 | 7 | 7♠ | 46 | +| k | J♦ | 11 | x | J♣ | 24 | ' | J♥ | 39 | 8 | 8♠ | 47 | +| l | Q♦ | 12 | y | Q♣ | 25 | ( | Q♥ | 39 | 9 | 9♠ | 48 | +| m | K♦ | 13 | z | K♣ | 26 | ) | K♥ | 39 | 0 | 10♠ | 49 (0) | + +The (x, y) offset can be calculated by first determining the index: take the +number of the suit (0-3), multiply by 13, and add the card number (using 1 for +the Ace, 11-13 for face cards). Then, determine the offset from the index +using the usual modular arithmetic: `x = index % 7` and `y = index / 7`. + +Alphanumeric characters can be easily mapped to cards, with letters mapping to +Diamonds or Clubs and numbers mapping to Spades (note that Spades face cards +are ommitted). All of the special characters are mapped to the Hearts, though +coming up with a mnemonic for the mapping of each special character to each +Heart is left as an exercise for the reader. + +For LC4, the following board could be used: + +``` +# a b c d e +f g h i j k +l m n o p q +r s t u v w +x y z _ 2 3 +4 5 6 7 8 9 +``` + +The "Hearts" suit would be ommitted from the card mapping table, and the index +of each of the Spades would be decreased by 13 to compensate. `#` and `_` +would map to 10♠ and A♠, respectively. + ## References [1] *Kaminsky, Alan. "ElsieFour: A Low-Tech Authenticated Encryption Algorithm For Human-to-Human Communication." IACR Cryptology ePrint Archive 2017 (2017): 339.* -- cgit v1.2.3 From 2076f1b57b95b00807c8b00020227527bd6fd063 Mon Sep 17 00:00:00 2001 From: Trevor Terris Date: Thu, 22 Apr 2021 18:58:23 -0400 Subject: Change indexing to make card ordering more intuitive Update the indexing so that the table starts at "1". This way the ordered card layout (used for key generation) starts with the Ace of Diamonds and proceeds through the cards and suits as normal. This seems cleaner than awkwardly prepending the 10 of Spades. However, it involves a slight tweak to the key key_derive function to support the change in card order. --- README.md | 29 +++++++++++++++-------------- lc4.py | 8 +++++--- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 1568b5f..9487cfb 100644 --- a/README.md +++ b/README.md @@ -206,16 +206,17 @@ cards could be more innocuous and easily explainable to the secret police than a set of peculiar numbered tiles. ``` -0 a b c d e f -g h i j k l m -n o p q r s t -u v w x y z _ -. , - + * / : -? ! ' ( ) 1 2 -3 4 5 6 7 8 9 +a b c d e f g +h i j k l m n +o p q r s t u +v w x y z _ . +, - + * / : ? +! ' ( ) 1 2 3 +4 5 6 7 8 9 0 ``` -With this layout, the following mapping to playing cards is used: +**This board uses a 1-based index**, so `a=1`, `b=2`, and so on. With this layout, +the following mapping to playing cards is used: | **Character** | Card | Index | **Character** | Card | Index | **Character** | Card | Index | **Character** | Card | Index | |-----------|------|-------|-----------|------|-------|-----------|------|-------|-----------|------|--------| @@ -242,12 +243,12 @@ Heart is left as an exercise for the reader. For LC4, the following board could be used: ``` -# a b c d e -f g h i j k -l m n o p q -r s t u v w -x y z _ 2 3 -4 5 6 7 8 9 +a b c d e f +g h i j k l +m n o p q r +s t u v w x +y z _ 2 3 4 +5 6 7 8 9 # ``` The "Hearts" suit would be ommitted from the card mapping table, and the index diff --git a/lc4.py b/lc4.py index 5a2785f..fea2f7a 100644 --- a/lc4.py +++ b/lc4.py @@ -151,9 +151,11 @@ def rotate_marker_down(m, col, n): return ((m[0] + n) % size, m[1]) -def derive_key(password): +def derive_key(password, one_indexed): i = 0 k = letters + # if using one-indexed arrays, moves the zero element to the end + if one_indexed: k = k[1:]+k[0] for c in password: (row, col) = find_ix(c) k = rotate_down(rotate_right(k, i, col), i, row) @@ -295,7 +297,7 @@ def test1(size, fixednonce): else: keyword = 's3cret_p4ssw0rd/31337' szkeyword = keyword # This statement needed to show keyword in printinfo() [don't change args.keywordstring within test1()!] - key = derive_key(keyword) + key = derive_key(keyword, false) else: key = letters initialkey = key @@ -433,7 +435,7 @@ if __name__ == '__main__': if args.keywordfile: args.keywordstring = open(args.keywordfile, 'r').read().rstrip('\r\n') if args.keywordstring: szkeyword = args.keywordstring - key = derive_key(args.keywordstring) + key = derive_key(args.keywordstring, args.playingcard) if args.keyfile: args.keystring = open(args.keyfile, 'r').read().rstrip('\r\n') if args.keystring: key = args.keystring; -- cgit v1.2.3 From 0c3084d8dd11d75790828e8d2f35a9ad1e3bfe18 Mon Sep 17 00:00:00 2001 From: Trevor Terris Date: Thu, 22 Apr 2021 22:02:17 -0400 Subject: Add example for card-based cipher --- README.md | 21 +++++++++++++++++++++ card-tiles.jpg | Bin 0 -> 172391 bytes 2 files changed, 21 insertions(+) create mode 100644 card-tiles.jpg diff --git a/README.md b/README.md index 9487cfb..ecf91d4 100644 --- a/README.md +++ b/README.md @@ -240,6 +240,27 @@ are ommitted). All of the special characters are mapped to the Hearts, though coming up with a mnemonic for the mapping of each special character to each Heart is left as an exercise for the reader. +For an example, view [this image](card-tiles.jpg). In this example, the marker +is on J♣ (at the top left), and we want to encrypt the plaintext character `e`. + +1. From the card mapping, `e` maps to 5♦ (letters `a` through `m` map to Diamonds), which is on the second row. +1. The marker card, J♣, has: + - an index of 24 (Clubs are suit 1, and the Jack is the 11th card in the suit): `i = 1 * 13 + 11 = 24` + - an x-offset of 3: `x = i % 7 = 24 % 7 = 3` + - a y-offset of 3: `y = i / 7 = 24 / 7 = 3` +1. Using the marker offsets, the ciphertext card is three rows down and three columns to the right of 5♦, which is 6♠. +1. From the card mapping, 6♠ maps to `6` (Spades map directly to digits), and has: + - an index of 45 (Spades are suit 3, and 6 is the 6th card in the suit): `i = 3 * 13 + 6 = 45` + - an x-offset of 3: `x = i % 7 = 45 % 7 = 3` + - a y-offset of 6: `y = i / 7 = 45 / 7 = 6` +1. We then complete the cipher as normal: + - Output `6` as the ciphertext + - Rotate the row containing the plaintext card, 5♦ + - Rotate the column containing the ciphertext card, 6♠ + - Move the marker according to the offsets of the ciphertext card, to the right 3 and down 6 + +The image includes the character, index, and offsets for the relevant cards. + For LC4, the following board could be used: ``` diff --git a/card-tiles.jpg b/card-tiles.jpg new file mode 100644 index 0000000..920a2fc Binary files /dev/null and b/card-tiles.jpg differ -- cgit v1.2.3 From 92e454c6ce35a9301345ad8bee2f6f814e0d12e6 Mon Sep 17 00:00:00 2001 From: Trevor Terris Date: Fri, 23 Apr 2021 09:50:57 -0400 Subject: Layout tweaks --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ecf91d4..86cda97 100644 --- a/README.md +++ b/README.md @@ -241,7 +241,8 @@ coming up with a mnemonic for the mapping of each special character to each Heart is left as an exercise for the reader. For an example, view [this image](card-tiles.jpg). In this example, the marker -is on J♣ (at the top left), and we want to encrypt the plaintext character `e`. +is on J♣ (at the top left), and we want to encrypt the plaintext character `e`. +The image includes the character, index, and offsets for the relevant cards. 1. From the card mapping, `e` maps to 5♦ (letters `a` through `m` map to Diamonds), which is on the second row. 1. The marker card, J♣, has: @@ -259,8 +260,6 @@ is on J♣ (at the top left), and we want to encrypt the plaintext character `e` - Rotate the column containing the ciphertext card, 6♠ - Move the marker according to the offsets of the ciphertext card, to the right 3 and down 6 -The image includes the character, index, and offsets for the relevant cards. - For LC4, the following board could be used: ``` @@ -273,8 +272,8 @@ y z _ 2 3 4 ``` The "Hearts" suit would be ommitted from the card mapping table, and the index -of each of the Spades would be decreased by 13 to compensate. `#` and `_` -would map to 10♠ and A♠, respectively. +of each of the Spades would be decreased by 13 to compensate. `_` and `#` +would map to A♠ and 10♠, respectively. ## References -- cgit v1.2.3