Quantcast

Affine Cipher - Encrypt

Last modified by
on
Jul 13, 2023, 7:58:50 PM
Created by
on
Jul 12, 2023, 7:00:40 PM
`C = ( a_k p + b_k ) mod 26`
`(p) "Plaintext"`
`(a_k) "Key 1"`
`(b_k) "Key 2"`
Tags
UUID
655151f9-20e6-11ee-b65f-bc764e203090

The Affine Cipher equation encrypts a string using the Affine cipher method and returns a string of ciphertext. 

INSTRUCTIONS: Enter the following

  • (p) Plaintext - the message you wish to encrypt
  • (ak) Key 1
  • (bk) Key 2

Ciphertext (C): The encryption returns a string of ciphertext

The Math / Science

First, convert your string of letters into numbers corresponding to their position in the alphabet (A = 0, B = 1, C = 2, etc...).

Then, plug each number (representing a letter) into the formula below (p = number, ak = key1, bk = key2).

C = [(ak x p) + bk] mod 26

This formula will result in a list of numbers; take these numbers and convert them back into letters based on their position (0 = A, 1 = B, 2 = C, etc...).

The resulting character string is your ciphertext. 


This equation, Affine Cipher - Encrypt, references 1 page
  • Comments
  • Attachments
  • Stats
No comments
This site uses cookies to give you the best, most relevant experience. By continuing to browse the site you are agreeing to our use of cookies.