Pigpen cipher. Assignment

Vergelijkbare documenten
After that, the digits are written after each other: first the row numbers, followed by the column numbers.

The first line of the input contains an integer $t \in \mathbb{n}$. This is followed by $t$ lines of text. This text consists of:

Calculator spelling. Assignment

Classification of triangles

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE. Toets Inleiding Kansrekening 1 8 februari 2010

Genetic code. Assignment

The genesis of the game is unclear. Possibly, dominoes originates from China and the stones were brought here by Marco Polo, but this is uncertain.

Chromosomal crossover

Country recognition. Assignment

Daylight saving time. Assignment

SAMPLE 11 = + 11 = + + Exploring Combinations of Ten + + = = + + = + = = + = = 11. Step Up. Step Ahead

(1) De hoofdfunctie van ons gezelschap is het aanbieden van onderwijs. (2) Ons gezelschap is er om kunsteducatie te verbeteren

The colour of a pixel in a bit map picture can be presented in different ways. For this assignment, we distinguish two categories:

Add the standing fingers to get the tens and multiply the closed fingers to get the units.

ALGORITMIEK: answers exercise class 7

Introductie in flowcharts

Demultiplexing reads FASTA format genome sequencing reads run

Christmas party. Preparation. Assignment

L.Net s88sd16-n aansluitingen en programmering.

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE. Toets Inleiding Kansrekening 1 7 februari 2011

Ontpopping. ORGACOM Thuis in het Museum

Luister alsjeblieft naar een opname als je de vragen beantwoordt of speel de stukken zelf!

TOEGANG VOOR NL / ENTRANCE FOR DUTCH : lator=c&camp=24759

MyDHL+ Van Non-Corporate naar Corporate

General info on using shopping carts with Ingenico epayments

Buzzword bingo Buzzword bingo bul shit bingo

Engels op Niveau A2 Workshops Woordkennis 1

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

The 15 puzzle invented by Noyes Chapman consisted of a $4 \times 4$ grid of which the field are numbered from 1 to 15.

B1 Woordkennis: Spelling

Example. >>> rowkey('u') 1 >>> rowkey('a') 2 >>> rowkey('z') 3 >>> rowkey('?')

Four-card problem. Input

Group work to study a new subject.

Meetkunde en Lineaire Algebra

L.Net s88sd16-n aansluitingen en programmering.

Esther Lee-Varisco Matt Zhang

Intermax backup exclusion files

It s all about the money Group work

i(i + 1) = xy + y = x + 1, y(1) = 2.

Hidato. Assignment. A hidato (left) and its solution (right).

Hoe met Windows 8 te verbinden met NDI Remote Office (NDIRO) How to connect With Windows 8 to NDI Remote Office (NDIRO

Zo werkt het in de apotheek (Basiswerk AG) (Dutch Edition)

0515 DUTCH (FOREIGN LANGUAGE)

z x 1 x 2 x 3 x 4 s 1 s 2 s 3 rij rij rij rij

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

Settings for the C100BRS4 MAC Address Spoofing with cable Internet.

ANGSTSTOORNISSEN EN HYPOCHONDRIE: DIAGNOSTIEK EN BEHANDELING (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

Solar system. Assignment

2019 SUNEXCHANGE USER GUIDE LAST UPDATED

Assignment. Example. is surrounded by exactly 3 coloured cells.

Opgave 2 Geef een korte uitleg van elk van de volgende concepten: De Yield-to-Maturity of a coupon bond.

AN URBAN PLAYGROUND AFSTUDEERPROJECT

LONDEN MET 21 GEVARIEERDE STADSWANDELINGEN 480 PAGINAS WAARDEVOLE INFORMATIE RUIM 300 FOTOS KAARTEN EN PLATTEGRONDEN

Preschool Kindergarten

Quality requirements concerning the packaging of oak lumber of Houthandel Wijers vof ( )

Online Resource 1. Title: Implementing the flipped classroom: An exploration of study behaviour and student performance

APPROACHING THE FAMILY

MyDHL+ Uw accountnummer(s) delen

Firewall van de Speedtouch 789wl volledig uitschakelen?

S e v e n P h o t o s f o r O A S E. K r i j n d e K o n i n g

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE. Toets Inleiding Kansrekening 1 22 februari 2013

OPEN TRAINING. Onderhandelingen met leveranciers voor aankopers. Zeker stellen dat je goed voorbereid aan de onderhandelingstafel komt.

Functioneel Ontwerp / Wireframes:

This appendix lists all the messages that the DRS may send to a registrant's administrative contact.

Speleology. Assignment

Cambridge International Examinations Cambridge International General Certificate of Secondary Education

CHROMA STANDAARDREEKS

1a. We werken het geval voor het tandenpoetsen uit. De concepten zijn (we gebruiken Engelse termen en afkortingen):

Interactive Grammar leert de belangrijkste regels van de Engelste spelling en grammatica aan.

0515 FOREIGN LANGUAGE DUTCH

Meetkunde en Lineaire Algebra

Graphic Design. Keuzevak GD1. Raul Martinez-Orozco / raul@thecombine.nl)

Travel Survey Questionnaires

Chapter 4 Understanding Families. In this chapter, you will learn

Cambridge International Examinations Cambridge International General Certificate of Secondary Education

Cambridge Assessment International Education Cambridge International General Certificate of Secondary Education. Published

The mitochondrial genome has bases and codes for 37 genes: 13 polypeptides, 22 trnas and 2 ribosomal RNAs.

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Examination 2DL04 Friday 16 november 2007, hours.

De grondbeginselen der Nederlandsche spelling / Regeling der spelling voor het woordenboek der Nederlandsche taal (Dutch Edition)

Contents. An Augmented Backus-Naur Format, (ABNF), Parser Generator for Erlang. Anders Nygren ABNF Using abnfc Implementation Todo

Cambridge International Examinations Cambridge International General Certificate of Secondary Education

Puzzle. Fais ft. Afrojack Niveau 3a Song 6 Lesson A Worksheet. a Lees de omschrijvingen. Zet de Engelse woorden in de puzzel.

GOVERNMENT NOTICE. STAATSKOERANT, 18 AUGUSTUS 2017 No NATIONAL TREASURY. National Treasury/ Nasionale Tesourie NO AUGUST

Registratie- en activeringsproces voor de Factuurstatus Service NL 1 Registration and activation process for the Invoice Status Service EN 10

Win a meet and greet with Adam Young from the band Owl City!

Tentamen Objectgeorienteerd Programmeren

Borstkanker: Stichting tegen Kanker (Dutch Edition)

Map showing countries shaded by their position in the Happy Planet Index (2006). The highestranked countries are bright green, the lowest are brown.

Bijlage 2: Informatie met betrekking tot goede praktijkvoorbeelden in Londen, het Verenigd Koninkrijk en Queensland

Handleiding beheer lijst.hva.nl. See page 11 for Instruction in English

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Tentamen Calculus B (2WBB1) op maandag 28 januari 2013, 14:00 17:00 uur

Understanding and being understood begins with speaking Dutch

Example. >>> airmap = Map() >>> airmap.eruption(0, 0) >>> airmap.ashcloud {(0, 0)} >>> airmap.spread()

voltooid tegenwoordige tijd

04/11/2013. Sluitersnelheid: 1/50 sec = 0.02 sec. Frameduur= 2 x sluitersnelheid= 2/50 = 1/25 = 0.04 sec. Framerate= 1/0.

Op het potje Potty training

Transcriptie:

Pigpen cipher James Leeson (1756 1794) is buried in New York's Trinity Church Cemetery. His tombstone bears a curious inscription. It remained a local puzzle until 1889, when the Trinity Record discovered that it is reads as REMEMBER DEATH encoded in pigpen cipher. Tombstone of James Leeson (1756-1794) in New York's Trinity Church Cemetery. Note that the cipher on top of the stone makes use of a slightly different key compared to the one used in this exercise: the wrinkle is that J is omitted, because in colonial orthography it was identical with I. All letters following J in the alphabet therefore shift one position forward in the grids of the key used for encoding and decoding. The pigpen cipher (sometimes referred to as the masonic cipher or Freemason's cipher) is a geometric simple substitution cipher that exchanges letters for symbols which are fragments of a grid. The exact origin of the cipher is uncertain, but records of this system have been found which go back to at least the 18th century. Variations of this cipher were used by both the Rosicrucian brotherhood and the Freemasons, though the latter used it so often that the system is frequently called the Freemason's cipher. They began using it in the early 18th century to keep their records of history and rites private, and for correspondence between lodge leaders. The oldest known version is from Heinrich Cornelius Agrippa von Nettesheim who explains the method in his De occulta philosophia published in 1533. This work was reused in 1586 by Blaise de Vigenère in his treatise about cryptography. There are many possible variations, but any trained crypto-analyst will usually have no trouble deciphering the encoded messages. Assignment Your task is to decode a given word according to the pigpen cipher that makes use of the following key.

This is done by substituting each letter of the word by its symbolic representation in the pigpen cipher. This representation forms a $3 \times 3$ grid of characters. The middle character of the symbolic representation indicates what grid of the key contains the letter: a space represents the left grid, a dot (.) the middle grid, and a colon (:) the grid to the right. In addition, lines must be drawn to the left, right, top and bottom according to the position of the letter in the grid. As an example, the symbolic representation of all letters in the middle grid are depicted below. +-+ +-- +-+ +--......... +-+ +-- +-+ +-- J K L M N O P Q R Note that fragments of a horizontal line are thus represented by a dash (-) and fragments of a vertical line by a pipe symbol (). Corner points of the symbolic representation where two lines meet are represented by a plus sign (+). Your task: Write a function pigpenletter that takes a single letter as an argument. The function must return a string containing three lines of three characters. These characters form the symbolic representation of the given letter in pigpen notation. Make sure that the number of conditions that need to be tested is kept to the absolute minimum when determining the representation of the given letter in pigpen notation. You definitely have to avoid programming constructs of the form: if the letter is A then its symbolic representation is the following, else if the letter is B then its symbolic representation is the following, Use the function pigpenletter to write a function pigpen. The function takes a string that only contains letters and must return a string that consists of three lines that contain the symbolic representation of the given word in pigpen notation. This is done by separating the symbolic representations of the individual letters with a single column containing three spaces. Both functions must handle the given string in a case insensitive way. Example >>> print(pigpenletter('a')) >>> print(pigpenletter('m')). >>> print(pigpenletter('u'))

: +-- >>> print(pigpen('python')) +-+ +-- +-+. : :.. +-+ +-- +-+ >>> print(pigpen('rosenkreutz')) +-- +-- +-+ +-+ +-- +-+ +-+.. :... : : : +-- +-+ +-+ +-+ +-+ +-- +-+ Op het Trinity Church Cemetery in New York ligt James Leeson (1756 1794) begraven. Bovenaan zijn grafsteen staat een merkwaardige inscriptie, waarvan pas in 1889 bleek dat ze de tekst REMEMBER DEATH voorstelt in het rozenkruisersgeheimschrift. Grafsteen van James Leeson (1756-1794) op het Trinity Church Cemetery in New York. Merk op dat het geheimschrift opgesteld is op basis van een variant van de sleutel die in deze opgave gebruikt wordt: de letters I en J werden op dezelfde manier geschreven in de koloniale spelling en dus werd de letter J weggelaten uit de sleutel. Alle letters die na de J komen, schuiven daardoor één positie naar voor in de roosters die gebruikt worden voor de versleuteling. H e t rozenkruisersgeheimschrift (ook wel vrijmetselaarsalfabet of maçonniek kwadraatschrift) is een monoalfabetische versleutelingsmethode waarbij de letters van de platte tekst gecodeerd worden door middel van eenvoudig te onthouden diagrammen. De methode die ook onder de minder lovende naam varkenshokversleuteling (of pigpen) bekend staat wordt in het algemeen toegeschreven aan de rozenkruisers. Dit geheim genootschap van wijsgerigen zou er in de 18e eeuw gebruik van gemaakt hebben om er haar geheimen mee te bewaren. De oudst bekende variant is van Heinrich Cornelius Agrippa von Nettesheim die de methode uitlegt in zijn De occulta philosophia uit 1533. Dit werk werd in 1586 door Blaise de Vigenère hergebruikt in zijn tractaat aangaande geheimschrift. Er zijn vele varianten mogelijk, maar een geoefend cryptoanalist zal doorgaans geen enkele moeite hebben met de ontcijfering. Opgave De opgave bestaat erin een gegeven woord uit te schrijven, maar dan gecodeerd in het rozenkruisersgeheimschrift dat gebruik maakt van de volgende sleutel.

Hierbij moet elke letter van het gegeven woord vertaald worden naar zijn symbolische voorstelling in het rozenkruisersgeheimschrift. Deze voorstelling bestaat uit $3 \times 3$ karakters. Het middelste karakter van de symbolische voorstelling geeft aan in welk van de drie roosters de letter voorkomt: een spatie stelt het linkse rooster voor, een punt (.) het middelste rooster, en een dubbelpunt (:) het rechtse rooster. Voorts moeten er lijnen links, rechts, boven en onder getrokken worden, overeenkomstig de positie van de letter in het rooster. Hieronder tonen we bij wijze van voorbeeld de symbolische voorstelling van de letters in het middelste rooster. +-+ +-- +-+ +--......... +-+ +-- +-+ +-- J K L M N O P Q R Merk dus op dat fragmenten van een horizontale lijn voorgesteld worden door een koppelteken (-) en fragmenten van een verticale lijn door een verticale streep (). Hoekpunten van de symbolische voorstelling waar twee lijnen samenkomen, worden voorgesteld door een plusteken (+). Gevraagd wordt: Schrijf een functie rozenkruisersletter waaraan een letter moet doorgegeven worden. De functie moet een string teruggeven bestaande uit 3 regels van 3 karakters, die de gegeven letter in het rozenkruisersgeheimschrift voorstelt. Zorg ervoor dat er zo weinig mogelijk voorwaarden moeten getest worden om de voorstelling van de letter in het rozenkruisersgeheimschrift te bepalen. Vermijd met andere woorden programmeerconstructies van de vorm: als de letter A is dan is dit de symbolische voorstelling, als de letter B is dan is dit de voorstelling, Gebruik de functie rozenkruisersletter om een functie rozenkruisersgeheimschrift te schrijven. Aan deze functie moet een woord doorgegeven worden dat enkel bestaat uit letters. De functie moet een string bestaande uit drie regels teruggeven, die de symbolische voorstelling van het gegeven woord in het rozenkruisersgeheimschrift voorstelt. Hierbij wordt tussen de symbolische voorstelling van de letters telkens een kolom van drie spaties gevoegd. Beide functies mogen geen onderscheid maken tussen hoofdletters en kleine letters. Voorbeeld >>> print(rozenkruisersletter('a')) >>> print(rozenkruisersletter('m')).

>>> print(rozenkruisersletter('u')) : +-- >>> print(rozenkruisersgeheimschrift('python')) +-+ +-- +-+. : :.. +-+ +-- +-+ >>> print(rozenkruisersgeheimschrift('rosenkreutz')) +-- +-- +-+ +-+ +-- +-+ +-+.. :... : : : +-- +-+ +-+ +-+ +-+ +-- +-+