## Simple Asymmetric Reversal

****
##### ### Let's map the alphabet and some symbols onto the numbers 1 to 31. And let us use the number 9 as encryption key as follows: C = 9* P mod 31 (P a plaintext number and C a ciphertext number, both in the range 1-31, where we interpret 31 as o). ### Accordingly we can encrypt the word "LOVE" as follows: Replace the letters with their numeric value: LOVE = 12,15,22,5 Encrypt each plaintext letter P into its corresponding ciphertext letter C So 12 becomes 12*9 mod 31 = 15, 15 becomes 15*9 mod 31 = 11 22 becomes 22*9 mod 31 = 12 5 becomes 5*9 mod 31 = 14 Replace the numeric values with their letters: 15,11,12,14 becomes: OKLN so the plaintext "LOVE" becomes the ciphertext "OKLN" If we try to use the same key for decryption we get a plaintext: ## KFOB which is different from the plaintext word "LOVE". So a symmetric key won't work! However, if we use a different key K=7 (not 9) and apply to the ciphertext then we get: 15 becomes 15*7 mod 31 = 12 11 becomes 11*7 mod 31 = 15 12 becomes 12*7 mod 31 = 22 14 becomes 14*7 mod 31 = 5 which translates back to the original plaintext "LOVE". This illustrates a simple asymmetrical cipher that does the job. # The math behind the illustration: Let e be the encryption key; d, the decryption key. A letter x is encrypted to y=ex mod 31, then decrypted back to x = dy = dex mod 31. So we must have de = 1 mod 31. for e=9 and d=7, we have 7*9=63 = 31*2 + 1 = 1 mod31.
* Version CE-H6703 (SERVER) Crypto Academy