The algorithm for Discordian text encryption

Submitted by metaperl on Sun, 11/04/2007 - 10:25am.


module Crypt_Discordian
where

import List

vowel_list = "aeiouAEIOU"

is_vowel c = c `elem` vowel_list

move_vowels lis = move_vowels' lis [] []

move_vowels' [] c v = v ++ c
move_vowels' (x:xs) c v
| is_vowel x = move_vowels' xs c (x:v)
| otherwise = move_vowels' xs (x:c) v

remove_spaces str = filter (\x -> x /= ' ') str

encrypt str = List.sort $ move_vowels $ remove_spaces str

{-

The algorithm for Discordian text encryption is given at:

http://www.principiadiscordia.com/book/78.php

After implementing this, I realized that all the early steps are a farce.

But anyway, here is the algorithm in case you don't enjoy tilting your
head to read a page:

Step 1. Write out message (HAIL ERIS) and put all vowels at the end
(HLRSAIEI)

Step 2. Reverse order (IEIASRLH)

Step 3. Convert to numbers (9-5-9-1-19-18-12-8)

Step 4. Put into numerical order (1-5-8-9-9-12-18-19)

Step 5. Convert back to letter (AEHIILRS)

This cryptographic cypher code is GUARANTEED TO BE 100% UNBREAKABLE

.. so says the Principia Discordia. But I think we can generate and
test to break it.

Many thanks to kosmikus and Pseudonym for their help in developing
this module

-}

{-

Discordians. They are a
group of people who believe that spirituality is as much about
disharmony as it is about harmony.

So, in their primary book, Principia Discorida:

http://principiadiscordia.com/

you never know what is serious and what is play. The wikipedia has
more to say on them:

http://en.wikipedia.org/wiki/Discordian

-}