Book Cipher

Story time!

Once there were two silly rival gangs, Scorpions and Dragons. ¬†Scorpions had divided themselves and were located in two parts of the town with Dragons located in the middle of it. Who knows why they had it this way, but they had an issue of communicating without the Dragons knowing what they’re talking about. They decided to be smart and encrypt they’re messages using a book cypher. They picked a book that they thought the other gang wouldn’t even think of looking up, used it to encrypt and then using old school methods wrote it on a piece of paper and sent a pigeon to deliver the message to the other side. The Dragons are well known about their eavesdropping abilities and they have figured it all out except for what book the Scorpions are using. Also, the Dragons are very good at catching pigeons and they’ve been catching the pigeons and storing the encrypted messages while they’re eavesdropping team was listening to Scorpions reading the decrypted messages out loud.

After some time, the Dragons faced a problem, almost all of their eavesdroppers were too old to perform their job and the only one left was incredibly bad at it. However, the guy was smarter than everyone thought he was and he had an idea: to get all the encrypted messages and the eavesdropped messages to figure out the book that the Scorpions are using and then use the book to decrypt the future messages they get from pigeon catchers. He proposed this idea to the head Dragon, and he agreed not to “lay him off” if he brings the book to the head. There’s only one problem, the poor eavesdropper will take ages to do all of the work manually, therefore he needs your help!

Now, that the story time is over, here is the form of the inputs that you have:
String : decrypted message,
List of encrypted characters in a format of page number-line number-index of character in line : encrypted message.

Here are all of the inputs:

Tomorrow we will take down the owls shed. Get ready.
4-13-47, 4-13-49, 4-13-69, 1-7-5, 2-55-30, 4-13-27, 3-2-57, 1-7-68, 3-2-71, 3-2-45, 4-13-38, 1-7-35, 4-13-55, 4-13-48, 4-13-23, 1-7-36, 1-7-52, 1-7-12, 4-13-30, 2-55-9, 3-2-4, 3-1-72, 4-13-67, 2-55-66, 4-13-17, 2-56-14, 4-13-54, 1-7-71, 4-13-37, 1-7-63, 2-55-68, 3-2-41, 1-7-49, 1-7-6, 3-2-76, 4-13-8, 4-13-21, 3-1-21, 4-13-26, 1-7-9, 1-7-75, 2-55-46, 1-7-74, 1-7-47, 1-7-29, 3-2-39, 3-2-52, 1-7-19, 2-55-58, 3-1-77, 3-1-43, 1-7-41

You blow their brains all over your nice Ivy League suit.
3-2-17, 3-2-44, 1-7-2, 3-1-19, 2-55-6, 4-13-4, 1-7-65, 2-55-40, 1-7-22, 3-2-66, 3-2-69, 1-7-8, 3-1-47, 3-2-26, 3-1-50, 3-1-79, 2-55-25, 4-13-46, 2-55-36, 3-2-37, 2-55-31, 4-13-59, 1-7-61, 4-13-5, 3-2-43, 3-1-39, 3-1-62, 4-13-11, 2-55-49, 2-55-65, 4-13-68, 4-13-70, 2-55-29, 3-2-20, 4-13-57, 3-2-29, 4-13-64, 4-13-60, 3-1-73, 2-55-16, 2-55-5, 2-55-41, 4-13-11, 2-55-70, 3-2-18, 4-13-15, 4-13-66, 3-2-53, 3-2-64, 3-1-75, 3-2-80, 2-55-71, 3-2-34, 1-7-26, 4-13-1, 1-7-24, 3-2-82

Go find Benny and do him up.
2-56-0, 3-2-25, 2-55-39, 3-2-11, 3-1-29, 1-7-73, 1-7-21, 1-7-28, 2-55-6, 4-13-12, 3-1-41, 1-7-15, 4-13-6, 3-2-56, 2-56-10, 3-2-14, 1-7-7, 3-1-31, 3-1-38, 2-55-24, 3-2-5, 4-13-82, 3-1-32, 2-55-67, 2-56-4, 3-1-80, 2-55-42, 2-55-80

You can get much further with a kind word and a gun then you can with a kind word alone.
3-2-7, 2-55-61, 3-1-11, 3-1-67, 3-1-34, 4-13-24, 3-1-18, 1-7-31, 2-55-45, 4-13-75, 3-2-60, 1-7-42, 3-2-16, 3-1-36, 3-1-9, 3-1-57, 4-13-22, 3-1-30, 3-2-63, 1-7-60, 3-1-52, 1-7-44, 4-13-41, 4-13-34, 1-7-17, 2-56-5, 3-1-0, 1-7-40, 1-7-33, 1-7-58, 2-56-7, 2-55-50, 4-13-20, 3-1-7, 1-7-3, 2-55-28, 3-1-44, 3-1-5, 3-1-10, 2-55-26, 2-55-79, 3-2-50, 3-1-54, 3-1-48, 3-2-81, 3-2-68, 2-55-35, 2-56-11, 1-7-38, 4-13-73, 4-13-2, 3-1-28, 4-13-32, 1-7-18, 1-7-45, 2-55-44, 3-2-59, 2-55-70, 2-55-20, 3-1-63, 3-2-46, 1-7-62, 4-13-44, 3-2-55, 1-7-13, 2-55-2, 1-7-0, 3-1-81, 3-2-31, 4-13-71, 3-1-25, 2-55-10, 3-1-49, 1-7-72, 1-7-53, 2-56-2, 2-55-17, 2-55-40, 2-56-1, 2-55-57, 4-13-65, 3-2-35, 2-55-3, 3-2-79, 3-1-74, 4-13-50, 3-1-60, 3-2-67

We took care of Kennedy.
3-2-45, 2-55-52, 3-1-14, 4-13-36, 2-55-73, 2-55-19, 3-1-2, 4-13-61, 2-55-23, 4-13-63, 4-13-45, 4-13-10, 3-1-6, 1-7-30, 1-7-4, 2-55-32, 4-13-20, 3-1-22, 2-55-12, 3-1-61, 3-2-22, 1-7-16, 3-2-17, 2-55-80

Murders came with smiles, shooting people was no big deal for us Goodfellas.
3-2-77, 4-13-73, 1-7-69, 3-2-74, 3-2-70, 1-7-46, 4-13-72, 3-1-59, 2-55-18, 3-2-36, 2-55-69, 1-7-34, 2-56-9, 3-2-45, 2-55-11, 4-13-81, 2-55-48, 3-2-12, 3-2-28, 2-56-12, 1-7-70, 3-1-37, 4-13-18, 2-55-4, 3-1-66, 3-2-15, 2-55-54, 3-2-61, 3-1-40, 3-1-15, 1-7-55, 3-2-24, 2-55-62, 3-1-64, 1-7-10, 4-13-74, 3-1-17, 4-13-78, 2-55-51, 3-2-42, 4-13-83, 4-13-16, 4-13-17, 1-7-57, 1-7-51, 2-55-1, 3-1-3, 1-7-54, 1-7-56, 3-1-79, 1-7-37, 3-1-56, 3-1-33, 4-13-40, 2-55-77, 4-13-3, 3-2-10, 3-1-78, 4-13-53, 3-2-32, 3-1-53, 4-13-39, 1-7-2, 4-13-9, 3-1-70, 2-55-34, 3-2-62, 4-13-52, 3-2-38, 3-2-58, 3-1-4, 3-1-42, 3-2-1, 1-7-14, 3-2-30, 2-55-80

Notes:

  • All of the messages were encrypted lowercase
  • The page numbers don’t represent the actual page numbers in the book, rather the numbered pages that were used in the encryption
  • Once you get at least a sentence from the book you should be able to search it on the internet and find the book.

For those that didn’t read the story time.¬†Your task is to find a book that was used to encrypt messages. You’re given the decrypted and encrypted messages in the input section above based on provided format. You should be able to get at least one sentence that would enable you to find the book. However, the sentences would be lacking some characters, therefore, you should fill out the blanks yourself to get the sentence.

Have fun finding the book!