# The Cipher Machine

"CIPHER, CIPHER, CIPHERS. I LOVE CIPHERS. A LOT. YOU HAVE NO IDEA HOW MUCH I LIKE THEM. THEY ARE VERY FUN!", said the cryptographer.

"YOU HAVE NO IDEA."

"ANYWAYS, THERE ARE INPUTS AND OUTPUTS. THERE ARE EXAMPLES THAT SHALL ASSIST YOU. FILL IN THE "??" IN THE EXAMPLES WHICH HAVE A MISSING INPUT OR OUTPUT."

"TO DO THAT, YOU MUST FIND WHAT CIPHER HAS BEEN USED, I ASSUME. I HOPE THE TASK IS NOT TOO DIFFICULT FOR A PUZZLE SOLVER SUCH AS YOU."

Input:    THIS IS A TEST

Output: ZBRD HA A YBDV

Input:    THIS IS A TEST OF A VERY LONG MESSAGE, VERY LONG INDEED

Output: ZBRD HA A YBDV QF J ZAAZ LFTJ VRJKCMF, LVMR DVVD MAZMTK

Input:    THIS is A test 123456!@#$gt84EUEOEFJQAQ789hgjfeeu^((& Output: ZBRD ha A ybdv 123456!@#$jt84DYATRFRVBY789eothbfk^((&

Input:    NUMBERS ARE NOT AFFECTED 0123456789

Output: WZTGSSS JDA QQT JLKSITUH 0123456789

Input:

!   "   #   $% & ' ( ) * + , - . / 0 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 [ \ ] ^ _  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 { | } ~  Output: ! " #$   %   &   '   (   )   *   +   ,   -   .   /
0   1   2   3   4   5   6   7   8   9   :   ;   <   =   >   ?
@   K   K   E   J   S   G   G   B   R   M   M   M   M   V   V
R   U   S   S   C   P   V   R   I   B   F   [   \   ]   ^   _
f   d   j   w   q   z   i   u   h   e   q   u   b   f   j
y   m   h   r   c   p   v   r   i   b   f   {   |   }   ~


Input: Some more examples. This is some random text that I am just typing.

Output: Jwta oqrd bcdnptbd. Veij qv fssd dgknso abhj weku A ks iygc datndm.

Input: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Output: Uwdao ppgyq gqlwd dhu ahvy, esobfubkfbw jmpvbveunp uurt, zbp hw gfvbnxd uucsrs uwefqqkvfz df xcjsav du zomcsk dxefc vvddzg. Yj kams jk ebiow pqotiw, jkrw oskpuvz rjzdnpcwgvqw frucuuc qejwrpz xuaq fk vpbauqn gr vj ixrnxfg tyeawjvdx. Sybs ydbv fwuwu mvsgj uz zrbjywbolyfrp qe jwmfaxdyb ybefx dazr nwrplo pyavcb qv hyoagt obpbw gytqjxyz. Logrdjult ubqc wiacyrgn cyeukiyku sfa pryrdgdt, cwop bd aketx uzq qtlotai zxaurlev wdbmqh ooin bq bjx tiyfugh.

Input: In publishing and graphic design, lorem ipsum (derived from Latin dolorem ipsum, translated as "pain itself") is a filler text commonly used to demonstrate the graphic elements of a document or visual presentation. Replacing meaningful content with placeholder text allows designers to design the form of the content before the content itself has been produced.

Output: Av sxfmigaeqj avk labpeop hjupot, mangr fkgio (jrrfzff vvrs Tgbpq mghcddn wsmeu, fuvxzmxpvx yg "swpq akvxto") oj v ouqxgg vgyd ifvtrcme inrx av lxtldsfuwfu aiy odnvufe truvxvcz vh f kprioaot vt znffcu tmgmvnkwxofa. Fzhuiamqn tfgsuxegge rvqagnu jjba debnmkgpdvv jbkj hmauyu nefepekdg jv sxkmza mdk lxsc al ydx ocuzrid ialiwd bul tuutvsj rdzjqu ujf iabn tvfkftrp.

Input: THIS IS ANOTHER TEST

Output: ??

Input: ??

Output: BZHPNPNN KUV AE

Hint:

Somewhere within the story, lies the key.

Where it is, you'll have to see.

But I think, we all agree

That you're on a cipher solving spree!

Even if you're not,

You have to find, find the key.

Am I running out of rhymes?

Please don't tell that, tell that to me.

• I like this idea of countering "too broad". Sep 22 '16 at 16:35
• Can someone kindly format the text so that the input and output lines are vertically aligned? Sep 22 '16 at 16:55

Input: THIS IS ANOTHER TEST

Output:

ZBRD HA AVVWRRR YBDV

Input:

PUZZLING DOT SE

Output: BZHPNPNN KUV AE

The cipher is

An Autokeyed Vigenere, using the Alphabet "CIPHERSABDFGJKLMNOQTUVWXYZ" And the passphrase "srehpicrehpicrehpic" (cipher, cipher, ciphers reversed) After getting through that key, it then starts using the plaintext as the cipher.

I noticed that the

6th position was advancing by one letter each time, or going from S to A this led me to believe there was a keyed alphabet involved, my second or third alphabet experiment was ciphers and some experimentation with the given input and outputs let me find a pattern that matched. After hitting the end of the key I was a little confused, but I kept going and saw that the text I was appending to the Key was the start of the Plaintext. It was an Autokey!

• FYI, this is called an autokey cipher. Sep 27 '16 at 18:28
• Well done, congrats! Sep 30 '16 at 10:26