Welcome to our RC5-Haskell repository. This project was develop for our Functional Programming class at Yachay Tech. Please be aware that the code was develop for a class project and is not 100% secure for use at a production environment.
This project is aim to build a simple company login system using the RC5 encryption for authentication and a web server for the application itself. All new libraries added should be included in the application.cabal file. Remember to change the database.csv directory for one that suits your computer. In order to test the code in your computer remember to run:
cabal update && cabal install ghcid
git clone https://github.com/martinvelezf/RC5-HASKELL.git
cd RC5-HASKELL
cabal install --only-dependencies
ghcid -T :mainIf ghcid is installed but you cannot find it, try to locate it in the following folder /home/USERNAME/.cabal/bin/ghcid.
Or you could build the application using cabal in the top directory /RC5-HASKELL:
cabal buildAfter the building process is complete, execute the application file in the build directory:
./ /RC5-HASKELL/dist/build/application/applicationGo to http://localhost:8080/ in any browser in your computer to use the application.
For the momment use these credentials to login:
- email: nicolas.serrano@yachaytech.edu.ec
- password: encryptedpassword
Martin Velez
This code is based in the Rivest implementation of 1995 in Haskell. The original paper can be found here.
To run the code:
- Go to the module location:
cd scr/modules/RC5 - Start the interpreter:
ghci RC5.hs - To encrypt:
x = encryption "mar" "123" 10 - You should get the result as:
[(-7273264081479612925,-3122923407712225928),(-625 [(-7273264081479612925,-3122923407712225928),(-6256778535516941383,-1835156827000292027),(4196303171515540263,9185718333346717671)] - The result has type:
List[(Int, Int)] - To decrypt:
decrypt x 10The algorithm use as secret key [1..100] which is the function encrypt and decrypt. Futhermore, the number 10 represent the number of rounds
In case of get an encryption a decryption in Text, use the following functions:
- To encrypt:
x =readytoencrypt "word1" "word2"Expected output:("1225641636062539505x151454429113874280x-3651162783678895878x2720116480418127085x-7618532865284291349","8837152007312300700x-8727207976567962814x-4677416727520607510x5575231667255447601x6768283349087288632") - To dencrypt:
readytodecrypt (fst x) (snd x)Expected output:("word1","word2")
Nicolas Serrano
The application frontend is based on a web server application designed with the Spock Framework. The architecture has the following distribution:

The frontend would use the following data types:
- User
- First name
- Last name
- Birthday
- Password
- Occupation
- ServerState
- UserList
- Server
- The web server
Carlos Munoz
The Data Management module is devoted to extract information from the database (a .csv file), manipulate it and write it down again. To do so it follows the following procedure:
- Parsing the information from the database through
Data.Text.IO.readFile. - Decoding the data as a list of
Userdata type. - Manipulation of data is posible at this stage using e.g
returnprivate,removedefault,getusertype. - Encoding the modified list of Users into a Text string
- Writing the encoded data in database through
Data.Text.IO.writeFile.
If you have a question, comment or improvement; please feel free to reach out by posting an issue.