File: DES.hs

package info (click to toggle)
haskell-crypto 4.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 344 kB
  • sloc: haskell: 2,949; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 1,131 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
-----------------------------------------------------------------------------
-- |
-- Module      :  Codec.Encryption.DES
-- Copyright   :  (c) Dominic Steinitz 2003
-- License     :  BSD-style (see the file ReadMe.tex)
-- 
-- Maintainer  :  dominic.steinitz@blueyonder.co.uk
-- Stability   :  experimental
-- Portability :  portable
--
-- Takes the DES module supplied by Ian Lynagh and wraps it so it can
-- used with the standard modes.
--
-- See <http://web.comlab.ox.ac.uk/oucl/work/ian.lynagh/>.
--
-----------------------------------------------------------------------------

module Codec.Encryption.DES (
   -- * Function Types 
   encrypt, decrypt) where

import Codec.Encryption.DESAux
import Data.Word

-- | Basic DES encryption which takes a key and a block of plaintext 
-- and returns the encrypted block of ciphertext according to the standard.

encrypt :: Word64 -> Word64 -> Word64
encrypt = flip des_enc

-- | Basic DES decryption which takes a key and a block of ciphertext and
-- returns the decrypted block of plaintext according to the standard.

decrypt :: Word64 -> Word64 -> Word64
decrypt = flip des_dec