On the Subject of the Chain Bit-Rotation CM
A machine that knows no bounds when it comes to ciphers.
If the Submit Button is white, follow the instructions under Encrypt Instructions. Otherwise follow the instructions under Decrypt Instructions.
Decrypt Instructions
For this step, you will need the keyword from screen 1. If the keyword is shorter than the encrypted word, append repetitions of it to it until it is the same length or longer.
Start with the number on screen A, then carry out the following steps for every letter of the encrypted word: (1) multiply the number by 26; (2) add the alphabetic position of the letter. If the letter is Z, add 0 instead.
Convert this number to binary. Let n = 5 times the number of letters in the encrypted word. Then:
- Cycle the least significant n bits to the right by m bits. Here, m is the alphabetic position of the next letter in the keyword. (Make sure to cycle all n bits; if your number has fewer digits, add leading zeros.)
- Remove the least significant 5 bits from the number and convert them to a letter (A = 00001 ... Z = 11010).
- Reduce n by 5.
Repeat this as many times as there were letters in the encrypted word.
Decrypt Example
Encrypted word: OCRQOV; initial value: 1; keyword: BUSBOY
Calculation: (((((1 × 26 + 15) × 26 + 3) × 26 + 18) × 26 + 17) × 26 + 15) × 26 + 22
Binary: 011101001000110000101000100000
Cycle last 30 bits right by B=2: 000111010010001100001010001000 → 8 → H
Cycle last 25 bits right by U=21: 1101001000110000101000001 → 1 → A
Cycle last 20 bits right by S=19: 10100100011000010101 → 21 → U
Cycle last 15 bits right by B=2: 001010010001100 → 12 → L
Cycle last 10 bits right by O=15: 0010000101 → 5 → E
Cycle last 5 bits right by Y=25: 00100 → 4 → D
Decrypted Word: HAULED