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.
String Manipulation Utilities
- String Compare: Examines two given strings to see if they are equal to each other.
- Palindrome Check: Evaluates if a given word or sentence is a palindrome.
- Reverse String: Takes a given string of alphanumeric characters and reverses its order.
- Remove Vowels Consonants Numbers Whitespace: Removes all vowels, consonants, numbers, or whitespace from a string of text.
- String to Comma-Separated List: Takes any string and split it into a comma-separated list with options for spaces, bracket types, and capital letters.
- Word Count: Counts the number of words in a given string regardless of punctuation and new lines.
- Character Count: Counts the number of occurrences of each character in a string of text.
- Regex Remove: Takes a regex expression and compares it to a sample string to see which patterns should be removed from the string.
- Affine Cipher Encrypt: Encrypts ciphertext using an Affine Cipher algorithm given the ciphertext and two keys.
- Affine Cipher Decrypt: Decrypts ciphertext using an Affine Cipher algorithm given the ciphertext and two keys.
- Caesar Cipher Encrypt: Encrypts non-numeric data by shifting the letters forward or backward on the alphabet by a constant amount.
- Caesar Cipher Decrypt: Dencrypts non-numeric data by shifting the letters forward or backward on the alphabet by a constant amount.
- String Alphabet Position Sum: Takes a string and converts each character to an integer corresponding to its position in the alphabet and then sums those positions.