A grille cipher was a technique for encrypting plaintext by writing it onto a sheet of paper through a pierced sheet. The earliest known use is from the mathematician Girolamo Cardano in 1550. His proposal was for a rectangular stencil allowing single letters, syllables, or words to be written, then later read. The written fragments of the plaintext could be further disguised by filling the gaps between the fragments with benign words or letters.
Write a function that accepts two inputs:
code. Code is a non-negative integer and should be converted to binary. Overlay the code converted to binary and the message to reveal the result.
Grille("abcdef", 5) => "df" * convert 5 to binary: 000101 * overlay message and code: message : abcdef code : 000101 ---------------- result : df
Want to propose a challenge idea for a future post? Email email@example.com with your suggestions!