This series of lecturettes by Danny Heap gives just enough of a
DrRacket tour to encrypt images, and were used to guide
a workshop in May
2012.
racket arithmetic video
Manipulates numbers and elephants. Once you've seen the
video, try the quiz below.
In the DrRacket interactions pane, type an expression
that adds 5/17, 9/19, and 15/23.
In the DrRacket interactions pane, type an expression
that multiplies the previous expression by 117/29
Find an image of a shark on the web, scale it to 0.75 of
its size, then rotate it 60 degrees.
racket dissection video
Takes apart images and use them as a template to put
together new ones. Once you've watched the video, try the quiz below.
Find a shark image on the web and define a short-cut for
it called finny.
Show the 197th colour of finny
Produce a new colour that is the same as the 197th
colour of finny, except the red part is the
minimum of the red finny's 197th red and
blue. The minimum of 5 and 7 is expressed (min 7 5).
Produce a new image where each colour is the same as the
corresponding colour in finny except the red part is the
minimum of finny's corresponding red and
blue colour.
racket abstraction video
Creates handy definitions to reduce programming work. Once
you've watched the video, try the quiz below.
Emulate (that is, copy in a polite way) the definition
of mult-mod to define a new function
add-mod, which takes three numbers, adds the first
two and then takes the remainder with respect to division by
the third. For example (add-mod 4 5 6) produces 3,
since 4 plus 5 is 9, which has remainder three upon being
divided by 6.
Use the function mult-mod, some number that shares no
divisors with 13, and the function in-range to
permute (scramble) the integers from 1 through 12. Can you
figure out what number to use to unscramble this list?
Use the function obscure-intensity along with
the factor 43 to scramble a graphic. Experiment with the
numbers 4, 5, 6, and 7 to unscramble it.
racket encryption video
Encrypts an
elephant using a transposition (permutation) cipher. Once
you've watched the video, try the quiz below.
Paste another image into your interactions pane. Encrypt
it using for/image and obscure-intensity,
as well as the multiplier 43. Make sure you can decrypt the
result using the multiplier 6.
Danny Heap
Last modified: Thu Dec 6 10:11:03 EST 2012