File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ area topic
1212⚙ slice lists and strings
1313💡 use the ``join `` method of the ``string `` data type
1414🔀 use a loop variable for indexing
15+ 🔀 use indexing to re-arrange a list
1516======= ====================================
1617
1718
@@ -110,3 +111,25 @@ Exercise 7: Decrypt
110111-------------------
111112
112113Write a program to decrypt an encrypted message again.
114+
115+
116+ Exercise 8: Encryption Key
117+ --------------------------
118+
119+ Use an encryption key like ``2031 `` that specifies a new order for the blocks.
120+ Implement the following:
121+
122+ 1. create an empty list
123+ 2. create the blocks as above and add them to the list
124+ 3. go through each position of the encryption key
125+ 4. select the block with the index given by the digit from the key (convert it to int)
126+ 5. add the block to the result string
127+
128+
129+ Reflection questions
130+ --------------------
131+
132+ - what is indexing?
133+ - what do the three numbers in *slicing * do?
134+ - what do you think about the transposition cipher. Is it secure?
135+ - how could you decrypt a transposition cipher without the key?
You can’t perform that action at this time.
0 commit comments